Examples of Security


Examples of org.apache.geronimo.security.deploy.Security

     *
     * @throws Exception thrown if an error in the test occurs
     */
    public void testExplicitMapping() throws Exception {

        Security securityConfig = new Security();
        securityConfig.setUseContextHandler(false);

        DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
        PrincipalInfo principalInfo = new PrincipalInfo("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal", "izumi", false);
        defaultPrincipal.setPrincipal(principalInfo);

        securityConfig.setDefaultPrincipal(defaultPrincipal);

        Role role = new Role();
        role.setRoleName("content-administrator");
        principalInfo = new PrincipalInfo("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal", "it", false);
        role.getPrincipals().add(principalInfo);

        securityConfig.getRoleMappings().put(role.getRoleName(), role);

        Map roleDesignates = new HashMap();
        Map principalRoleMap = new HashMap();
        buildPrincipalRoleMap(securityConfig, roleDesignates, principalRoleMap);

View Full Code Here

Examples of org.apache.geronimo.security.deploy.Security

            try {
                securityType = (GerSecurityType) XmlBeansUtil.typedCopy(items[0], GerSecurityType.type);
            } catch (XmlException e) {
                throw new DeploymentException("Could not validate security element", e);
            }
            Security security = buildSecurityConfig(securityType);
            ClassLoader classLoader = applicationContext.getClassLoader();
            SecurityConfiguration securityConfiguration = buildSecurityConfiguration(security, classLoader);
            earContext.setSecurityConfiguration(securityConfiguration);
           
            Naming naming = earContext.getNaming();
View Full Code Here

Examples of org.apache.geronimo.security.deploy.Security

        }
    }

    private Security buildSecurityConfig(GerSecurityType securityType) {
        Security security;

        if (securityType == null) {
            return null;
        }
        security = new Security();

        security.setDoAsCurrentCaller(securityType.getDoasCurrentCaller());
        security.setUseContextHandler(securityType.getUseContextHandler());
        if (securityType.isSetDefaultRole()) {
            security.setDefaultRole(securityType.getDefaultRole().trim());
        }

        if (securityType.isSetRoleMappings()) {
            GerRoleMappingsType roleMappingsType = securityType.getRoleMappings();
            for (int i = 0; i < roleMappingsType.sizeOfRoleArray(); i++) {
                GerRoleType roleType = roleMappingsType.getRoleArray(i);
                Role role = new Role();

                String roleName = roleType.getRoleName().trim();
                role.setRoleName(roleName);

                if (roleType.isSetRunAsSubject()) {
                    SubjectInfo subjectInfo = buildSubjectInfo(roleType.getRunAsSubject());
                    security.getRoleSubjectMappings().put(roleName, subjectInfo);
                }

                for (int j = 0; j < roleType.sizeOfRealmPrincipalArray(); j++) {
                    role.getRealmPrincipals().add(GeronimoSecurityBuilderImpl.buildRealmPrincipal(roleType.getRealmPrincipalArray(j)));
                }

                for (int j = 0; j < roleType.sizeOfLoginDomainPrincipalArray(); j++) {
                    role.getLoginDomainPrincipals().add(GeronimoSecurityBuilderImpl.buildDomainPrincipal(roleType.getLoginDomainPrincipalArray(j)));
                }

                for (int j = 0; j < roleType.sizeOfPrincipalArray(); j++) {
                    role.getPrincipals().add(buildPrincipal(roleType.getPrincipalArray(j)));
                }

                security.getRoleMappings().put(roleName, role);
            }
        }

        security.setDefaultSubjectInfo(buildSubjectInfo(securityType.getDefaultSubject()));

        return security;
    }
View Full Code Here

Examples of org.apache.jetspeed.om.profile.Security

                assertTrue(meta.getImage().equals("me.png"));
                assertTrue(rootset.getTitle().equals("Jetspeed"));
                assertTrue(rootset.getDescription().equals("This is the default page for me"));
                assertTrue(rootset.getImage().equals("me.png"));

                Security security = rootset.getSecurity();
                assertNotNull(security);
                assertTrue(security.getId().equals("999"));

                Iterator params = rootset.getParameterIterator();
                Parameter param = (Parameter)params.next();
                assertTrue(param.getName().equals("city"));
                assertTrue(param.getValue().equals("Atlanta"));
View Full Code Here

Examples of org.apache.jetspeed.om.registry.Security

        turbineUser.setHasLoggedIn(Boolean.TRUE);
       
        JetspeedUser anonymousUser =  (JetspeedUser) JetspeedSecurity.getAnonymousUser();
        assertNotNull( "Getting anonymous user", anonymousUser);
        // Create security objects
        Security adminSecurity = new BaseSecurity("admin");
        assertNotNull( "Have admin security", adminSecurity);
        Security userSecurity = new BaseSecurity("user");
        assertNotNull( "Have user security", userSecurity);

        PortletEntry userPortletEntry = new BasePortletEntry();
        assertNotNull( "Have userPortletEntry", userPortletEntry);
        userPortletEntry.setName( USER_PORTLET);
View Full Code Here

Examples of org.apache.slide.security.Security

     *
     */
    private Element createActiveLockElement(NodeLock objectLockToken, String servletPath, String contextPath) {
       
        Element activelock = null;
        Security security = nsaToken.getSecurityHelper();
       
        if (objectLockToken != null) {
           
            activelock = new Element(E_ACTIVELOCK, DNSP);
            Element locktype = new Element(E_LOCKTYPE, DNSP);
View Full Code Here

Examples of org.glassfish.appclient.client.acc.config.Security

            TargetServer tServer = tServers.get(0);
            // TargetServer is required.
      //temp solution to target-server+ change in DTD
            // assuming that multiple servers can be specified but only 1st
      // first one will be used.
      Security security = tServer.getSecurity();
      if (security == null) {
    _logger.fine("No Security input set in ClientContainer.xml");
    // do nothing
    return;
      }
      Ssl ssl = security.getSsl();
      if (ssl == null) {
    _logger.fine("No SSL input set in ClientContainer.xml");
    // do nothing
    return;
   
View Full Code Here

Examples of org.jboss.el.beans.Security

            }
        }
       
        ELContextImpl impl = new ELContextImpl(fn);
        ExpressionFactoryImpl ef = new ExpressionFactoryImpl();
        impl.setVar("user", new Security());
       
        String[] tests = new String[] { "#{hasRole(user, 1, 2, 3)}", "#{hasRole(user, 1)}", "#{hasOneRole(1)}", "#{user.matchRole(1)}", "#{user.matchRole(1,3,4,5)}" };
        for (String el : tests) {
          parse(el);
          ValueExpression ve = ef.createValueExpression(impl, el, Object.class);
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.common.Security

                setAttribute(model, PAD_XID, xaPool.isPadXid());
                setAttribute(model, INTERLEAVING, xaPool.isInterleaving());
                setAttribute(model, NOTXSEPARATEPOOL, xaPool.isNoTxSeparatePool());
            }
        }
        final Security security = connDef.getSecurity();
        if (security != null) {
            setAttribute(model, SECURITY_DOMAIN_AND_APPLICATION, security.getSecurityDomainAndApplication());

            setAttribute(model, APPLICATION, security.isApplication());

            setAttribute(model, SECURITY_DOMAIN, security.getSecurityDomain());
        }
        final TimeOut timeOut = connDef.getTimeOut();
        if (timeOut != null) {
            setAttribute(model, ALLOCATION_RETRY, timeOut.getAllocationRetry());
View Full Code Here

Examples of org.jboss.soa.esb.listeners.config.xbeanmodel101.SecurityDocument.Security

   *            The Service to which the listener is bound. The Service defines the actions.
   * @throws ConfigurationException
   */
  public static void map( final Element toConfigTree, final Service service ) throws ConfigurationException
  {
    final Security security = service.getSecurity();
    if ( security != null)
    {
        final Element securityElement = YADOMUtil.addElement( toConfigTree, ListenerTagNames.SECURITY_TAG );
      MapperUtil.serialize( security, securityElement );
    }
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.