summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-04-18 10:52:42 -0500
committerInstrumental <jcgmisc@stl.gathman.org>2018-04-18 10:52:52 -0500
commit087706284431e63ea77b934859a47beeb59e4592 (patch)
treef96525f12d0a243f35739d6b909ae892068945bf /auth/auth-core/src
parent3c0e04b9064ff069f5e594a5023c2f18ba487e80 (diff)
Support Multiple Realms for DefaultOrg
Issue-ID: AAF-254 Change-Id: I89a9b1ceaa304861debd4c7dd21879e0b1fc902a Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-core/src')
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java15
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java8
2 files changed, 23 insertions, 0 deletions
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java
index 6d7a3586..8476e06c 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java
@@ -78,6 +78,12 @@ public interface Organization {
* @return
*/
public String getRealm();
+
+ public boolean supportsRealm(String user);
+
+ public void addSupportedRealm(String r);
+
+
String getDomain();
@@ -373,6 +379,15 @@ public interface Organization {
}
@Override
+ public boolean supportsRealm(String r) {
+ return false;
+ }
+
+ @Override
+ public void addSupportedRealm(String r) {
+ }
+
+ @Override
public String getDomain() {
return N_A;
}
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
index 843e2682..57d37d0b 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
@@ -29,6 +29,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.onap.aaf.auth.env.AuthzTrans;
import org.onap.aaf.cadi.util.FQI;
+import org.onap.aaf.cadi.util.Split;
import org.onap.aaf.misc.env.Env;
import org.onap.aaf.misc.env.impl.BasicEnv;
@@ -98,6 +99,13 @@ public class OrganizationFactory {
Class<Organization> cls = (Class<Organization>) Class.forName(orgClass);
Constructor<Organization> cnst = cls.getConstructor(Env.class,String.class);
org = cnst.newInstance(env,orgNS);
+ String other_realms = env.getProperty(orgNS+".also_supports");
+ if(other_realms!=null) {
+ for(String r : Split.splitTrim(',', other_realms)) {
+ org.addSupportedRealm(r);
+ }
+ }
+
} catch (ClassNotFoundException | NoSuchMethodException | SecurityException |
InstantiationException | IllegalAccessException | IllegalArgumentException |
InvocationTargetException e) {