Skip to content

Commit

Permalink
Fix typos in spring-security core module
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-lukas authored and marcusdacoregio committed Oct 31, 2023
1 parent 318dec8 commit 1589d19
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public Authentication authenticate(Authentication auth) throws AuthenticationExc
}
Set<GrantedAuthority> authorities;
try {
// Create the LoginContext object, and pass our InternallCallbackHandler
// Create the LoginContext object, and pass our InternalCallbackHandler
LoginContext loginContext = createLoginContext(new InternalCallbackHandler(auth));
// Attempt to login the user, the LoginContext will call our
// InternalCallbackHandler at this point.
Expand Down Expand Up @@ -284,7 +284,7 @@ protected void publishSuccessEvent(UsernamePasswordAuthenticationToken token) {
}

/**
* 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
* ever set.
* @return The AuthorityGranter array, or null
Expand Down Expand Up @@ -318,7 +318,7 @@ JaasAuthenticationCallbackHandler[] getCallbackHandlers() {
}

/**
* Set the JAASAuthentcationCallbackHandler array to handle callback objects generated
* Set the JAASAuthenticationCallbackHandler array to handle callback objects generated
* by the LoginContext.login method.
* @param callbackHandlers Array of JAASAuthenticationCallbackHandlers
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* The AuthorityGranter interface is used to map a given principal to role names.
* <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
* instance.
*
Expand All @@ -34,12 +34,12 @@ public interface AuthorityGranter {
* The grant method is called for each principal returned from the LoginContext
* 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
* 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>
* The set may contain any object as all objects in the returned set will be passed to
* the JaasGrantedAuthority constructor using toString().
* @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
* principal.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* </pre>
*
* <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...
*
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Object getObject() {
}

/**
* Get the response to the princpal's request
* Get the response to the principal's request
* @return
*/
public AuthorizationDecision getAuthorizationDecision() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public Token verifyToken(String key) {
}

/**
* @return a pseduo random number (hex encoded)
* @return a pseudo random number (hex encoded)
*/
private String generatePseudoRandomNumber() {
byte[] randomBytes = new byte[this.pseudoRandomNumberBytes];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface ReactiveUserDetailsPasswordService {

/**
* 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 newPassword the password to change to
* @return the updated UserDetails with the new password
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public class UsernamePasswordAuthenticationTokenTests {
public void authenticatedPropertyContractIsSatisfied() {
UsernamePasswordAuthenticationToken grantedToken = UsernamePasswordAuthenticationToken.authenticated("Test",
"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)
assertThat(grantedToken.isAuthenticated()).isTrue();
// check explicit set to untrusted (we can safely go from trusted to untrusted,
// but not the reverse)
grantedToken.setAuthenticated(false);
assertThat(!grantedToken.isAuthenticated()).isTrue();
// Now let's create a UsernamePasswordAuthenticationToken without any
// GrantedAuthorty[]s (different constructor)
// GrantedAuthority[]s (different constructor)
UsernamePasswordAuthenticationToken noneGrantedToken = UsernamePasswordAuthenticationToken
.unauthenticated("Test", "Password");
assertThat(!noneGrantedToken.isAuthenticated()).isTrue();
Expand Down

0 comments on commit 1589d19

Please sign in to comment.