diff options
author | 2020-09-17 15:54:19 -0500 | |
---|---|---|
committer | 2020-09-24 14:32:42 -0500 | |
commit | 4a3962dec1da8d43e0db225d42fa4d57e338e1d6 (patch) | |
tree | 37bb59f7dd421ffed038a1e28aea9f6bb83b834c | |
parent | c5d6ab10c6715bbe75be3ece7d033048ce2e1f97 (diff) |
Prepare for release 2.1.18
Issue-ID: AAF-1202
Change-Id: I138ff4d94ed17a5b2de24fa95daf7d2a38eb84c0
Signed-off-by: Sean Hassan <sean.hassan@att.com>
-rw-r--r-- | pom.xml | 4 | ||||
-rw-r--r-- | shiro-osgi-bundle/pom.xml | 2 | ||||
-rw-r--r-- | shiro/pom.xml | 2 | ||||
-rw-r--r-- | shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthorizationInfo.java | 54 | ||||
-rw-r--r-- | shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java | 12 | ||||
-rw-r--r-- | sidecar/fproxy/pom.xml | 2 | ||||
-rw-r--r-- | sidecar/pom.xml | 2 | ||||
-rw-r--r-- | sidecar/rproxy/pom.xml | 2 | ||||
-rw-r--r-- | sidecar/tproxy-config/pom.xml | 2 | ||||
-rw-r--r-- | version.properties | 2 |
10 files changed, 57 insertions, 27 deletions
@@ -22,7 +22,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>org.onap.aaf.cadi</groupId> <artifactId>parent</artifactId> - <version>2.1.17-SNAPSHOT</version> + <version>2.1.18-SNAPSHOT</version> <name>CADI Plugins Parent</name> <packaging>pom</packaging> @@ -34,7 +34,7 @@ <properties> <!-- This version needs to be RELEASED version. Fails on SNAPSHOT --> - <cadi.version>2.7.1</cadi.version> + <cadi.version>2.7.2</cadi.version> <!-- <sonar.skip>true</sonar.skip> --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- project.jettyVersion>9.4.12.v20180830</project.jettyVersion --> diff --git a/shiro-osgi-bundle/pom.xml b/shiro-osgi-bundle/pom.xml index 039b79e..531ee90 100644 --- a/shiro-osgi-bundle/pom.xml +++ b/shiro-osgi-bundle/pom.xml @@ -22,7 +22,7 @@ <parent> <groupId>org.onap.aaf.cadi</groupId> <artifactId>parent</artifactId> - <version>2.1.17-SNAPSHOT</version> + <version>2.1.18-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/shiro/pom.xml b/shiro/pom.xml index 4810acb..fada340 100644 --- a/shiro/pom.xml +++ b/shiro/pom.xml @@ -22,7 +22,7 @@ <parent> <groupId>org.onap.aaf.cadi</groupId> <artifactId>parent</artifactId> - <version>2.1.17-SNAPSHOT</version> + <version>2.1.18-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthorizationInfo.java b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthorizationInfo.java index ac62778..247683a 100644 --- a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthorizationInfo.java +++ b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthorizationInfo.java @@ -42,6 +42,7 @@ public class AAFAuthorizationInfo implements AuthorizationInfo { private Access access; private Principal bait; + private List<org.onap.aaf.cadi.Permission> pond; // Use these to save conversions private List<org.onap.aaf.cadi.Permission> cPerms; private List<Permission> oPerms; @@ -53,6 +54,16 @@ public class AAFAuthorizationInfo implements AuthorizationInfo { cPerms=null; oPerms=null; sPerms=null; + pond=null; + } + + public AAFAuthorizationInfo(Access access, Principal bait, List<org.onap.aaf.cadi.Permission> pond) { + this.access = access; + this.bait = bait; + this.pond = pond; + oPerms=null; + sPerms=null; + cPerms=null; } public Principal principal() { @@ -64,13 +75,20 @@ public class AAFAuthorizationInfo implements AuthorizationInfo { access.log(Level.DEBUG, "AAFAuthorizationInfo.getObjectPermissions"); synchronized(bait) { if(oPerms == null) { - oPerms = new ArrayList<>(); - if(cPerms==null) { - cPerms = new ArrayList<>(); - AAFRealm.singleton.authz.fishAll(bait, cPerms); - } - for(final org.onap.aaf.cadi.Permission p : cPerms) { - oPerms.add(new AAFShiroPermission(p)); + if (pond != null) { + oPerms = new ArrayList<Permission>(); + for(final org.onap.aaf.cadi.Permission p : pond) { + oPerms.add(new AAFShiroPermission(p)); + } + } else { + oPerms = new ArrayList<>(); + if (cPerms == null) { + cPerms = new ArrayList<>(); + AAFRealm.singleton.authz.fishAll(bait, cPerms); + } + for (final org.onap.aaf.cadi.Permission p : cPerms) { + oPerms.add(new AAFShiroPermission(p)); + } } } } @@ -89,13 +107,21 @@ public class AAFAuthorizationInfo implements AuthorizationInfo { access.log(Level.DEBUG,"AAFAuthorizationInfo.getStringPermissions"); synchronized(bait) { if(sPerms == null) { - sPerms = new ArrayList<>(); - if(cPerms==null) { - cPerms = new ArrayList<>(); - AAFRealm.singleton.authz.fishAll(bait,cPerms); - } - for(final org.onap.aaf.cadi.Permission p : cPerms) { - sPerms.add(p.getKey()); + if (pond != null) { + sPerms = new ArrayList<String>(); + for(org.onap.aaf.cadi.Permission p : pond) { + sPerms.add(p.getKey().replace("|", ":")); + access.printf(Level.INFO, "%s has %s", bait.getName(), p.getKey()); + } + } else { + sPerms = new ArrayList<>(); + if (cPerms == null) { + cPerms = new ArrayList<>(); + AAFRealm.singleton.authz.fishAll(bait, cPerms); + } + for (final org.onap.aaf.cadi.Permission p : cPerms) { + sPerms.add(p.getKey()); + } } } } diff --git a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java index d213b01..818ec9e 100644 --- a/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java +++ b/shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java @@ -22,6 +22,7 @@ package org.onap.aaf.cadi.shiro; import java.io.IOException; import java.security.Principal; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -38,6 +39,7 @@ import org.apache.shiro.subject.PrincipalCollection; import org.onap.aaf.cadi.Access.Level; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.LocatorException; +import org.onap.aaf.cadi.Permission; import org.onap.aaf.cadi.PropAccess; import org.onap.aaf.cadi.Symm; import org.onap.aaf.cadi.aaf.AAFPermission; @@ -252,7 +254,7 @@ public class AAFRealm extends AuthorizingRealm { } } catch (IOException e) { singleton.access.log(e); - } + } } String err; try { @@ -302,7 +304,9 @@ public class AAFRealm extends AuthorizingRealm { }; } } - return new AAFAuthorizationInfo(singleton.access,newBait); + List<Permission> pond = new ArrayList<>(); + singleton.authz.fishAll(newBait,pond); + return new AAFAuthorizationInfo(singleton.access,bait,pond); } @Override @@ -328,7 +332,7 @@ public class AAFRealm extends AuthorizingRealm { return null; } } - +/* @Override public boolean isPermitted(PrincipalCollection principals, String permission) { logger.debug("AAFRealm.isPermitted(principals,permission<String>)"); @@ -370,5 +374,5 @@ public class AAFRealm extends AuthorizingRealm { } return super.isPermitted(permissions, info); } - +*/ } diff --git a/sidecar/fproxy/pom.xml b/sidecar/fproxy/pom.xml index 94d6a41..eb680ba 100644 --- a/sidecar/fproxy/pom.xml +++ b/sidecar/fproxy/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.onap.aaf.cadi.sidecar</groupId> <artifactId>sidecar</artifactId> - <version>2.1.17-SNAPSHOT</version> + <version>2.1.18-SNAPSHOT</version> </parent> <properties> diff --git a/sidecar/pom.xml b/sidecar/pom.xml index ed01273..bba5587 100644 --- a/sidecar/pom.xml +++ b/sidecar/pom.xml @@ -20,7 +20,7 @@ <parent> <groupId>org.onap.aaf.cadi</groupId> <artifactId>parent</artifactId> - <version>2.1.17-SNAPSHOT</version> + <version>2.1.18-SNAPSHOT</version> <relativePath>..</relativePath> </parent> <modelVersion>4.0.0</modelVersion> diff --git a/sidecar/rproxy/pom.xml b/sidecar/rproxy/pom.xml index 6e1789e..368c833 100644 --- a/sidecar/rproxy/pom.xml +++ b/sidecar/rproxy/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.onap.aaf.cadi.sidecar</groupId> <artifactId>sidecar</artifactId> - <version>2.1.17-SNAPSHOT</version> + <version>2.1.18-SNAPSHOT</version> </parent> <properties> diff --git a/sidecar/tproxy-config/pom.xml b/sidecar/tproxy-config/pom.xml index 744ff1a..e1de788 100644 --- a/sidecar/tproxy-config/pom.xml +++ b/sidecar/tproxy-config/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.onap.aaf.cadi.sidecar</groupId> <artifactId>sidecar</artifactId> - <version>2.1.17-SNAPSHOT</version> + <version>2.1.18-SNAPSHOT</version> </parent> <artifactId>tproxy-config</artifactId> diff --git a/version.properties b/version.properties index 3be336d..c276227 100644 --- a/version.properties +++ b/version.properties @@ -28,7 +28,7 @@ # This TAG <version>2.1.13</version> is here to help remember to change this file. Keep it up to date with the following "real" entries: major=2 minor=1 -patch=17 +patch=18 base_version=${major}.${minor}.${patch} |