geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r597856 - in /geronimo/server: branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/ branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/ trunk/framework/module...
Date Sat, 24 Nov 2007 14:58:32 GMT
Author: vamsic007
Date: Sat Nov 24 06:58:31 2007
New Revision: 597856

URL: http://svn.apache.org/viewvc?rev=597856&view=rev
Log:
GERONIMO-3628 Review GeronimoPasswordCredentialLoginModule
GERONIMO-3626 Review NamedUPCredentialLoginModule
o Missed the logging part in the previous commits :o(

Modified:
    geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
    geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java

Modified: geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java?rev=597856&r1=597855&r2=597856&view=diff
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
Sat Nov 24 06:58:31 2007
@@ -17,6 +17,9 @@
 package org.apache.geronimo.security.jaas;
 
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import javax.security.auth.DestroyFailedException;
@@ -29,6 +32,9 @@
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 
 /**
  * Inserts named Username/Password credential into private credentials of Subject.
@@ -42,8 +48,10 @@
  * @version $Revision$ $Date$
  */
 public class NamedUPCredentialLoginModule implements LoginModule {
+    private static Log log = LogFactory.getLog(NamedUPCredentialLoginModule.class);
 
     public static final String CREDENTIAL_NAME = "org.apache.geronimo.jaas.NamedUPCredentialLoginModule.Name";
+    public final static List<String> supportedOptions = Collections.unmodifiableList(Arrays.asList(CREDENTIAL_NAME));
 
     private String name;
     private Subject subject;
@@ -51,9 +59,14 @@
     private NamedUsernamePasswordCredential nupCredential;
 
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState,
Map options) {
-
         this.subject = subject;
         this.callbackHandler = callbackHandler;
+        for(Object option: options.keySet()) {
+            if(!supportedOptions.contains(option) && !JaasLoginModuleUse.supportedOptions.contains(option)
+                    && !WrappingLoginModule.supportedOptions.contains(option)) {
+                log.warn("Ignoring option: "+option+". Not supported.");
+            }
+        }
         this.name = (String) options.get(CREDENTIAL_NAME);
     }
 

Modified: geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java?rev=597856&r1=597855&r2=597856&view=diff
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java
(original)
+++ geronimo/server/branches/2.0/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java
Sat Nov 24 06:58:31 2007
@@ -17,6 +17,8 @@
 
 package org.apache.geronimo.security.realm.providers;
 
+import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 
 import javax.security.auth.DestroyFailedException;
@@ -29,6 +31,11 @@
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
+import org.apache.geronimo.security.jaas.WrappingLoginModule;
+
 
 /**
  * GeronimoPasswordCredentialLoginModule stores the user name and password in a GeronimoPasswordCredential.
@@ -41,6 +48,11 @@
  * @version $Rev$ $Date$
  */
 public class GeronimoPasswordCredentialLoginModule implements LoginModule {
+    private static Log log = LogFactory.getLog(GeronimoPasswordCredentialLoginModule.class);
+
+    // Note: If this LoginModule supports any options, the Collections.EMPTY_LIST in the
following should be
+    // replaced with the list of supported options for e.g. Arrays.asList(option1, option2,
...) etc.
+    public final static List<String> supportedOptions = Collections.unmodifiableList(Collections.EMPTY_LIST);
 
     private Subject subject;
     private CallbackHandler callbackHandler;
@@ -51,6 +63,12 @@
                            Map sharedState, Map options) {
         this.subject = subject;
         this.callbackHandler = callbackHandler;
+        for(Object option: options.keySet()) {
+            if(!supportedOptions.contains(option) && !JaasLoginModuleUse.supportedOptions.contains(option)
+                    && !WrappingLoginModule.supportedOptions.contains(option)) {
+                log.warn("Ignoring option: "+option+". Not supported.");
+            }
+        }
     }
 
     public boolean login() throws LoginException {

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java?rev=597856&r1=597855&r2=597856&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jaas/NamedUPCredentialLoginModule.java
Sat Nov 24 06:58:31 2007
@@ -17,6 +17,9 @@
 package org.apache.geronimo.security.jaas;
 
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import javax.security.auth.DestroyFailedException;
@@ -29,6 +32,9 @@
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 
 /**
  * Inserts named Username/Password credential into private credentials of Subject.
@@ -42,8 +48,10 @@
  * @version $Revision$ $Date$
  */
 public class NamedUPCredentialLoginModule implements LoginModule {
+    private static Log log = LogFactory.getLog(NamedUPCredentialLoginModule.class);
 
     public static final String CREDENTIAL_NAME = "org.apache.geronimo.jaas.NamedUPCredentialLoginModule.Name";
+    public final static List<String> supportedOptions = Collections.unmodifiableList(Arrays.asList(CREDENTIAL_NAME));
 
     private String name;
     private Subject subject;
@@ -51,9 +59,14 @@
     private NamedUsernamePasswordCredential nupCredential;
 
     public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState,
Map options) {
-
         this.subject = subject;
         this.callbackHandler = callbackHandler;
+        for(Object option: options.keySet()) {
+            if(!supportedOptions.contains(option) && !JaasLoginModuleUse.supportedOptions.contains(option)
+                    && !WrappingLoginModule.supportedOptions.contains(option)) {
+                log.warn("Ignoring option: "+option+". Not supported.");
+            }
+        }
         this.name = (String) options.get(CREDENTIAL_NAME);
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java?rev=597856&r1=597855&r2=597856&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/GeronimoPasswordCredentialLoginModule.java
Sat Nov 24 06:58:31 2007
@@ -17,6 +17,8 @@
 
 package org.apache.geronimo.security.realm.providers;
 
+import java.util.Collections;
+import java.util.List;
 import java.util.Map;
 
 import javax.security.auth.DestroyFailedException;
@@ -29,6 +31,11 @@
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
+import org.apache.geronimo.security.jaas.WrappingLoginModule;
+
 
 /**
  * GeronimoPasswordCredentialLoginModule stores the user name and password in a GeronimoPasswordCredential.
@@ -41,6 +48,11 @@
  * @version $Rev$ $Date$
  */
 public class GeronimoPasswordCredentialLoginModule implements LoginModule {
+    private static Log log = LogFactory.getLog(GeronimoPasswordCredentialLoginModule.class);
+
+    // Note: If this LoginModule supports any options, the Collections.EMPTY_LIST in the
following should be
+    // replaced with the list of supported options for e.g. Arrays.asList(option1, option2,
...) etc.
+    public final static List<String> supportedOptions = Collections.unmodifiableList(Collections.EMPTY_LIST);
 
     private Subject subject;
     private CallbackHandler callbackHandler;
@@ -51,6 +63,12 @@
                            Map sharedState, Map options) {
         this.subject = subject;
         this.callbackHandler = callbackHandler;
+        for(Object option: options.keySet()) {
+            if(!supportedOptions.contains(option) && !JaasLoginModuleUse.supportedOptions.contains(option)
+                    && !WrappingLoginModule.supportedOptions.contains(option)) {
+                log.warn("Ignoring option: "+option+". Not supported.");
+            }
+        }
     }
 
     public boolean login() throws LoginException {



Mime
View raw message