[jboss-cvs] JBossAS SVN: r59232 - projects/security/security-spi/trunk/src/main/org/jboss/security

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 26 16:08:08 EST 2006


Author: anil.saldhana at jboss.com
Date: 2006-12-26 16:08:07 -0500 (Tue, 26 Dec 2006)
New Revision: 59232

Added:
   projects/security/security-spi/trunk/src/main/org/jboss/security/SubjectInfo.java
Modified:
   projects/security/security-spi/trunk/src/main/org/jboss/security/SecurityContext.java
Log:
refactor and pull out SubjectInfo

Modified: projects/security/security-spi/trunk/src/main/org/jboss/security/SecurityContext.java
===================================================================
--- projects/security/security-spi/trunk/src/main/org/jboss/security/SecurityContext.java	2006-12-26 21:07:44 UTC (rev 59231)
+++ projects/security/security-spi/trunk/src/main/org/jboss/security/SecurityContext.java	2006-12-26 21:08:07 UTC (rev 59232)
@@ -5,97 +5,53 @@
  * See terms of license at gnu.org.
  */ 
 package org.jboss.security;
-
-import java.security.Principal;
-import java.util.Map;
-
-import javax.security.auth.Subject;
  
+import java.util.Map; 
+ 
 import org.jboss.security.audit.SecurityAuditManager;
 import org.jboss.security.mapping.MappingContext;
  
 
 /**
- *  Encapsulation of Authentication, Authorization and Role information
+ *  Encapsulation of Authentication, Authorization, Mapping and other
+ *  security aspects at the level of a security domain
  *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
  *  @version $Revision$
  *  @since  Aug 24, 2006
  */
-public abstract class SecurityContext
-{/*
-   protected static final Logger log = Logger.getLogger(SecurityContext.class);
-   
-   protected boolean trace = log.isTraceEnabled(); 
-   */
+public interface SecurityContext
+{   
    /**
-    * A map of roles (as a Group) keyed in by securityDomain
+    * Authentication Manager for the security domain
     */
-  /* private ConcurrentHashMap rolesMap = new ConcurrentHashMap();*/
+   public AuthenticationManager getAuthenticationManager(); 
+   /**
+    * Authorization Manager for the security domain 
+    */
+   public AuthorizationManager getAuthorizationManager();
    
-   public class SubjectInfo
-   {
-      private Principal authenticationPrincipal;
-      private Object authenticationCredential;
-      private Subject authenticatedSubject;
-      
-      public Principal getAuthenticationPrincipal()
-      {
-         return authenticationPrincipal;
-      }
-      
-      public void setAuthenticationPrincipal(Principal authenticationPrincipal)
-      {
-         this.authenticationPrincipal = authenticationPrincipal;
-      }
-      
-      public Object getAuthenticationCredential()
-      {
-         return authenticationCredential;
-      }
-      
-      public void setAuthenticationCredential(Object authenticationCredential)
-      {
-         this.authenticationCredential = authenticationCredential;
-      }
-      
-      public Subject getAuthenticatedSubject()
-      {
-         return authenticatedSubject;
-      }
-      
-      public void setAuthenticatedSubject(Subject authenticatedSubject)
-      {
-         this.authenticatedSubject = authenticatedSubject;
-      } 
-   } 
+   /** 
+    * Mapping Context configured with providers
+    */
+   public MappingContext getMappingContext(Class mappingType);
    
-   public interface MappingKeyInfo
-   {
-      public final static String ROLE_MAPPING = "RoleMapping";
-      public final static String IDENTITY_MAPPING = "IdentityMapping";
-      public final static String CERTIFICATE_MAPPING = "CertMapping";
-   }
+   /**
+    * AuditContext configured for the security domain 
+    */
+   public SecurityAuditManager getAuditManager();
    
-   public abstract AuthenticationManager getAuthenticationManager();
-    
-   public abstract AuthorizationManager getAuthorizationManager();
-   
-   public abstract Map getData();
-   
    /**
-    * @see MappingKeyInfo
-    * @param Key Key of the form MappingKeyInfo
-    * @return A Mapping Context configured with providers
+    * Context Map 
     */
-   public abstract MappingContext getMappingContext(String Key);
+   public Map getData();
    
    /**
-    * Return the AuditContext configured for the security domain
-    * @return
+    * Return the Security Domain
     */
-   public abstract SecurityAuditManager getAuditManager();
+   public String getSecurityDomain();
    
-   public abstract String getSecurityDomain();
-   
-   public abstract SubjectInfo getSubjectInfo(); 
+   /**
+    * Subject Info
+    */
+   public SubjectInfo getSubjectInfo(); 
 }

Added: projects/security/security-spi/trunk/src/main/org/jboss/security/SubjectInfo.java
===================================================================
--- projects/security/security-spi/trunk/src/main/org/jboss/security/SubjectInfo.java	2006-12-26 21:07:44 UTC (rev 59231)
+++ projects/security/security-spi/trunk/src/main/org/jboss/security/SubjectInfo.java	2006-12-26 21:08:07 UTC (rev 59232)
@@ -0,0 +1,71 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2006, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt 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.security;
+
+import java.security.Principal;
+
+import javax.security.auth.Subject;
+
+//$Id$
+
+/**
+ *  Holds information - principal, credential and subject
+ *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
+ *  @since  Dec 26, 2006 
+ *  @version $Revision$
+ */
+public class SubjectInfo
+{
+   private Principal authenticationPrincipal;
+   private Object authenticationCredential;
+   private Subject authenticatedSubject;
+   
+   public Principal getAuthenticationPrincipal()
+   {
+      return authenticationPrincipal;
+   }
+   
+   public void setAuthenticationPrincipal(Principal authenticationPrincipal)
+   {
+      this.authenticationPrincipal = authenticationPrincipal;
+   }
+   
+   public Object getAuthenticationCredential()
+   {
+      return authenticationCredential;
+   }
+   
+   public void setAuthenticationCredential(Object authenticationCredential)
+   {
+      this.authenticationCredential = authenticationCredential;
+   }
+   
+   public Subject getAuthenticatedSubject()
+   {
+      return authenticatedSubject;
+   }
+   
+   public void setAuthenticatedSubject(Subject authenticatedSubject)
+   {
+      this.authenticatedSubject = authenticatedSubject;
+   } 
+} 




More information about the jboss-cvs-commits mailing list