summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-core/src/main')
-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) {