geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r109936 - in geronimo/branches/djencks/jetty-deployer1/trunk/modules: jetty-builder/src/java/org/apache/geronimo/jetty/deployment jetty/src/java/org/apache/geronimo/jetty
Date Mon, 06 Dec 2004 01:38:29 GMT
Author: djencks
Date: Sun Dec  5 17:38:29 2004
New Revision: 109936

URL: http://svn.apache.org/viewcvs?view=rev&rev=109936
Log:
isCallerInRole now works
Modified:
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=109936&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r1=109935&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r2=109936
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Sun Dec  5 17:38:29 2004
@@ -640,7 +640,7 @@
                 }
 
                 Set mappings = (Set) servletMappings.get(servletName);
-                servletData.setAttribute("servletMappings", mappings == null? Collections.EMPTY_SET:
mappings);
+                servletData.setAttribute("servletMappings", mappings == null ? Collections.EMPTY_SET
: mappings);
 
                 //WebRoleRefPermissions
                 SecurityRoleRefType[] securityRoleRefTypeArray = servletType.getSecurityRoleRefArray();
@@ -650,12 +650,20 @@
                     SecurityRoleRefType securityRoleRefType = securityRoleRefTypeArray[j];
                     String roleName = securityRoleRefType.getRoleName().getStringValue().trim();
                     String roleLink = securityRoleRefType.getRoleLink().getStringValue().trim();
-                    webRoleRefPermissions.put(roleName, new WebRoleRefPermission(servletName,
roleLink));
+                    //jacc 3.1.3.2
+                    /*   The name of the WebRoleRefPermission must be the servlet-name in
whose
+                    * context the security-role-ref is defined. The actions of the  WebRoleRefPermission
+                    * must be the value of the role-name (that is the  reference), appearing
in the security-role-ref.
+                    * The deployment tools must  call the addToRole method on the PolicyConfiguration
object to add the
+                    * WebRoleRefPermission object resulting from the translation to the role
+                    * identified in the role-link appearing in the security-role-ref.
+                    */
+                    webRoleRefPermissions.put(new WebRoleRefPermission(servletName, roleName),
roleLink);
                     unmappedRoles.remove(roleName);
                 }
                 for (Iterator iterator = unmappedRoles.iterator(); iterator.hasNext();) {
                     String roleName = (String) iterator.next();
-                    webRoleRefPermissions.put(roleName, new WebRoleRefPermission(servletName,
roleName));
+                    webRoleRefPermissions.put(new WebRoleRefPermission(servletName, roleName),
roleName);
                 }
                 servletData.setAttribute("webRoleRefPermissions", webRoleRefPermissions);
 
@@ -875,8 +883,7 @@
                     scBase.setDataConstraint(SecurityConstraint.DC_INTEGRAL);
                 else if ("CONFIDENTIAL".equals(guarantee))
                     scBase.setDataConstraint(SecurityConstraint.DC_CONFIDENTIAL);
-                else
-                {
+                else {
                     //ToDO what do we do here?
 //                    log.warn("Unknown user-data-constraint:" + guarantee);
                     scBase.setDataConstraint(SecurityConstraint.DC_CONFIDENTIAL);
@@ -897,7 +904,7 @@
                 HttpMethodType[] httpMethodArray = webResourceCollectionType.getHttpMethodArray();
                 for (int k = 0; k < httpMethodArray.length; k++) {
                     HttpMethodType httpMethodType = httpMethodArray[k];
-                        sc.addMethod(httpMethodType.getStringValue().trim());
+                    sc.addMethod(httpMethodType.getStringValue().trim());
                 }
                 UrlPatternType[] urlPatternArray = webResourceCollectionType.getUrlPatternArray();
                 for (int k = 0; k < urlPatternArray.length; k++) {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java?view=diff&rev=109936&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java&r1=109935&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java&r2=109936
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
Sun Dec  5 17:38:29 2004
@@ -229,41 +229,13 @@
         policyConfiguration = factory.getPolicyConfiguration(policyContextID, false);
         for (Iterator iterator = webRoleRefPermissions.entrySet().iterator(); iterator.hasNext();)
{
             Map.Entry entry = (Map.Entry) iterator.next();
-            String roleName = (String) entry.getKey();
-            WebRoleRefPermission webRoleRefPermission = (WebRoleRefPermission) entry.getValue();
+            String roleName = (String) entry.getValue();
+            WebRoleRefPermission webRoleRefPermission = (WebRoleRefPermission) entry.getKey();
             policyConfiguration.addToRole(roleName, webRoleRefPermission);
         }
         policyConfiguration.commit();
     }
 
-    /**
-     * Handler request.
-     * Call each HttpHandler until request is handled.
-     *
-     * @param pathInContext path in context
-     * @param pathParams    path parameters such as encoded Session ID
-     * @param httpRequest   the request object
-     * @param httpResponse  the response object
-     */
-//    public void handle(String pathInContext,
-//                       String pathParams,
-//                       HttpRequest httpRequest,
-//                       HttpResponse httpResponse)
-//            throws HttpException, IOException {
-//
-//        String savedPolicyContextID = PolicyContext.getContextID();
-//        JettyWebAppJACCContext savedContext = SecurityContextBeforeAfter.getCurrentWebAppContext();
-//
-//        try {
-//            PolicyContext.setContextID(policyContextID);
-//            SecurityContextBeforeAfter.setCurrentWebAppContext(this);
-//
-//            super.handle(pathInContext, pathParams, httpRequest, httpResponse);
-//        } finally {
-//            SecurityContextBeforeAfter.setCurrentWebAppContext(savedContext);
-//            PolicyContext.setContextID(savedPolicyContextID);
-//        }
-//    }
 
     /**
      * Keep our own copy of security constraints.<p/>

Mime
View raw message