Examples of MemoryUserGroupServiceConfigImpl


Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

    }
   
    protected SecurityUserGroupServiceConfig createUGConfig(String name, Class<?> aClass,
            String encoder, String policyName) {

        MemoryUserGroupServiceConfigImpl config = new MemoryUserGroupServiceConfigImpl();
        config.setName(name);
        config.setClassName(aClass.getName());
        config.setPasswordEncoderName(encoder);
        config.setPasswordPolicyName(policyName);
        /*SecurityUserGroupServiceConfig ugConfig = createNiceMock(SecurityUserGroupServiceConfig.class);
        expect(ugConfig.getName()).andReturn(name).anyTimes();
        expect(ugConfig.getClassName()).andReturn(aClass.getName()).anyTimes();
        expect(ugConfig.getPasswordEncoderName()).andReturn(encoder).anyTimes();
        expect(ugConfig.getPasswordPolicyName()).andReturn(policyName).anyTimes();
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

        store.store();
    }

    @Override
    public GeoServerUserGroupService createUserGroupService(String name) throws Exception {
        MemoryUserGroupServiceConfigImpl config = (MemoryUserGroupServiceConfigImpl ) createConfigObject(name);        
        getSecurityManager().saveUserGroupService(config);
        return getSecurityManager().loadUserGroupService(name);
   }
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

        return getSecurityManager().loadUserGroupService(name);
   }
   
    @Override
    protected SecurityUserGroupServiceConfig createConfigObject( String name ) {
        MemoryUserGroupServiceConfigImpl config = new MemoryUserGroupServiceConfigImpl();
        config.setClassName(MemoryUserGroupService.class.getName());
         config.setName(name);       
         config.setPasswordEncoderName(getPBEPasswordEncoder().getName());
         config.setPasswordPolicyName(PasswordValidator.DEFAULT_NAME);
        return config;

     }
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

    }
   

    public MemoryUserGroupServiceConfigImpl getUserGroupConfg(String name, String passwordEncoderName) {
        MemoryUserGroupServiceConfigImpl config = new MemoryUserGroupServiceConfigImpl();        
        config.setName(name);
        config.setClassName(MemoryUserGroupService.class.getName());
        config.setPasswordEncoderName(passwordEncoderName);
        config.setPasswordPolicyName(PasswordValidator.DEFAULT_NAME);
        config.setToBeEncrypted("encryptme");
        return config;
    }
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

        return createUserGroupService(name, getPBEPasswordEncoder().getName());

    }
   
    public GeoServerUserGroupService createUserGroupService(String name,String passwordEncoderName) throws Exception {
        MemoryUserGroupServiceConfigImpl config =  getUserGroupConfg(name, passwordEncoderName);        
        GeoServerUserGroupService service = new MemoryUserGroupService();
        service.setSecurityManager(GeoServerExtensions.bean(GeoServerSecurityManager.class));
        service.initializeFromConfig(config);
        getSecurityManager().saveUserGroupService(config/*,isNewUGService(name)*/);
        return service;
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

        return service;

    }
   
    public MemoryUserGroupServiceConfigImpl getUserGroupConfg(String name, String passwordEncoderName) {
        MemoryUserGroupServiceConfigImpl config = new MemoryUserGroupServiceConfigImpl();        
        config.setName(name);
        config.setClassName(MemoryUserGroupService.class.getName());
        config.setPasswordEncoderName(passwordEncoderName);
        config.setPasswordPolicyName(PasswordValidator.DEFAULT_NAME);
        config.setToBeEncrypted(plainTextUserGroup);
        return config;
    }
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

        String serviceName = "testEncrypt";
        String cryptprefix = getPBEPasswordEncoder().getPrefix()+GeoServerPasswordEncoder.PREFIX_DELIMTER;
       
        MemoryRoleServiceConfigImpl roleConfig = getRoleConfig(serviceName);
        MemoryUserGroupServiceConfigImpl ugConfig = getUserGroupConfg(serviceName,
            getPlainTextPasswordEncoder().getName());
       
        getSecurityManager().saveRoleService(roleConfig);       
        getSecurityManager().saveUserGroupService(ugConfig);
       
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

        getSecurityManager().saveSecurityConfig(config);
        String serviceName = "testEncrypt2";
        String prefix =getPBEPasswordEncoder().getPrefix()+GeoServerPasswordEncoder.PREFIX_DELIMTER;
       
        MemoryRoleServiceConfigImpl roleConfig = getRoleConfig(serviceName);
        MemoryUserGroupServiceConfigImpl ugConfig = getUserGroupConfg(serviceName,
            getPlainTextPasswordEncoder().getName());
       
        getSecurityManager().saveRoleService(roleConfig);       
        getSecurityManager().saveUserGroupService(ugConfig);
       
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

   
    static protected Logger LOGGER = Logging.getLogger("org.geoserver.security");
   
    protected UserGroupStoreValidationWrapper createStore(String name) throws IOException {
        MemoryUserGroupServiceConfigImpl config = new MemoryUserGroupServiceConfigImpl();        
        config.setName(name);       
        config.setPasswordEncoderName(getPBEPasswordEncoder().getName());
        config.setPasswordPolicyName(PasswordValidator.DEFAULT_NAME);
        GeoServerUserGroupService service = new MemoryUserGroupService();
        service.setSecurityManager(getSecurityManager());
        service.initializeFromConfig(config);       
        return new UserGroupStoreValidationWrapper(service.createStore());
    }
View Full Code Here

Examples of org.geoserver.security.config.impl.MemoryUserGroupServiceConfigImpl

        store.associateRoleToUser(groupAdminRole, "user1");
        store.associateRoleToUser(adminRole, "user2");
        store.associateRoleToUser(role1, "user3");
        store.store();
    
        MemoryUserGroupServiceConfigImpl ugconfig = new MemoryUserGroupServiceConfigImpl();        
        ugconfig.setName("testAdminRole");       
        ugconfig.setClassName(MemoryUserGroupService.class.getName());
        ugconfig.setPasswordEncoderName(getPBEPasswordEncoder().getName());
        ugconfig.setPasswordPolicyName(PasswordValidator.DEFAULT_NAME);
        GeoServerUserGroupService ugService = new MemoryUserGroupService();
        ugService.setSecurityManager(GeoServerExtensions.bean(GeoServerSecurityManager.class));
        ugService.initializeFromConfig(ugconfig);       

       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.