jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r791815 - in /jackrabbit/branches/1.x: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/s...
Date Tue, 07 Jul 2009 12:31:57 GMT
Author: jukka
Date: Tue Jul  7 12:31:57 2009
New Revision: 791815

URL: http://svn.apache.org/viewvc?rev=791815&view=rev
Log:
1.x: Merged revision 785981 (JCR-1977)

Modified:
    jackrabbit/branches/1.x/   (props changed)
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
    jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java

Propchange: jackrabbit/branches/1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul  7 12:31:57 2009
@@ -1 +1 @@
-/jackrabbit/trunk:770143-773197,773483,773525-773554,773584,773588,773828,773835-775756,775833,775836,775840,775868,775981,775986,776036,776256,776310,776313,776321-776322,776332,776356-776357,776362,776373,776650-776693,776737,776757,776776-776777,777024,777029,777034,777478,777509,777541,777548,777936,778445,778613,778616,778621,778645,778720,778802,779032,779040,779068-779071,779074,779076,779081,779084,779086-779088,779090-779092,779094-779096,779101,779223,779225,779227-779228,779230,779233-779234,779460,779475-779476,779504,779550,779552,779555,779561,779563,779583,779590,779618,779621-779622,779624,779642,779654,779657-779659,779661,779936,780006,780010,780025,780085,780989,780993,781017,781051,781054,781294-781300,781305-781311,781318,781328,781338,781344,781347,781369,781372,781377,781416-781417,781423,782621-782622,782644,782646,782652,782669,782675,782677,782683,782694,782921,782925,782930,782936,783002,783004-783005,783042-783043,783239,783278,783304,783319-78332
 1,783324,783326,783330-783333,783337-783338,783340-783341,783343,783345-783346,783356,783359,783383,783386,783412,783435,783444,783447,783523,783688,783703,783708,783710,783719,783757,783759,783786,783809
+/jackrabbit/trunk:770143-773197,773483,773525-773554,773584,773588,773828,773835-775756,775833,775836,775840,775868,775981,775986,776036,776256,776310,776313,776321-776322,776332,776356-776357,776362,776373,776650-776693,776737,776757,776776-776777,777024,777029,777034,777478,777509,777541,777548,777936,778445,778613,778616,778621,778645,778720,778802,779032,779040,779068-779071,779074,779076,779081,779084,779086-779088,779090-779092,779094-779096,779101,779223,779225,779227-779228,779230,779233-779234,779460,779475-779476,779504,779550,779552,779555,779561,779563,779583,779590,779618,779621-779622,779624,779642,779654,779657-779659,779661,779936,780006,780010,780025,780085,780989,780993,781017,781051,781054,781294-781300,781305-781311,781318,781328,781338,781344,781347,781369,781372,781377,781416-781417,781423,782621-782622,782644,782646,782652,782669,782675,782677,782683,782694,782921,782925,782930,782936,783002,783004-783005,783042-783043,783239,783278,783304,783319-78332
 1,783324,783326,783330-783333,783337-783338,783340-783341,783343,783345-783346,783356,783359,783383,783386,783412,783435,783444,783447,783523,783688,783703,783708,783710,783719,783757,783759,783786,783809,784011,784013,784039,784058,784060-784061,784090-784091,784106,784108-784109,784111,784117-784120,784124,784163,784261,784680,784691,784696,784760,784824,785981

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java?rev=791815&r1=791814&r2=791815&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/DefaultSecurityManager.java
Tue Jul  7 12:31:57 2009
@@ -83,7 +83,7 @@
     private static final Logger log = LoggerFactory.getLogger(DefaultSecurityManager.class);
 
     /**
-     *
+     * Flag indicating if the security manager was properly initialized.
      */
     private boolean initialized;
 
@@ -171,10 +171,10 @@
 
         // build AuthContextProvider based on appName + optional LoginModuleConfig
         authContextProvider = new AuthContextProvider(config.getAppName(), loginModConf);
-        if (authContextProvider.isJAAS()) {
-            log.info("init: use JAAS login-configuration for " + config.getAppName());
-        } else if (authContextProvider.isLocal()) {
+        if (authContextProvider.isLocal()) {
             log.info("init: use Repository Login-Configuration for " + config.getAppName());
+        } else if (authContextProvider.isJAAS()) {
+            log.info("init: use JAAS login-configuration for " + config.getAppName());
         } else {
             String msg = "Neither JAAS nor RepositoryConfig contained a valid Configuriation
for " + config.getAppName();
             log.error(msg);

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java?rev=791815&r1=791814&r2=791815&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AuthContextProvider.java
Tue Jul  7 12:31:57 2009
@@ -95,10 +95,10 @@
 
         CallbackHandler cbHandler = new CallbackHandlerImpl(credentials, session, principalProviderRegistry,
adminId, anonymousId);
 
-        if (isJAAS()) {
-            return new JAASAuthContext(appName, cbHandler, subject);
-        } else if (isLocal()){
+        if (isLocal()) {
             return new LocalAuthContext(config, cbHandler, subject);
+        } else if (isJAAS()) {
+            return new JAASAuthContext(appName, cbHandler, subject);
         } else {
             throw new RepositoryException("No Login-Configuration");
         }
@@ -108,23 +108,23 @@
      * @return true if a application entry is available in a JAAS- {@link Configuration}
      */
     public boolean isJAAS() {
-        if (!initialized) {
+        if (!isLocal() && !initialized) {
             AppConfigurationEntry[] entries = getJAASConfig();
-            isJAAS = null!=entries && entries.length>0;
+            isJAAS = entries != null && entries.length > 0;
             initialized = true;
         }
         return isJAAS;
     }
 
     /**
-     * @return true if {@link #isJAAS()} is false and a login-module is configured
+     * @return true if a login-module is configured.
      */
     public boolean isLocal() {
-        return !(isJAAS() || config == null);
+        return config != null;
     }
 
     /**
-     * @return options configured for the LoginModules to use
+     * @return options configured for the LoginModules to use.
      */
     public Properties[] getModuleConfig() {
         Properties[] props = new Properties[0];

Modified: jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java?rev=791815&r1=791814&r2=791815&view=diff
==============================================================================
--- jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java
(original)
+++ jackrabbit/branches/1.x/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleSecurityManager.java
Tue Jul  7 12:31:57 2009
@@ -110,10 +110,10 @@
         // read the LoginModule configuration
         LoginModuleConfig loginModConf = config.getLoginModuleConfig();
         authCtxProvider = new AuthContextProvider(config.getAppName(), loginModConf);
-        if (authCtxProvider.isJAAS()) {
-            log.info("init: using JAAS LoginModule configuration for " + config.getAppName());
-        } else if (authCtxProvider.isLocal()) {
+        if (authCtxProvider.isLocal()) {
             log.info("init: using Repository LoginModule configuration for " + config.getAppName());
+        } else if (authCtxProvider.isJAAS()) {
+            log.info("init: using JAAS LoginModule configuration for " + config.getAppName());
         } else {
             String msg = "No valid LoginModule configuriation for " + config.getAppName();
             log.error(msg);



Mime
View raw message