public void validate(SecurityAuthProviderConfig config) throws SecurityConfigException { if (isNotEmpty(config.getUserGroupServiceName())) { if (getNamesFor(GeoServerUserGroupService.class) .contains(config.getUserGroupServiceName()) == false) throw createSecurityException( USERGROUP_SERVICE_NOT_FOUND_$1, config.getUserGroupServiceName()); } }
public void validateAddNamedService(Class<?> extensionPoint, SecurityNamedServiceConfig config) throws SecurityConfigException { checkExtensionPont(extensionPoint, config.getClassName()); checkServiceName(extensionPoint, config.getName()); SortedSet<String> names = getNamesFor(extensionPoint); if (names.contains(config.getName())) throw createSecurityException(alreadyExistsErrorCode(extensionPoint), config.getName()); }
public void validateModifiedNamedService( Class<?> extensionPoint, SecurityNamedServiceConfig config) throws SecurityConfigException { checkExtensionPont(extensionPoint, config.getClassName()); checkServiceName(extensionPoint, config.getName()); SortedSet<String> names = getNamesFor(extensionPoint); if (names.contains(config.getName()) == false) throw createSecurityException(notFoundErrorCode(extensionPoint), config.getName()); }
public void validate(SecurityUserGroupServiceConfig config) throws SecurityConfigException { String encoderName = config.getPasswordEncoderName(); GeoServerPasswordEncoder encoder = null; if (isNotEmpty(encoderName)) { try { encoder = manager.loadPasswordEncoder(encoderName); } catch (NoSuchBeanDefinitionException ex) { throw createSecurityException(INVALID_CONFIG_PASSWORD_ENCODER_$1, encoderName); } if (encoder == null) { throw createSecurityException(INVALID_CONFIG_PASSWORD_ENCODER_$1, encoderName); } } else { throw createSecurityException(PASSWD_ENCODER_REQUIRED_$1, config.getName()); } if (!manager.isStrongEncryptionAvailable()) { if (encoder != null && encoder.isAvailableWithoutStrongCryptogaphy() == false) { throw createSecurityException(INVALID_STRONG_PASSWORD_ENCODER); } } String policyName = config.getPasswordPolicyName(); if (isNotEmpty(policyName) == false) { throw createSecurityException(PASSWD_POLICY_REQUIRED_$1, config.getName()); } if (getNamesFor(PasswordValidator.class).contains(policyName) == false) { throw createSecurityException(PASSWD_POLICY_NOT_FOUND_$1, policyName); } }