Correct "doesn't exists" typos - fixes KEYCLOAK-14986 (#7316)

* Correct "doesn't exists" typos

* Revert changes to imported package

Co-authored-by: Stian Thorgersen <stianst@gmail.com>
This commit is contained in:
Andrew Elwell 2021-03-16 21:52:36 +11:00 committed by GitHub
parent d2c98b20f3
commit c76ca4ad13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 35 additions and 35 deletions

View file

@ -101,7 +101,7 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat
// Possible scenarios:
// 1) The deployment has a keycloak.config.resolver specified and it exists:
// Outcome: adapter uses the resolver
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exists, isn't a resolver, ...) :
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exist, isn't a resolver, ...) :
// Outcome: adapter is left unconfigured
// 3) The deployment doesn't have a keycloak.config.resolver , but has a keycloak.json (or equivalent)
// Outcome: adapter uses it

View file

@ -115,7 +115,7 @@ public class KeycloakServletExtension implements ServletExtension {
// Possible scenarios:
// 1) The deployment has a keycloak.config.resolver specified and it exists:
// Outcome: adapter uses the resolver
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exists, isn't a resolver, ...) :
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exist, isn't a resolver, ...) :
// Outcome: adapter is left unconfigured
// 3) The deployment doesn't have a keycloak.config.resolver , but has a keycloak.json (or equivalent)
// Outcome: adapter uses it

View file

@ -87,7 +87,7 @@ public abstract class AbstractSamlAuthenticatorValve extends FormAuthenticator i
// Possible scenarios:
// 1) The deployment has a keycloak.config.resolver specified and it exists:
// Outcome: adapter uses the resolver
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exists, isn't a resolver, ...) :
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exist, isn't a resolver, ...) :
// Outcome: adapter is left unconfigured
// 3) The deployment doesn't have a keycloak.config.resolver , but has a keycloak.json (or equivalent)
// Outcome: adapter uses it

View file

@ -108,7 +108,7 @@ public class SamlServletExtension implements ServletExtension {
// Possible scenarios:
// 1) The deployment has a keycloak.config.resolver specified and it exists:
// Outcome: adapter uses the resolver
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exists, isn't a resolver, ...) :
// 2) The deployment has a keycloak.config.resolver and isn't valid (doesn't exist, isn't a resolver, ...) :
// Outcome: adapter is left unconfigured
// 3) The deployment doesn't have a keycloak.config.resolver , but has a keycloak.json (or equivalent)
// Outcome: adapter uses it

View file

@ -287,7 +287,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
});
}
// Possibly remove keycloak groups, which doesn't exists in LDAP
// Possibly remove keycloak groups, which don't exist in LDAP
if (config.isDropNonExistingGroupsDuringSync()) {
dropNonExistingKcGroups(realm, syncResult, visitedGroupIds);
}
@ -300,7 +300,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
updateKeycloakGroupTreeEntry(realm, groupEntry, ldapGroups, null, syncResult, visitedGroupIds);
}
// Possibly remove keycloak groups, which doesn't exists in LDAP
// Possibly remove keycloak groups, which don't exist in LDAP
if (config.isDropNonExistingGroupsDuringSync()) {
dropNonExistingKcGroups(realm, syncResult, visitedGroupIds);
}
@ -337,7 +337,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
}
private void dropNonExistingKcGroups(RealmModel realm, SynchronizationResult syncResult, Set<String> visitedGroupIds) {
// Remove keycloak groups, which doesn't exists in LDAP
// Remove keycloak groups, which don't exist in LDAP
getAllKcGroups(realm)
.filter(kcGroup -> !visitedGroupIds.contains(kcGroup.getId()))
.forEach(kcGroup -> {
@ -398,7 +398,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
// Could theoretically happen on some LDAP servers if 'memberof' style is used and 'memberof' attribute of user references non-existing group
if (kcGroup == null) {
String groupName = ldapGroup.getAttributeAsString(config.getGroupNameLdapAttribute());
logger.warnf("User '%s' is member of group '%s', which doesn't exists in LDAP", user.getUsername(), groupName);
logger.warnf("User '%s' is member of group '%s', which doesn't exist in LDAP", user.getUsername(), groupName);
}
}
@ -445,7 +445,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
}
// Map to track all LDAP groups also exists in Keycloak
// Map to track all LDAP groups also exist in Keycloak
Set<String> ldapGroupNames = new HashSet<>();
// Create or update KC groups to LDAP including their attributes
@ -538,7 +538,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
}
// Recursively check if parent group exists in LDAP. If yes, then return current group. If not, then recursively call this method
// for the predecessor. Result is the highest group, which doesn't yet exists in LDAP (and hence requires sync to LDAP)
// for the predecessor. Result is the highest group, which doesn't yet exist in LDAP (and hence requires sync to LDAP)
private GroupModel getHighestPredecessorNotExistentInLdap(GroupModel groupsPathGroup, GroupModel group) {
GroupModel parentGroup = group.getParent();
if (parentGroup == groupsPathGroup) {
@ -550,7 +550,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
// Parent exists in LDAP. Let's return current group
return group;
} else {
// Parent doesn't exists in LDAP. Let's recursively go up.
// Parent doesn't exist in LDAP. Let's recursively go up.
return getHighestPredecessorNotExistentInLdap(groupsPathGroup, parentGroup);
}
}
@ -737,7 +737,7 @@ public class GroupLDAPStorageMapper extends AbstractLDAPStorageMapper implements
super.leaveGroup(group);
}
} else {
// Group mappings exists in LDAP. For LDAP_ONLY mode, we can just delete it in LDAP. For READ_ONLY we can't delete it -> throw error
// Group mapping exists in LDAP. For LDAP_ONLY mode, we can just delete it in LDAP. For READ_ONLY we can't delete it -> throw error
if (config.getMode() == LDAPGroupMapperMode.READ_ONLY) {
throw new ModelException("Not possible to delete LDAP group mappings as mapper mode is READ_ONLY");
} else {

View file

@ -119,9 +119,9 @@ public class GroupTreeResolver {
} else if (ignoreMissingGroups) {
// Need to remove the missing group
iterator.remove();
logger.debug("Group '" + child + "' referenced as member of group '" + group.getGroupName() + "' doesn't exists. Ignoring.");
logger.debug("Group '" + child + "' referenced as member of group '" + group.getGroupName() + "' doesn't exist. Ignoring.");
} else {
throw new GroupTreeResolveException("Group '" + child + "' referenced as member of group '" + group.getGroupName() + "' doesn't exists");
throw new GroupTreeResolveException("Group '" + child + "' referenced as member of group '" + group.getGroupName() + "' doesn't exist");
}
}
}

View file

@ -119,7 +119,7 @@ public class GroupTreeResolverTest {
resolver.resolveGroupTree(groups, false);
Assert.fail("Exception expected because of missing referenced group");
} catch (GroupTreeResolver.GroupTreeResolveException gre) {
Assert.assertEquals("Group 'group3' referenced as member of group 'group2' doesn't exists", gre.getMessage());
Assert.assertEquals("Group 'group3' referenced as member of group 'group2' doesn't exist", gre.getMessage());
}
List<GroupTreeResolver.GroupTreeEntry> groupTree = resolver.resolveGroupTree(groups, true);

View file

@ -320,7 +320,7 @@ public class RepresentationToModel {
if (clientScope != null) {
newRealm.addDefaultClientScope(clientScope, true);
} else {
logger.warnf("Referenced client scope '%s' doesn't exists", clientScopeName);
logger.warnf("Referenced client scope '%s' doesn't exist", clientScopeName);
}
}
}
@ -330,7 +330,7 @@ public class RepresentationToModel {
if (clientScope != null) {
newRealm.addDefaultClientScope(clientScope, false);
} else {
logger.warnf("Referenced client scope '%s' doesn't exists", clientScopeName);
logger.warnf("Referenced client scope '%s' doesn't exist", clientScopeName);
}
}
}
@ -1500,7 +1500,7 @@ public class RepresentationToModel {
if (clientScope != null) {
client.addClientScope(clientScope, defaultScope);
} else {
logger.warnf("Referenced client scope '%s' doesn't exists. Ignoring", clientScopeName);
logger.warnf("Referenced client scope '%s' doesn't exist. Ignoring", clientScopeName);
}
}

View file

@ -54,7 +54,7 @@ public class DirImportProvider implements ImportProvider {
// Delete and recreate directory inside tmp
this.rootDirectory = new File(tempDir + "/keycloak-export");
if (!this.rootDirectory .exists()) {
throw new IllegalStateException("Directory " + this.rootDirectory + " doesn't exists");
throw new IllegalStateException("Directory " + this.rootDirectory + " doesn't exist");
}
logger.infof("Importing from directory %s", this.rootDirectory.getAbsolutePath());
@ -64,7 +64,7 @@ public class DirImportProvider implements ImportProvider {
this.rootDirectory = rootDirectory;
if (!this.rootDirectory.exists()) {
throw new IllegalStateException("Directory " + this.rootDirectory + " doesn't exists");
throw new IllegalStateException("Directory " + this.rootDirectory + " doesn't exist");
}
logger.infof("Importing from directory %s", this.rootDirectory.getAbsolutePath());

View file

@ -62,7 +62,7 @@ public class AuthenticationContextBean {
public String getAttemptedUsername() {
String username = context.getAuthenticationSession().getAuthNote(AbstractUsernameFormAuthenticator.ATTEMPTED_USERNAME);
// Fallback to real username of the user just if attemptedUsername doesn't exists
// Fallback to real username of the user just if attemptedUsername doesn't exist
if (username == null) {
username = context.getUser().getUsername();
}

View file

@ -301,7 +301,7 @@ public class AuthenticationManager {
RootAuthenticationSessionModel rootLogoutSession = null;
boolean browserCookiePresent = false;
// Try to lookup current authSessionId from browser cookie. If doesn't exists, use the same as current userSession
// Try to lookup current authSessionId from browser cookie. If doesn't exist, use the same as current userSession
if (browserCookie) {
rootLogoutSession = asm.getCurrentRootAuthenticationSession(realm);
}

View file

@ -68,7 +68,7 @@ public class UserSessionCrossDCManager {
AuthSessionId authSessionId = asm.decodeAuthSessionId(oldEncodedId);
String sessionId = authSessionId.getDecodedId();
// This will remove userSession "locally" if it doesn't exists on remoteCache
// This will remove userSession "locally" if it doesn't exist on remoteCache
kcSession.sessions().getUserSessionWithPredicate(realm, sessionId, false, (UserSessionModel userSession2) -> userSession2 == null);
UserSessionModel userSession = kcSession.sessions().getUserSession(realm, sessionId);

View file

@ -406,7 +406,7 @@ public class AuthenticationManagementResource {
AuthenticationFlowModel parentFlow = realm.getFlowByAlias(flowAlias);
if (parentFlow == null) {
return ErrorResponse.error("Parent flow doesn't exists", Response.Status.BAD_REQUEST);
return ErrorResponse.error("Parent flow doesn't exist", Response.Status.BAD_REQUEST);
}
String alias = data.get("alias");
String type = data.get("type");
@ -462,7 +462,7 @@ public class AuthenticationManagementResource {
AuthenticationFlowModel parentFlow = realm.getFlowByAlias(flowAlias);
if (parentFlow == null) {
throw new BadRequestException("Parent flow doesn't exists");
throw new BadRequestException("Parent flow doesn't exist");
}
if (parentFlow.isBuiltIn()) {
throw new BadRequestException("It is illegal to add execution to a built in flow");

View file

@ -761,7 +761,7 @@ public class TestingResourceProvider implements RealmResourceProvider {
RealmModel realm = getRealmByName(realmName);
ClientModel serviceClient = realm.getClientByClientId(clientId);
if (serviceClient == null) {
throw new NotFoundException("Referenced service client doesn't exists");
throw new NotFoundException("Referenced service client doesn't exist");
}
ClientScopeModel clientScopeModel = realm.addClientScope(clientId);

View file

@ -226,10 +226,10 @@ public class SendUsernameServlet {
return output;
}
return "SamlSession doesn't exists";
return "SamlSession doesn't exist";
}
return "Session doesn't exists";
return "Session doesn't exist";
}
private String getRoles() {

View file

@ -211,7 +211,7 @@ public class FlowTest extends AbstractAuthenticationTest {
// Check deleting flow second time will fail
try {
authMgmtResource.deleteFlow("id-123-notExistent");
Assert.fail("Not expected to delete flow, which doesn't exists");
Assert.fail("Not expected to delete flow, which doesn't exist");
} catch (NotFoundException nfe) {
// Expected
}

View file

@ -1316,10 +1316,10 @@ public class BrowserFlowTest extends AbstractTestRealmKeycloakTest {
AuthenticationFlowRepresentation flowRepresentation = AbstractAuthenticationTest.findFlowByAlias(flowToDeleteAlias, flows);
// Throw error if flow doesn't exists to ensure we did not accidentally use different alias of non-existing flow when
// Throw error if flow doesn't exist to ensure we did not accidentally use different alias of non-existing flow when
// calling this method
if (flowRepresentation == null) {
throw new IllegalArgumentException("The flow with alias " + flowToDeleteAlias + " did not exists");
throw new IllegalArgumentException("The flow with alias " + flowToDeleteAlias + " did not exist");
}
realmResource.flows().deleteFlow(flowRepresentation.getId());

View file

@ -215,7 +215,7 @@ public class ResetPasswordTest extends AbstractTestRealmKeycloakTest {
String changePasswordUrl = resetPassword("login-test");
events.clear();
assertSecondPasswordResetFails(changePasswordUrl, oauth.getClientId()); // KC_RESTART doesn't exists, it was deleted after first successful reset-password flow was finished
assertSecondPasswordResetFails(changePasswordUrl, oauth.getClientId()); // KC_RESTART doesn't exist, it was deleted after first successful reset-password flow was finished
}
@Test

View file

@ -58,7 +58,7 @@ public class X509BrowserCRLTest extends AbstractX509AuthenticationTest {
@Test
public void loginSuccessWithEmptyRevocationListFromFile() {
// Not possible to test file CRL on undertow at this moment - jboss config dir doesn't exists
// Not possible to test file CRL on undertow at this moment - jboss config dir doesn't exist
ContainerAssume.assumeNotAuthServerUndertow();
X509AuthenticatorConfigModel config =
@ -74,7 +74,7 @@ public class X509BrowserCRLTest extends AbstractX509AuthenticationTest {
@Test
public void loginFailedWithIntermediateRevocationListFromFile() {
// Not possible to test file CRL on undertow at this moment - jboss config dir doesn't exists
// Not possible to test file CRL on undertow at this moment - jboss config dir doesn't exist
ContainerAssume.assumeNotAuthServerUndertow();
X509AuthenticatorConfigModel config =

View file

@ -221,7 +221,7 @@ public class X509DirectGrantTest extends AbstractX509AuthenticationTest {
@Test
public void loginCertificateRevoked() throws Exception {
// Not possible to test file CRL on undertow at this moment - jboss config dir doesn't exists
// Not possible to test file CRL on undertow at this moment - jboss config dir doesn't exist
ContainerAssume.assumeNotAuthServerUndertow();
X509AuthenticatorConfigModel config =