geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r126205 - in geronimo/trunk/modules/jetty/src: java/org/apache/geronimo/jetty java/org/apache/geronimo/jetty/interceptor test/org/apache/geronimo/jetty
Date Sun, 23 Jan 2005 08:32:12 GMT
Author: djencks
Date: Sun Jan 23 00:32:11 2005
New Revision: 126205

URL: http://svn.apache.org/viewcvs?view=rev&rev=126205
Log:
sync attribute names with the schema and builder
Modified:
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
   geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?view=diff&rev=126205&p1=geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r1=126204&p2=geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r2=126205
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Sun Jan 23 00:32:11 2005
@@ -114,7 +114,7 @@
                                   int sessionTimeoutSeconds,
 
                                   String policyContextID,
-                                  String loginDomainName,
+                                  String securityRealmName,
                                   Security securityConfig,
                                   //from jettyxmlconfig
                                   Set securityRoles,
@@ -186,9 +186,9 @@
 //JACC
         if (securityConfig != null) {
             //set the JAASJettyRealm as our realm.
-            JAASJettyRealm realm = new JAASJettyRealm(realmName, loginDomainName);
+            JAASJettyRealm realm = new JAASJettyRealm(realmName, securityRealmName);
             setRealm(realm);
-            this.securityInterceptor = new SecurityContextBeforeAfter(interceptor, index++,
index++, policyContextID, securityConfig, loginDomainName, authenticator, securityRoles, uncheckedPermissions,
excludedPermissions, rolePermissions, realm);
+            this.securityInterceptor = new SecurityContextBeforeAfter(interceptor, index++,
index++, policyContextID, securityConfig, securityRealmName, authenticator, securityRoles,
uncheckedPermissions, excludedPermissions, rolePermissions, realm);
             interceptor = securityInterceptor;
         } else {
             securityInterceptor = null;
@@ -407,7 +407,7 @@
         infoBuilder.addInterface(JettyServletRegistration.class);
 
         infoBuilder.addAttribute("policyContextID", String.class, true);
-        infoBuilder.addAttribute("loginDomainName", String.class, true);
+        infoBuilder.addAttribute("securityRealmName", String.class, true);
         infoBuilder.addAttribute("securityConfig", Security.class, true);
 
         infoBuilder.addAttribute("securityRoles", Set.class, true);
@@ -442,7 +442,7 @@
             "sessionTimeoutSeconds",
 
             "policyContextID",
-            "loginDomainName",
+            "securityRealmName",
             "securityConfig",
 
             "securityRoles",

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java?view=diff&rev=126205&p1=geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java&r1=126204&p2=geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java&r2=126205
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
Sun Jan 23 00:32:11 2005
@@ -87,7 +87,7 @@
                                       int webAppContextIndex,
                                       String policyContextID,
                                       Security securityConfig,
-                                      String loginDomainName,
+                                      String securityRealmName,
                                       Authenticator authenticator,
                                       Set securityRoles,
                                       PermissionCollection uncheckedPermissions,
@@ -99,7 +99,7 @@
         this.webAppContextIndex = webAppContextIndex;
         this.policyContextID = policyContextID;
 
-        this.defaultPrincipal = generateDefaultPrincipal(securityConfig, loginDomainName);
+        this.defaultPrincipal = generateDefaultPrincipal(securityConfig, securityRealmName);
 
         if (authenticator instanceof FormAuthenticator) {
             String formLoginPath = ((FormAuthenticator) authenticator).getLoginPage();
@@ -132,7 +132,7 @@
 
         policyConfiguration = factory.getPolicyConfiguration(policyContextID, true);
         configure(uncheckedPermissions, excludedPermissions, rolePermissions);
-        addRoleMappings(securityRoles, loginDomainName, securityConfig, (RoleMappingConfiguration)
policyConfiguration);
+        addRoleMappings(securityRoles, securityRealmName, securityConfig, (RoleMappingConfiguration)
policyConfiguration);
         policyConfiguration.commit();
         this.excludedPermissions = excludedPermissions;
 
@@ -328,10 +328,10 @@
      * Generate the default principal from the security config.
      *
      * @param securityConfig  The Geronimo security configuration.
-     * @param loginDomainName
+     * @param securityRealmName
      * @return the default principal
      */
-    protected JAASJettyPrincipal generateDefaultPrincipal(Security securityConfig, String
loginDomainName) throws GeronimoSecurityException {
+    protected JAASJettyPrincipal generateDefaultPrincipal(Security securityConfig, String
securityRealmName) throws GeronimoSecurityException {
 
         DefaultPrincipal defaultPrincipal = securityConfig.getDefaultPrincipal();
         if (defaultPrincipal == null) {
@@ -341,11 +341,11 @@
         JAASJettyPrincipal result = new JAASJettyPrincipal("default");
         Subject defaultSubject = new Subject();
 
-        RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(defaultPrincipal.getPrincipal(),
loginDomainName, defaultPrincipal.getRealmName());
+        RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(defaultPrincipal.getPrincipal(),
securityRealmName, defaultPrincipal.getRealmName());
         if (realmPrincipal == null) {
             throw new GeronimoSecurityException("Unable to create realm principal");
         }
-        PrimaryRealmPrincipal primaryRealmPrincipal = ConfigurationUtil.generatePrimaryRealmPrincipal(defaultPrincipal.getPrincipal(),
loginDomainName, defaultPrincipal.getRealmName());
+        PrimaryRealmPrincipal primaryRealmPrincipal = ConfigurationUtil.generatePrimaryRealmPrincipal(defaultPrincipal.getPrincipal(),
securityRealmName, defaultPrincipal.getRealmName());
         if (primaryRealmPrincipal == null) {
             throw new GeronimoSecurityException("Unable to create primary realm principal");
         }
@@ -359,7 +359,7 @@
     }
 
 
-    public void addRoleMappings(Set securityRoles, String loginDomainName, Security security,
RoleMappingConfiguration roleMapper) throws PolicyContextException, GeronimoSecurityException
{
+    public void addRoleMappings(Set securityRoles, String securityRealmName, Security security,
RoleMappingConfiguration roleMapper) throws PolicyContextException, GeronimoSecurityException
{
 
         for (Iterator roleMappings = security.getRoleMappings().values().iterator(); roleMappings.hasNext();)
{
             Role role = (Role) roleMappings.next();
@@ -378,7 +378,7 @@
                 for (Iterator principals = realm.getPrincipals().iterator(); principals.hasNext();)
{
                     org.apache.geronimo.security.deploy.Principal principal = (org.apache.geronimo.security.deploy.Principal)
principals.next();
 
-                    RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(principal,
loginDomainName, realm.getRealmName());
+                    RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(principal,
securityRealmName, realm.getRealmName());
                     if (realmPrincipal == null) {
                         throw new GeronimoSecurityException("Unable to create realm principal");
                     }

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java?view=diff&rev=126205&p1=geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java&r1=126204&p2=geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java&r2=126205
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
(original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
Sun Jan 23 00:32:11 2005
@@ -127,7 +127,7 @@
 
     protected void setUpSecureAppContext(Security securityConfig, PermissionCollection uncheckedPermissions,
PermissionCollection excludedPermissions, Map rolePermissions, Set securityRoles) throws Exception
{
         GBeanData app = new GBeanData(webModuleName, JettyWebAppContext.GBEAN_INFO);
-        app.setAttribute("loginDomainName", "demo-properties-realm");
+        app.setAttribute("securityRealmName", "demo-properties-realm");
         app.setAttribute("securityConfig", securityConfig);
         app.setAttribute("uncheckedPermissions", uncheckedPermissions);
         app.setAttribute("excludedPermissions", excludedPermissions);
@@ -190,6 +190,7 @@
         options.setProperty("usersURI", "src/test-resources/data/users.properties");
         options.setProperty("groupsURI", "src/test-resources/data/groups.properties");
         propertiesLMGBean.setAttribute("options", options);
+        //TODO should this be called securityRealmName?
         propertiesLMGBean.setAttribute("loginDomainName", "demo-properties-realm");
 
         propertiesRealmName = new ObjectName("geronimo.server:j2eeType=SecurityRealm,name=demo-properties-realm");

Mime
View raw message