Package org.jboss.jms.server.security

Examples of org.jboss.jms.server.security.SecurityMetadata


      JBossDestination jbd = (JBossDestination)dest;
      boolean isQueue = jbd.isQueue();
      String name = jbd.getName();

      SecurityManager sm = conn.getSecurityManager();
      SecurityMetadata securityMetadata = sm.getSecurityMetadata(isQueue, name);

      if (securityMetadata == null)
      {
         throw new JMSSecurityException("No security configuration avaliable for " + name);
      }

      // Authenticate. Successful autentication will place a new SubjectContext on thread local,
      // which will be used in the authorization process. However, we need to make sure we clean up
      // thread local immediately after we used the information, otherwise some other people
      // security my be screwed up, on account of thread local security stack being corrupted.

      sm.authenticate(conn.getUsername(), conn.getPassword());

      // Authorize
      Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
                       checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
                       securityMetadata.getCreatePrincipals();
      try
      {
         if (!sm.authorize(conn.getUsername(), principals))
         {
            String msg = "User: " + conn.getUsername() +
View Full Code Here


      boolean isQueue = jbd.isQueue();
      String name = jbd.getName();

      SecurityStore sm = conn.getSecurityManager();
      SecurityMetadata securityMetadata = sm.getSecurityMetadata(isQueue, name);

      if (securityMetadata == null)
      {
         throw new JMSSecurityException("No security configuration avaliable for " + name);
      }

      // Authenticate. Successful autentication will place a new SubjectContext on thread local,
      // which will be used in the authorization process. However, we need to make sure we clean up
      // thread local immediately after we used the information, otherwise some other people
      // security my be screwed up, on account of thread local security stack being corrupted.
     
      sm.authenticate(conn.getUsername(), conn.getPassword());

      // Authorize
      Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
                       checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
                       securityMetadata.getCreatePrincipals();
      try
      {
         if (!sm.authorize(conn.getUsername(), principals, checkType))
         {
            String msg = "User: " + conn.getUsername() +
View Full Code Here

   // SecurityManager implementation --------------------------------

   public SecurityMetadata getSecurityMetadata(boolean isQueue, String destName)
   {
      SecurityMetadata m = (SecurityMetadata) (isQueue ? queueSecurityConf.get(destName) : topicSecurityConf
            .get(destName));

      if (m == null)
      {
         // No SecurityMetadata was configured for the destination, apply the default
         if (defaultSecurityConfig != null)
         {
            log.debug("No SecurityMetadadata was available for " + destName + ", using default security config");
            try
            {
               m = new SecurityMetadata(defaultSecurityConfig);
            }
            catch (Exception e)
            {
               log.warn("Unable to apply default security for destName, using guest " + destName, e);
               m = new SecurityMetadata();
            }
         }
         else
         {
            // default to guest
            log.warn("No SecurityMetadadata was available for " + destName + ", adding guest");
            m = new SecurityMetadata();
         }

         // don't cache it! this way the callers will be able to take advantage of default security
         // configuration updates
         // securityConf.put(destName, m);
View Full Code Here

      {
         clearSecurityConfig(isQueue, destName);
      }
      else
      {
         SecurityMetadata m = new SecurityMetadata(conf);

         if (isQueue)
         {
            queueSecurityConf.put(destName, m);
         }
View Full Code Here

   }

   public void setDefaultSecurityConfig(Element conf) throws Exception
   {
      // Force a parse
      new SecurityMetadata(conf);
      defaultSecurityConfig = conf;
   }
View Full Code Here

         topicSecurityConf.remove(destName);     
   }

   public SecurityMetadata getSecurityMetadata(boolean isQueue, String destName)
   {
      SecurityMetadata smd = defaultSecurityConfig;
      if(isQueue)
         smd = queueSecurityConf.get(destName);
      else
         smd = topicSecurityConf.get(destName);
      return smd;
View Full Code Here

   }

   public void setSecurityConfig(boolean isQueue, String destName, Element conf)
         throws Exception
   {
      SecurityMetadata smd = new SecurityMetadata(conf);
      if(isQueue)
         queueSecurityConf.put(destName, smd);
      else
         topicSecurityConf.put(destName, smd);     
   }
View Full Code Here

      final boolean isQueue = jbd.isQueue();
      final String name = jbd.getName();

      final SecurityStore sm = conn.getSecurityManager();

      SecurityMetadata securityMetadata = SecurityActions.getSecurityMetadata(sm, isQueue, name);

      if (securityMetadata == null)
      {
         throw new JMSSecurityException("No security configuration avaliable for " + name);
      }

      // Authenticate. Need to save current SecurityContext
      SecurityContext previousSCtx = SecurityActions.getSecurityContext();
     
      final String username = conn.getUsername();
      final String password = conn.getPassword();

      SecurityActions.authenticate(sm, username, password);

      // Authorize
      final Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
                       checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
                       securityMetadata.getCreatePrincipals();
      try
      {
        final CheckType tmpCheckType = checkType;
       
         if (!SecurityActions.authorize(sm, conn.getUsername(), principals, checkType))
View Full Code Here

      boolean isQueue = jbd.isQueue();
      String name = jbd.getName();

      SecurityStore sm = conn.getSecurityManager();
      SecurityMetadata securityMetadata = sm.getSecurityMetadata(isQueue, name);

      if (securityMetadata == null)
      {
         throw new JMSSecurityException("No security configuration avaliable for " + name);
      }

      // Authenticate. Successful autentication will place a new SubjectContext on thread local,
      // which will be used in the authorization process. However, we need to make sure we clean up
      // thread local immediately after we used the information, otherwise some other people
      // security my be screwed up, on account of thread local security stack being corrupted.
     
      sm.authenticate(conn.getUsername(), conn.getPassword());

      // Authorize
      Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
                       checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
                       securityMetadata.getCreatePrincipals();
      try
      {
         if (!sm.authorize(conn.getUsername(), principals, checkType))
         {
            String msg = "User: " + conn.getUsername() +
View Full Code Here

      boolean isQueue = jbd.isQueue();
      String name = jbd.getName();

      SecurityStore sm = conn.getSecurityManager();
      SecurityMetadata securityMetadata = sm.getSecurityMetadata(isQueue, name);

      if (securityMetadata == null)
      {
         throw new JMSSecurityException("No security configuration avaliable for " + name);
      }

      // Authenticate. Need to save current SecurityContext
      SecurityContext previousSCtx = SecurityActions.getSecurityContext();
     
      sm.authenticate(conn.getUsername(), conn.getPassword());

      // Authorize
      Set principals = checkType == CheckType.READ ? securityMetadata.getReadPrincipals() :
                       checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() :
                       securityMetadata.getCreatePrincipals();
      try
      {
         if (!sm.authorize(conn.getUsername(), principals, checkType))
         {
            String msg = "User: " + conn.getUsername() +
View Full Code Here

TOP

Related Classes of org.jboss.jms.server.security.SecurityMetadata

Copyright © 2018 www.massapicom. 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.