mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-02-16 11:25:07 +00:00
Fix typos in spring-security core module
This commit is contained in:
parent
318dec845a
commit
1589d19c8b
core/src
main/java/org/springframework/security
authentication/jaas
authorization/event
core
test/java/org/springframework/security/authentication
@ -165,7 +165,7 @@ public abstract class AbstractJaasAuthenticationProvider implements Authenticati
|
|||||||
}
|
}
|
||||||
Set<GrantedAuthority> authorities;
|
Set<GrantedAuthority> authorities;
|
||||||
try {
|
try {
|
||||||
// Create the LoginContext object, and pass our InternallCallbackHandler
|
// Create the LoginContext object, and pass our InternalCallbackHandler
|
||||||
LoginContext loginContext = createLoginContext(new InternalCallbackHandler(auth));
|
LoginContext loginContext = createLoginContext(new InternalCallbackHandler(auth));
|
||||||
// Attempt to login the user, the LoginContext will call our
|
// Attempt to login the user, the LoginContext will call our
|
||||||
// InternalCallbackHandler at this point.
|
// InternalCallbackHandler at this point.
|
||||||
@ -284,7 +284,7 @@ public abstract class AbstractJaasAuthenticationProvider implements Authenticati
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the AuthorityGrannter array that was passed to the
|
* Returns the AuthorityGranter array that was passed to the
|
||||||
* {@link #setAuthorityGranters(AuthorityGranter[])} method, or null if it none were
|
* {@link #setAuthorityGranters(AuthorityGranter[])} method, or null if it none were
|
||||||
* ever set.
|
* ever set.
|
||||||
* @return The AuthorityGranter array, or null
|
* @return The AuthorityGranter array, or null
|
||||||
@ -318,7 +318,7 @@ public abstract class AbstractJaasAuthenticationProvider implements Authenticati
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the JAASAuthentcationCallbackHandler array to handle callback objects generated
|
* Set the JAASAuthenticationCallbackHandler array to handle callback objects generated
|
||||||
* by the LoginContext.login method.
|
* by the LoginContext.login method.
|
||||||
* @param callbackHandlers Array of JAASAuthenticationCallbackHandlers
|
* @param callbackHandlers Array of JAASAuthenticationCallbackHandlers
|
||||||
*/
|
*/
|
||||||
|
@ -22,7 +22,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* The AuthorityGranter interface is used to map a given principal to role names.
|
* The AuthorityGranter interface is used to map a given principal to role names.
|
||||||
* <p>
|
* <p>
|
||||||
* If a Windows NT login module were to be used from JAAS, an AuthrityGranter
|
* If a Windows NT login module were to be used from JAAS, an AuthorityGranter
|
||||||
* implementation could be created to map a NT Group Principal to a ROLE_USER role for
|
* implementation could be created to map a NT Group Principal to a ROLE_USER role for
|
||||||
* instance.
|
* instance.
|
||||||
*
|
*
|
||||||
@ -34,12 +34,12 @@ public interface AuthorityGranter {
|
|||||||
* The grant method is called for each principal returned from the LoginContext
|
* The grant method is called for each principal returned from the LoginContext
|
||||||
* subject. If the AuthorityGranter wishes to grant any authorities, it should return
|
* subject. If the AuthorityGranter wishes to grant any authorities, it should return
|
||||||
* a java.util.Set containing the role names it wishes to grant, such as ROLE_USER. If
|
* a java.util.Set containing the role names it wishes to grant, such as ROLE_USER. If
|
||||||
* the AuthrityGranter does not wish to grant any authorities it should return null.
|
* the AuthorityGranter does not wish to grant any authorities it should return null.
|
||||||
* <p>
|
* <p>
|
||||||
* The set may contain any object as all objects in the returned set will be passed to
|
* The set may contain any object as all objects in the returned set will be passed to
|
||||||
* the JaasGrantedAuthority constructor using toString().
|
* the JaasGrantedAuthority constructor using toString().
|
||||||
* @param principal One of the principals from the
|
* @param principal One of the principals from the
|
||||||
* LoginContext.getSubect().getPrincipals() method.
|
* LoginContext.getSubject().getPrincipals() method.
|
||||||
* @return the role names to grant, or null, meaning no roles should be granted to the
|
* @return the role names to grant, or null, meaning no roles should be granted to the
|
||||||
* principal.
|
* principal.
|
||||||
*/
|
*/
|
||||||
|
2
core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java
2
core/src/main/java/org/springframework/security/authentication/jaas/JaasAuthenticationProvider.java
@ -67,7 +67,7 @@ import org.springframework.util.Assert;
|
|||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* The loginContextName should coincide with a given index in the loginConfig specifed.
|
* The loginContextName should coincide with a given index in the loginConfig specified.
|
||||||
* The loginConfig file used in the JUnit tests appears as the following...
|
* The loginConfig file used in the JUnit tests appears as the following...
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -66,7 +66,7 @@ public class AuthorizationEvent extends ApplicationEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the response to the princpal's request
|
* Get the response to the principal's request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public AuthorizationDecision getAuthorizationDecision() {
|
public AuthorizationDecision getAuthorizationDecision() {
|
||||||
|
@ -133,7 +133,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a pseduo random number (hex encoded)
|
* @return a pseudo random number (hex encoded)
|
||||||
*/
|
*/
|
||||||
private String generatePseudoRandomNumber() {
|
private String generatePseudoRandomNumber() {
|
||||||
byte[] randomBytes = new byte[this.pseudoRandomNumberBytes];
|
byte[] randomBytes = new byte[this.pseudoRandomNumberBytes];
|
||||||
|
@ -28,7 +28,7 @@ public interface ReactiveUserDetailsPasswordService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify the specified user's password. This should change the user's password in the
|
* Modify the specified user's password. This should change the user's password in the
|
||||||
* persistent user repository (datbase, LDAP etc).
|
* persistent user repository (database, LDAP etc).
|
||||||
* @param user the user to modify the password for
|
* @param user the user to modify the password for
|
||||||
* @param newPassword the password to change to
|
* @param newPassword the password to change to
|
||||||
* @return the updated UserDetails with the new password
|
* @return the updated UserDetails with the new password
|
||||||
|
@ -35,7 +35,7 @@ public class UsernamePasswordAuthenticationTokenTests {
|
|||||||
public void authenticatedPropertyContractIsSatisfied() {
|
public void authenticatedPropertyContractIsSatisfied() {
|
||||||
UsernamePasswordAuthenticationToken grantedToken = UsernamePasswordAuthenticationToken.authenticated("Test",
|
UsernamePasswordAuthenticationToken grantedToken = UsernamePasswordAuthenticationToken.authenticated("Test",
|
||||||
"Password", AuthorityUtils.NO_AUTHORITIES);
|
"Password", AuthorityUtils.NO_AUTHORITIES);
|
||||||
// check default given we passed some GrantedAuthorty[]s (well, we passed empty
|
// check default given we passed some GrantedAuthority[]s (well, we passed empty
|
||||||
// list)
|
// list)
|
||||||
assertThat(grantedToken.isAuthenticated()).isTrue();
|
assertThat(grantedToken.isAuthenticated()).isTrue();
|
||||||
// check explicit set to untrusted (we can safely go from trusted to untrusted,
|
// check explicit set to untrusted (we can safely go from trusted to untrusted,
|
||||||
@ -43,7 +43,7 @@ public class UsernamePasswordAuthenticationTokenTests {
|
|||||||
grantedToken.setAuthenticated(false);
|
grantedToken.setAuthenticated(false);
|
||||||
assertThat(!grantedToken.isAuthenticated()).isTrue();
|
assertThat(!grantedToken.isAuthenticated()).isTrue();
|
||||||
// Now let's create a UsernamePasswordAuthenticationToken without any
|
// Now let's create a UsernamePasswordAuthenticationToken without any
|
||||||
// GrantedAuthorty[]s (different constructor)
|
// GrantedAuthority[]s (different constructor)
|
||||||
UsernamePasswordAuthenticationToken noneGrantedToken = UsernamePasswordAuthenticationToken
|
UsernamePasswordAuthenticationToken noneGrantedToken = UsernamePasswordAuthenticationToken
|
||||||
.unauthenticated("Test", "Password");
|
.unauthenticated("Test", "Password");
|
||||||
assertThat(!noneGrantedToken.isAuthenticated()).isTrue();
|
assertThat(!noneGrantedToken.isAuthenticated()).isTrue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user