summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src
diff options
context:
space:
mode:
authorInstrumental <jgonap@stl.gathman.org>2019-12-20 15:55:27 -0600
committerInstrumental <jgonap@stl.gathman.org>2019-12-20 15:55:29 -0600
commita3b442a09aa3666662003d7c8a5ed69ee24a373e (patch)
treed22d820020a413a015d92bc74c5e586483b54e2e /auth/auth-batch/src
parent439d8cd4ad19585fb93d721041e21ec8b46e4f0e (diff)
Make Organization isRevoked return Date
Issue-ID: AAF-1058 Change-Id: I4120235dc6f78fb1db0c7bea86c6938aae076b63 Signed-off-by: Instrumental <jgonap@stl.gathman.org>
Diffstat (limited to 'auth/auth-batch/src')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java17
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java3
2 files changed, 12 insertions, 8 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java
index 227717b7..ff2c72a5 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/Analyze.java
@@ -219,11 +219,13 @@ public class Analyze extends Batch {
// for users and approvers still valid
String user = appr.getUser();
- if(org.isRevoked(noAvg, appr.getApprover())) {
- deleteCW.comment("Approver ID is revoked");
+ Date revokedAppr = org.isRevoked(noAvg, appr.getApprover());
+ Date revokedUser = org.isRevoked(noAvg, user);
+ if(revokedAppr!=null) {
+ deleteCW.comment("Approver ID is revoked on " + revokedAppr);
Approval.row(deleteCW, appr);
- } else if(user!=null && !user.isEmpty() && org.isRevoked(noAvg, user)) {
- deleteCW.comment("USER ID is revoked");
+ } else if(user!=null && !user.isEmpty() && revokedUser!=null) {
+ deleteCW.comment("USER ID is revoked on " + revokedUser);
Approval.row(deleteCW, appr);
} else {
ticket.approvals.add(appr); // add to found Ticket
@@ -393,14 +395,15 @@ public class Analyze extends Batch {
}
return;
}
- if(org.isRevoked(trans, ur.user())) {
+ Date revoked = org.isRevoked(trans, ur.user());
+ if(revoked!=null) {
GregorianCalendar gc = new GregorianCalendar();
- gc.setTime(ur.expires());
+ gc.setTime(revoked);
GregorianCalendar gracePeriodEnds = org.expiration(gc, Expiration.RevokedGracePeriodEnds, ur.user());
if(now.after(gracePeriodEnds.getTime())) {
ur.row(deleteCW, UserRole.UR,"Revoked ID, no grace period left");
} else {
- ur.row(notCompliantCW, UserRole.UR, "Revoked ID: WARNING! GracePeriod Ends " + gracePeriodEnds.toString());
+ ur.row(notCompliantCW, UserRole.UR, "Revoked ID: WARNING! GracePeriod Ends " + Chrono.dateOnlyStamp(gracePeriodEnds));
}
return;
}
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java
index fadd0682..dc45ecae 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/reports/NotInOrg.java
@@ -134,7 +134,8 @@ public class NotInOrg extends Batch {
private Writer whichWriter(AuthzTrans transNoAvg, String id) {
Writer w = whichWriter.get(id);
if(w==null) {
- w = org.isRevoked(transNoAvg, id)?
+ Date revoked = org.isRevoked(transNoAvg, id);
+ w = revoked != null?
notInOrgDeleteW:
notInOrgW;
whichWriter.put(id,w);