summaryrefslogtreecommitdiffstats
path: root/auth/auth-core
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-12-08 00:48:42 -0600
committerInstrumental <jonathan.gathman@att.com>2018-12-08 00:48:44 -0600
commit96c89c2fa3858e9228c15e3573c88268710361d0 (patch)
tree12d6baea31ec2045f7a7f08d50c7d10be09d2ac0 /auth/auth-core
parentdc4923a67f424149e35a77108f5b2ac3418fbaf3 (diff)
Refactor Batch: Remove
Issue-ID: AAF-670 Change-Id: If5c961500340826e63fb224c10b44d9aed1d6b5e Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-core')
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java39
1 files changed, 35 insertions, 4 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 fd252fe4..69cfc7d7 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
@@ -64,6 +64,18 @@ public interface Organization {
public boolean isPerson(); // Whether a Person or a Machine (App)
public Organization org(); // Organization of Identity
+
+ public static String mixedCase(String in) {
+ StringBuilder sb = new StringBuilder();
+ for(int i=0;i<in.length();++i) {
+ if(i==0) {
+ sb.append(Character.toUpperCase(in.charAt(i)));
+ } else {
+ sb.append(Character.toLowerCase(in.charAt(i)));
+ }
+ }
+ return sb.toString();
+ }
}
@@ -83,9 +95,7 @@ public interface Organization {
public void addSupportedRealm(String r);
-
-
- String getDomain();
+ public String getDomain();
/**
* Get Identity information based on userID
@@ -95,6 +105,20 @@ public interface Organization {
*/
public Identity getIdentity(AuthzTrans trans, String id) throws OrganizationException;
+ /**
+ * May AutoDelete
+ *
+ * Deletion of an Identity that has been removed from an Organization can be dangerous. Mistakes may have been made
+ * in the Organization side, a Feed might be corrupted, an API might not be quite right.
+ *
+ * The implementation of this method can use a double check of some sort, such as comparsion of missing ID in Organization
+ * feed with a "Deleted ID" feed.
+ *
+ * The failure to be in Organization will still be reported, if returned "false", but if true, it is taken as an
+ * ok to proceed with deletion.
+ */
+ public boolean mayAutoDelete(AuthzTrans trans, String id);
+
/**
* Does the ID pass Organization Standards
@@ -516,15 +540,22 @@ public interface Organization {
}
};
+
+
}
@Override
public String[] getPasswordRules() {
return nullStringArray;
}
+
+ @Override
+ public boolean mayAutoDelete(AuthzTrans trans, String id) {
+ // provide a corresponding feed that indicates that an ID has been intentionally removed from identities.dat table.
+ return false;
+ }
};
-
}