@Override public String getName() { return delegate.getName(); }
public String getName() { return service.getName(); }
@Override public String toString() { StringBuffer buff = new StringBuffer(); String serviceName = service == null ? "UNKNOWN" : service.getName(); buff.append("FileWatcher for ").append(serviceName); buff.append(", ").append(getFileInfo()); return buff.toString(); }
@Override public void initializeFor(GeoServerUserGroupService service) throws IOException { if (!keystoreProvider.hasUserGroupKey(service.getName())) { throw new IOException( "No key alias: " + keystoreProvider.aliasForGroupService(service.getName()) + " in key store: " + keystoreProvider.getResource().path()); } keyAliasInKeyStore = keystoreProvider.aliasForGroupService(service.getName()); }
public GeoServerMultiplexingPasswordEncoder( GeoServerSecurityManager secMgr, GeoServerUserGroupService service) { encoders = new HashSet<GeoServerPasswordEncoder>(); for (GeoServerPasswordEncoder enc : secMgr.loadPasswordEncoders()) { if (StringUtils.hasLength(enc.getPrefix())) { if (service != null) { try { if (enc instanceof GeoServerPBEPasswordEncoder) { if (!secMgr.getKeyStoreProvider().hasUserGroupKey(service.getName())) { continue; // cannot use pbe encoder, no key } } enc.initializeFor(service); } catch (IOException e) { throw new RuntimeException(e); } } encoders.add(enc); } } }
upAuthConfig.setName(GeoServerAuthenticationProvider.DEFAULT_NAME); upAuthConfig.setClassName(UsernamePasswordAuthenticationProvider.class.getName()); upAuthConfig.setUserGroupServiceName(userGroupService.getName());
protected void createServices() throws Exception { GeoServerRoleService rservice = createRoleService("rs1"); GeoServerRoleStore rstore = rservice.createStore(); GeoServerRole root, derived; rstore.addRole(root = rstore.createRoleObject(rootRole)); rstore.addRole(derived = rstore.createRoleObject(derivedRole)); rstore.setParentRole(derived, root); rstore.associateRoleToUser(derived, testUserName); rstore.associateRoleToUser(derived, "castest"); rstore.store(); SecurityManagerConfig mconfig = getSecurityManager().loadSecurityConfig(); mconfig.setRoleServiceName("rs1"); getSecurityManager().saveSecurityConfig(mconfig); GeoServerUserGroupService ugservice = createUserGroupService("ug1"); GeoServerUserGroupStore ugstore = ugservice.createStore(); GeoServerUser u1 = ugstore.createUserObject(testUserName, testPassword, true); ugstore.addUser(u1); GeoServerUser u2 = ugstore.createUserObject("abc@xyz.com", "abc", true); ugstore.addUser(u2); GeoServerUser u3 = ugstore.createUserObject("castest", "castest", true); ugstore.addUser(u3); ugstore.store(); GeoServerAuthenticationProvider prov = createAuthProvider(testProviderName, ugservice.getName()); prepareAuthProviders(prov.getName()); }
public void testConfiguration() { try { setServices("config"); assertEquals(roleService,getSecurityManager().getActiveRoleService()); //assertEquals(usergroupService,getSecurityManager().getActiveUserGroupService()); assertEquals(usergroupService.getName(), getSecurityManager().loadUserGroupService(getFixtureId()).getName()); assertTrue(roleService.canCreateStore()); assertTrue(usergroupService.canCreateStore()); } catch (Exception ex) { Assert.fail(ex.getMessage()); } }
@Test public void testConfiguration() throws Exception { setServices("config"); assertEquals(roleService, getSecurityManager().getActiveRoleService()); // assertEquals(usergroupService,getSecurityManager().getActiveUserGroupService()); assertEquals( usergroupService.getName(), getSecurityManager().loadUserGroupService(getFixtureId()).getName()); assertTrue(roleService.canCreateStore()); assertTrue(usergroupService.canCreateStore()); } }
@Test public void testConfiguration() throws Exception { setServices("config"); assertEquals(roleService, getSecurityManager().getActiveRoleService()); // assertEquals(usergroupService,getSecurityManager().getActiveUserGroupService()); assertEquals( usergroupService.getName(), getSecurityManager().loadUserGroupService("config").getName()); assertTrue(roleService.canCreateStore()); assertTrue(usergroupService.canCreateStore()); }
GeoServerUser user = ugService.getUserByUsername(ADMIN_USERNAME); if (user != null) { changeItPage = new EditUserPage(ugService.getName(), user);
GeoServerUser user = ugService.getUserByUsername(ADMIN_USERNAME); if (user != null) { changeItPage = new EditUserPage(ugService.getName(), user);
GeoServerUser user = ugService.getUserByUsername(ADMIN_USERNAME); if (user != null) { changeItPage = new EditUserPage(ugService.getName(), user);
public void testAuthentificationWithUserGroupService() throws Exception { GeoServerRoleService roleService = createRoleService("jdbc2"); GeoServerUserGroupService ugService = createUserGroupService("jdbc2"); JDBCConnectAuthProviderConfig config = createAuthConfg("jdbc2", ugService.getName()); getSecurityManager().saveAuthenticationProvider(config); GeoServerAuthenticationProvider provider = getSecurityManager().loadAuthenticationProvider("jdbc2");
new File( securityManager.get("security/usergroup").dir(), userService.getName()), XMLConstants.FILE_UR_SCHEMA); assertTrue(userXSD.exists());
GeoServerRoleService roleService = createRoleService("jdbc2"); GeoServerUserGroupService ugService = createUserGroupService("jdbc2"); JDBCConnectAuthProviderConfig config = createAuthConfg("jdbc2", ugService.getName()); getSecurityManager().saveAuthenticationProvider(config); GeoServerAuthenticationProvider provider =
char[] passwordArray = password.toCharArray(); KeyStoreProvider keyStoreProvider = getSecurityManager().getKeyStoreProvider(); keyStoreProvider.setUserGroupKey(service.getName(), password.toCharArray()); assertEquals( encoder.getKeyAliasInKeyStore(), keyStoreProvider.aliasForGroupService(service.getName()));
expect(ugService1.getName()).andReturn("test1").anyTimes(); expect(secMgr.loadUserGroupService("test1")).andReturn(ugService1).anyTimes(); expect(ugService2.getName()).andReturn("test2").anyTimes(); expect(ugService2.getGroupCount()).andReturn(1).anyTimes(); expect(secMgr.loadUserGroupService("test2")).andReturn(ugService2).anyTimes(); expect(ugServiceModify.getName()).andReturn("testModify").anyTimes(); expect(secMgr.loadUserGroupService("testModify")).andReturn(ugService2).anyTimes();
getSecurityManager().loadUserGroupServiceConfig(service.getName()); config.setPasswordEncoderName(getPlainTextPasswordEncoder().getName()); getSecurityManager().saveUserGroupService(config);