public void postConfigure(GeoServerSecurityManager secMgr) { // TODO, Justin // Not sure if this is correct, if it is, you can add the constant chain // for the root user login for (GeoServerSecurityProvider p : secMgr.lookupSecurityProviders()) { p.configureFilterChain(this); } }
private XStreamPersister buildPersister() { List<GeoServerSecurityProvider> all = lookupSecurityProviders(); // create and configure an xstream persister to load the configuration files XStreamPersister xp = new XStreamPersisterFactory().createXMLPersister(); xp.getXStream().alias("security", SecurityManagerConfig.class); for (GeoServerSecurityProvider roleService : all) { roleService.configure(xp); } return xp; }
for (GeoServerSecurityProvider p : lookupSecurityProviders()) { if (p.getMasterPasswordProviderClass() == null) { continue;
/** Loads the password policy for the named config from persistence. */ public PasswordValidator load(String name) throws IOException { PasswordPolicyConfig config = loadConfig(name); if (config == null) { // no such config return null; } // look up the validator for this config PasswordValidator validator = null; for (GeoServerSecurityProvider p : lookupSecurityProviders()) { if (p.getPasswordValidatorClass() == null) { continue; } if (p.getPasswordValidatorClass().getName().equals(config.getClassName())) { validator = p.createPasswordValidator(config, GeoServerSecurityManager.this); break; } } if (validator == null) { throw new IOException("No password policy matching config: " + config); } validator.setConfig(config); return validator; }
/** Loads the auth provider for the named config from persistence. */ public GeoServerAuthenticationProvider load(String name) throws IOException { SecurityNamedServiceConfig config = loadConfig(name); if (config == null) { // no such config return null; } // look up the service for this config GeoServerAuthenticationProvider authProvider = null; for (GeoServerSecurityProvider p : lookupSecurityProviders()) { if (p.getAuthenticationProviderClass() == null) { continue; } if (p.getAuthenticationProviderClass().getName().equals(config.getClassName())) { authProvider = p.createAuthenticationProvider(config); break; } } if (authProvider == null) { throw new IOException("No authentication provider matching config: " + config); } authProvider.setName(name); authProvider.setSecurityManager(GeoServerSecurityManager.this); authProvider.initializeFromConfig(config); return authProvider; }
/** Loads the filter for the named config from persistence. */ public GeoServerSecurityFilter load(String name) throws IOException { SecurityNamedServiceConfig config = loadConfig(name); if (config == null) { // no such config return null; } // look up the service for this config GeoServerSecurityFilter filter = null; for (GeoServerSecurityProvider p : lookupSecurityProviders()) { if (p.getFilterClass() == null) { continue; } if (p.getFilterClass().getName().equals(config.getClassName())) { filter = p.createFilter(config); break; } } if (filter == null) { throw new IOException("No authentication provider matching config: " + config); } filter.setName(name); filter.setSecurityManager(GeoServerSecurityManager.this); filter.initializeFromConfig(config); return filter; }
for (GeoServerSecurityProvider prov : lookupSecurityProviders()) { configClasses.addAll(prov.getFieldsForEncryption().keySet());
for (GeoServerSecurityProvider p : lookupSecurityProviders()) { if (p.getUserGroupServiceClass() == null) { continue;
for (GeoServerSecurityProvider p : lookupSecurityProviders()) { if (p.getRoleServiceClass() == null) { continue;