Prepare for release 2.1.18 58/112858/2
authorSean Hassan <sean.hassan@att.com>
Thu, 17 Sep 2020 20:54:19 +0000 (15:54 -0500)
committerSean Hassan <sean.hassan@att.com>
Thu, 24 Sep 2020 19:32:42 +0000 (14:32 -0500)
Issue-ID: AAF-1202
Change-Id: I138ff4d94ed17a5b2de24fa95daf7d2a38eb84c0
Signed-off-by: Sean Hassan <sean.hassan@att.com>
pom.xml
shiro-osgi-bundle/pom.xml
shiro/pom.xml
shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFAuthorizationInfo.java
shiro/src/main/java/org/onap/aaf/cadi/shiro/AAFRealm.java
sidecar/fproxy/pom.xml
sidecar/pom.xml
sidecar/rproxy/pom.xml
sidecar/tproxy-config/pom.xml
version.properties

diff --git a/pom.xml b/pom.xml
index b896c4e..8b0096f 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -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 -->
index 039b79e..531ee90 100644 (file)
@@ -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>
 
index 4810acb..fada340 100644 (file)
@@ -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>
 
index ac62778..247683a 100644 (file)
@@ -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());
+                                       }
                                }
                        }
                }
index d213b01..818ec9e 100644 (file)
@@ -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);
        }
-
+*/
 }
index 94d6a41..eb680ba 100644 (file)
@@ -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>
index ed01273..bba5587 100644 (file)
@@ -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>
index 6e1789e..368c833 100644 (file)
@@ -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>
index 744ff1a..e1de788 100644 (file)
@@ -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>
index 3be336d..c276227 100644 (file)
@@ -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}