diff options
author | varun gudisena <vg411h@att.com> | 2018-04-19 17:17:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-04-19 17:17:39 +0000 |
commit | 06e9aa2931545ac8e193e4404af78a83a8ba794f (patch) | |
tree | edbef0e3cac648b0ac5dc4902937d7c1f2d4dff8 /auth/auth-core/src | |
parent | 6eecd1c6230997d8c0dffe787439edb6d5ca7007 (diff) | |
parent | 087706284431e63ea77b934859a47beeb59e4592 (diff) |
Merge "Support Multiple Realms for DefaultOrg"
Diffstat (limited to 'auth/auth-core/src')
-rw-r--r-- | auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java | 15 | ||||
-rw-r--r-- | auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java | 8 |
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) { |