Examples of SecurityConfiguration


Examples of org.apache.geronimo.security.deployment.SecurityConfiguration

        }
        return componentPermissions;
    }

    private void addSecurityData(EnterpriseBean enterpriseBean, ComponentPermissions componentPermissions) throws DeploymentException {
        SecurityConfiguration securityConfiguration = (SecurityConfiguration) earContext.getSecurityConfiguration();
        if (securityConfiguration != null) {
            GBeanData gbean = getEjbGBean(enterpriseBean.getEjbName());
            if (enterpriseBean instanceof RemoteBean) {
                RemoteBean remoteBean = (RemoteBean) enterpriseBean;

                SecurityBuilder securityBuilder = new SecurityBuilder();
                Collection<Permission> allPermissions = new HashSet<Permission>();

                securityBuilder.addToPermissions(allPermissions,
                        remoteBean.getEjbName(),
                        EjbInterface.HOME.getJaccInterfaceName(),
                        remoteBean.getHome(),
                        ejbModule.getClassLoader());
                securityBuilder.addToPermissions(allPermissions,
                        remoteBean.getEjbName(),
                        EjbInterface.REMOTE.getJaccInterfaceName(),
                        remoteBean.getRemote(),
                        ejbModule.getClassLoader());
                securityBuilder.addToPermissions(allPermissions,
                        remoteBean.getEjbName(),
                        EjbInterface.LOCAL.getJaccInterfaceName(),
                        remoteBean.getLocal(),
                        ejbModule.getClassLoader());
                securityBuilder.addToPermissions(allPermissions,
                        remoteBean.getEjbName(),
                        EjbInterface.LOCAL_HOME.getJaccInterfaceName(),
                        remoteBean.getLocalHome(),
                        ejbModule.getClassLoader());
                if (remoteBean instanceof SessionBean) {
                    securityBuilder.addToPermissions(allPermissions,
                            remoteBean.getEjbName(),
                            EjbInterface.SERVICE_ENDPOINT.getJaccInterfaceName(),
                            ((SessionBean) remoteBean).getServiceEndpoint(),
                            ejbModule.getClassLoader());
                }
                if (remoteBean.getBusinessRemote() != null && !remoteBean.getBusinessRemote().isEmpty()) {
                    for (String businessRemote : remoteBean.getBusinessRemote()) {
                        securityBuilder.addToPermissions(allPermissions,
                                remoteBean.getEjbName(),
                                EjbInterface.REMOTE.getJaccInterfaceName(),
                                businessRemote,
                                ejbModule.getClassLoader());
                    }
                    securityBuilder.addToPermissions(new PermissionCollectionAdapter(componentPermissions.getUncheckedPermissions()),
                            remoteBean.getEjbName(),
                            EjbInterface.HOME.getJaccInterfaceName(),
                            DeploymentInfo.BusinessRemoteHome.class.getName(),
                            ejbModule.getClassLoader());
                }
                if (remoteBean.getBusinessLocal() != null && !remoteBean.getBusinessLocal().isEmpty()) {
                    for (String businessLocal : remoteBean.getBusinessLocal()) {
                        securityBuilder.addToPermissions(allPermissions,
                                remoteBean.getEjbName(),
                                EjbInterface.LOCAL.getJaccInterfaceName(),
                                businessLocal,
                                ejbModule.getClassLoader());
                    }
                    securityBuilder.addToPermissions(new PermissionCollectionAdapter(componentPermissions.getUncheckedPermissions()),
                            remoteBean.getEjbName(),
                            EjbInterface.LOCAL_HOME.getJaccInterfaceName(),
                            DeploymentInfo.BusinessLocalHome.class.getName(),
                            ejbModule.getClassLoader());
                }

                securityBuilder.addEjbTimeout(remoteBean, ejbModule, allPermissions);

                String defaultRole = securityConfiguration.getDefaultRole();
                securityBuilder.addComponentPermissions(defaultRole,
                        allPermissions,
                        ejbModule.getEjbJar().getAssemblyDescriptor(),
                        enterpriseBean.getEjbName(),
                        remoteBean.getSecurityRoleRef(),
View Full Code Here

Examples of org.apache.geronimo.security.deployment.SecurityConfiguration

            RemoteBean remoteBean = (RemoteBean) enterpriseBean;

            SecurityBuilder securityBuilder = new SecurityBuilder();
            PermissionCollection permissions = new Permissions();

            SecurityConfiguration securityConfiguration = (SecurityConfiguration) earContext.getSecurityConfiguration();
            if (securityConfiguration != null) {
                securityBuilder.addToPermissions(permissions,
                        remoteBean.getEjbName(),
                        EjbInterface.HOME.getJaccInterfaceName(),
                        remoteBean.getHome(),
                        ejbModule.getClassLoader());
                securityBuilder.addToPermissions(permissions,
                        remoteBean.getEjbName(),
                        EjbInterface.REMOTE.getJaccInterfaceName(),
                        remoteBean.getRemote(),
                        ejbModule.getClassLoader());
                securityBuilder.addToPermissions(permissions,
                        remoteBean.getEjbName(),
                        EjbInterface.LOCAL.getJaccInterfaceName(),
                        remoteBean.getLocal(),
                        ejbModule.getClassLoader());
                securityBuilder.addToPermissions(permissions,
                        remoteBean.getEjbName(),
                        EjbInterface.LOCAL_HOME.getJaccInterfaceName(),
                        remoteBean.getLocalHome(),
                        ejbModule.getClassLoader());
                if (remoteBean instanceof SessionBean) {
                    securityBuilder.addToPermissions(permissions,
                        remoteBean.getEjbName(),
                        EjbInterface.SERVICE_ENDPOINT.getJaccInterfaceName(),
                            ((SessionBean)remoteBean).getServiceEndpoint(),
                            ejbModule.getClassLoader());
                }
                if (remoteBean.getBusinessRemote() != null && !remoteBean.getBusinessRemote().isEmpty()) {
                    for (String businessRemote: remoteBean.getBusinessRemote()) {
                        securityBuilder.addToPermissions(permissions,
                            remoteBean.getEjbName(),
                            EjbInterface.REMOTE.getJaccInterfaceName(),
                            businessRemote,
                            ejbModule.getClassLoader());
                    }
                    securityBuilder.addToPermissions(componentPermissions.getUncheckedPermissions(),
                            remoteBean.getEjbName(),
                            EjbInterface.HOME.getJaccInterfaceName(),
                            DeploymentInfo.BusinessRemoteHome.class.getName(),
                            ejbModule.getClassLoader());
                }
                if (remoteBean.getBusinessLocal() != null && !remoteBean.getBusinessLocal().isEmpty()) {
                    for (String businessLocal: remoteBean.getBusinessLocal()) {
                        securityBuilder.addToPermissions(permissions,
                            remoteBean.getEjbName(),
                            EjbInterface.LOCAL.getJaccInterfaceName(),
                            businessLocal,
                            ejbModule.getClassLoader());
                    }
                    securityBuilder.addToPermissions(componentPermissions.getUncheckedPermissions(),
                            remoteBean.getEjbName(),
                            EjbInterface.LOCAL_HOME.getJaccInterfaceName(),
                            DeploymentInfo.BusinessLocalHome.class.getName(),
                            ejbModule.getClassLoader());
                }

                String defaultRole = securityConfiguration.getDefaultRole();
                securityBuilder.addComponentPermissions(defaultRole,
                        permissions,
                        ejbModule.getEjbJar().getAssemblyDescriptor(),
                        enterpriseBean.getEjbName(),
                        remoteBean.getSecurityRoleRef(),
                        componentPermissions);

                // RunAs subject
                SecurityIdentity securityIdentity = remoteBean.getSecurityIdentity();
                if (securityIdentity != null && securityIdentity.getRunAs() != null) {
                    String runAsName = securityIdentity.getRunAs();
                    if (runAsName != null) {
                        Subject runAsSubject = (Subject) securityConfiguration.getRoleDesignates().get(runAsName);
                        if (runAsSubject == null) {
                            throw new DeploymentException("No role designate found for run-as name: " + runAsName);
                        }
                        gbean.setAttribute("runAs", runAsSubject);
                    }
                }

                // Default principal
                gbean.setAttribute("defaultPrincipal", securityConfiguration.getDefaultPrincipal());
                gbean.setAttribute("securityEnabled", true);
            }
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration

    //-------------------------------------------< ServiceTrackerCustomizer >---
    @Override
    public Object addingService(ServiceReference reference) {
        Object service = super.addingService(reference);
        if (service instanceof SecurityConfiguration) {
            SecurityConfiguration sc = (SecurityConfiguration) service;
            synchronized (this) {
                serviceMap.put(sc.getName(), sc);
            }

            if (service instanceof ConfigurationBase) {
                ((ConfigurationBase) service).setSecurityProvider(this);
            }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration

    public ConfigurationParameters getParameters(@Nullable String name) {
        if (name == null) {
            return config;
        }
        ConfigurationParameters params = config.getConfigValue(name, ConfigurationParameters.EMPTY);
        SecurityConfiguration sc = serviceMap.get(name);
        if (sc != null) {
            return ConfigurationParameters.newInstance(params, sc.getParameters());
        } else {
            return params;
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration

    //-------------------------------------------< ServiceTrackerCustomizer >---
    @Override
    public Object addingService(ServiceReference reference) {
        Object service = super.addingService(reference);
        if (service instanceof SecurityConfiguration) {
            SecurityConfiguration sc = (SecurityConfiguration) service;

            if (sc instanceof TokenConfiguration) {
                tokenConfiguration.services.add((TokenConfiguration) sc);
            } else {
                synchronized (this) {
                    serviceMap.put(sc.getName(), sc);
                }
            }

            if (service instanceof ConfigurationBase) {
                ((ConfigurationBase) service).setSecurityProvider(this);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.SecurityConfiguration

    @Override
    public void removedService(ServiceReference reference, Object service) {
        super.removedService(reference, service);
        if (service instanceof SecurityConfiguration) {
            SecurityConfiguration sc = (SecurityConfiguration) service;
            if (sc instanceof TokenConfiguration) {
                tokenConfiguration.services.remove(sc);
            } else {
                synchronized (this) {
                    serviceMap.remove(((SecurityConfiguration) service).getName());
View Full Code Here

Examples of org.apache.qpid.server.configuration.SecurityConfiguration

        tmpFile.deleteOnExit();
        BufferedWriter out = new BufferedWriter(new FileWriter(tmpFile));
        out.write("<security><queueDenier>notyet</queueDenier><exchangeDenier>yes</exchangeDenier></security>");
        out.close();
       
        _conf = new SecurityConfiguration(new XMLConfiguration(tmpFile));
       
        // Create ACLManager
       
        _pluginManager = new MockPluginManager("");
        _authzManager = new ACLManager(_conf, _pluginManager);
View Full Code Here

Examples of org.apache.qpid.server.configuration.SecurityConfiguration

   
    public void testConfigurePlugins() throws ConfigurationException
    {
        Configuration hostConfig = new PropertiesConfiguration();
        hostConfig.setProperty("queueDenier", "thisoneneither");
        _authzManager.configureHostPlugins(new SecurityConfiguration(hostConfig));
        AMQQueue queue = new MockAMQQueue("thisoneneither");
        assertFalse(_authzManager.authoriseDelete(_session, queue));
    }
View Full Code Here

Examples of org.apache.qpid.server.configuration.SecurityConfiguration

        tmpFile.deleteOnExit();
        BufferedWriter out = new BufferedWriter(new FileWriter(tmpFile));
        out.write("<security><queueDenier>notyet</queueDenier><exchangeDenier>yes</exchangeDenier></security>");
        out.close();

        _conf = new SecurityConfiguration(new XMLConfiguration(tmpFile));

        // Create ACLManager

        _pluginManager = new MockPluginManager("");
        _authzManager = new ACLManager(_conf, _pluginManager);
View Full Code Here

Examples of org.apache.qpid.server.configuration.SecurityConfiguration

    public void testConfigurePlugins() throws ConfigurationException
    {
        Configuration hostConfig = new PropertiesConfiguration();
        hostConfig.setProperty("queueDenier", "thisoneneither");
        _authzManager.configureHostPlugins(new SecurityConfiguration(hostConfig));
        AMQQueue queue = new MockAMQQueue("thisoneneither");
        assertFalse(_authzManager.authoriseDelete(_session, queue));
    }
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.