geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r428760 - /geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
Date Fri, 04 Aug 2006 15:46:18 GMT
Author: ammulder
Date: Fri Aug  4 08:46:18 2006
New Revision: 428760

URL: http://svn.apache.org/viewvc?rev=428760&view=rev
Log:
Don't assume that default-principal contains a plain principal
  child (GERONIMO-2275)

Modified:
    geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java

Modified: geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java?rev=428760&r1=428759&r2=428760&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
(original)
+++ geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
Fri Aug  4 08:46:18 2006
@@ -202,7 +202,15 @@
     public static DefaultPrincipal buildDefaultPrincipal(GerDefaultPrincipalType defaultPrincipalType)
{
         DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
 
-        defaultPrincipal.setPrincipal(buildPrincipal(defaultPrincipalType.getPrincipal()));
+        if(defaultPrincipalType.isSetPrincipal()) {
+            defaultPrincipal.setPrincipal(buildPrincipal(defaultPrincipalType.getPrincipal()));
+        } else if(defaultPrincipalType.isSetLoginDomainPrincipal()) {
+            defaultPrincipal.setPrincipal(buildDomainPrincipal(defaultPrincipalType.getLoginDomainPrincipal()));
+        } else if(defaultPrincipalType.isSetRealmPrincipal()) {
+            defaultPrincipal.setPrincipal(buildRealmPrincipal(defaultPrincipalType.getRealmPrincipal()));
+        } else {
+            throw new IllegalStateException("default-principal does not contain a principal,
login-domain-principal, or realm-principal");
+        }
         GerNamedUsernamePasswordCredentialType[] namedCredentials = defaultPrincipalType.getNamedUsernamePasswordCredentialArray();
         if (namedCredentials.length > 0) {
             Set defaultCredentialSet = new HashSet();



Mime
View raw message