Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2011, Red Hat, Inc., and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 package org.jboss.as.security;
 
 import java.util.List;
 
 

Author(s):
Jason T. Greene
 
 
             new SensitivityClassification(."misc-security"falsetruetrue));
 
                     .setAccessConstraints()
                     .setDefaultValue(new ModelNode(false))
                     .setAllowExpression(true)
                     .build();
 
         super(.,
     }
 
     public void registerAttributes(final ManagementResourceRegistration resourceRegistration) {
     }
 
     static class NewSecuritySubsystemAdd extends AbstractBoottimeAddStepHandler {
         private static final String AUTHENTICATION_MANAGER = ..getName() + ":" + ..getSlot()
                + ":" + JBossCachedAuthenticationManager.class.getName();
        private static final String CALLBACK_HANDLER = ..getName() + ":" + ..getSlot() + ":"
                + JBossCallbackHandler.class.getName();
        private static final String AUTHORIZATION_MANAGER = ..getName() + ":" + ..getSlot()
                + ":" + JBossAuthorizationManager.class.getName();
        private static final String AUDIT_MANAGER = ..getName() + ":" + ..getSlot() + ":"
                + JBossAuditManager.class.getName();
        private static final String IDENTITY_TRUST_MANAGER = ..getName() + ":" + ..getSlot()
                + ":" + JBossIdentityTrustManager.class.getName();
        private static final String MAPPING_MANAGER = ..getName() + ":" + ..getSlot() + ":"
                + JBossMappingManager.class.getName();
        private static final String SUBJECT_FACTORY = ..getName() + ":" + ..getSlot() + ":"
                + JBossSecuritySubjectFactory.class.getName();
        public static final OperationStepHandler INSTANCE = new NewSecuritySubsystemAdd();
        @Override
        protected void populateModel(ModelNode operationModelNode modelthrows OperationFailedException {
            .validateAndSet(operationmodel);
        }
        @Override
        protected void performBoottime(OperationContext contextModelNode operationModelNode modelServiceVerificationHandler verificationHandlerList<ServiceController<?>> newControllersthrows OperationFailedException {
            if(context.getProcessType() != .) {
                //remove once AS7-4687 is resolved
                WildFlySecurityManager.setPropertyPrivileged(."true");
            }
            final ServiceTarget target = context.getServiceTarget();
            final SecurityBootstrapService bootstrapService = new SecurityBootstrapService();
            newControllers.add(target.addService(.bootstrapService)
                .addListener(verificationHandler)
                .setInitialMode(..).install());
            context.addStep(new AbstractDeploymentChainStep() {
                protected void execute(DeploymentProcessorTarget processorTarget) {
                }
            }, ..);
            // add service to bind SecurityDomainJndiInjectable to JNDI
            final SecurityDomainJndiInjectable securityDomainJndiInjectable = new SecurityDomainJndiInjectable();
            final BinderService binderService = new BinderService("jaas");
            newControllers.add(target.addService(..append("jaas"), binderService)
                .addInjection(binderService.getManagedObjectInjector(), securityDomainJndiInjectable)
                .addDependency(.ISecurityManagement.classsecurityDomainJndiInjectable.getSecurityManagementInjector())
                .addListener(verificationHandler)
                .setInitialMode(..).install());
            // add security management service
            final SecurityManagementService securityManagementService = new SecurityManagementService(
                modelNode.isDefined() && modelNode.asBoolean(), ,
            newControllers.add(target.addService(.securityManagementService)
                 .addDependency(.ServiceModuleLoader.classsecurityManagementService.getServiceModuleLoaderInjectedValue())
                .addListener(verificationHandler)
                .setInitialMode(..).install());
            // add subject factory service
            final SubjectFactoryService subjectFactoryService = new SubjectFactoryService();
            newControllers.add(target.addService(.subjectFactoryService)
                        subjectFactoryService.getSecurityManagementInjector())
                .addListener(verificationHandler)
                .setInitialMode(..).install());
            // add jaas configuration service
            Configuration loginConfig = XMLLoginConfigImpl.getInstance();
            final JaasConfigurationService jaasConfigurationService = new JaasConfigurationService(loginConfig);
            newControllers.add(target.addService(.jaasConfigurationService)
                .addListener(verificationHandler).setInitialMode(..).install());
            //add Simple Security Manager Service
            final SimpleSecurityManagerService simpleSecurityManagerService = new SimpleSecurityManagerService();
            newControllers.add(target.addService(.simpleSecurityManagerService)
                            simpleSecurityManagerService.getSecurityManagementInjector())
                .addListener(verificationHandler).install());
            context.addStep(new AbstractDeploymentChainStep() {
                protected void execute(DeploymentProcessorTarget processorTarget) {
                    processorTarget.addDeploymentProcessor(...,
                            new JaccEarDeploymentProcessor());
                    processorTarget.addDeploymentProcessor(...,
                            new SecurityDependencyProcessor());
                }
            }, ..);
        }
    }
New to GrepCode? Check out our FAQ X