summaryrefslogtreecommitdiffstats
path: root/auth/auth-cmd/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-cmd/src/main/java/org')
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java8
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Version.java2
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Delete.java6
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/List.java12
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/ListByUser.java54
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java24
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java4
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListForPermission.java2
-rw-r--r--auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Role.java2
9 files changed, 57 insertions, 57 deletions
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java
index 9e01d7c7..4cd628e8 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java
@@ -124,10 +124,10 @@ public class AAFcli {
}
public AuthzEnv env() {
- return env;
- }
+ return env;
+ }
- public static int timeout() {
+ public static int timeout() {
return TIMEOUT;
}
@@ -332,7 +332,7 @@ public class AAFcli {
Thread.sleep((long)(delay+globalDelay));
}
} catch (Exception e) {
- if (expect.contains(-1)) {
+ if (expect.contains(-1)) {
pw.println(e.getMessage());
ret = -1;
} else {
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Version.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Version.java
index d4a82d5d..9bfb77f9 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Version.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Version.java
@@ -29,7 +29,7 @@ import org.onap.aaf.misc.env.APIException;
public class Version extends Cmd {
private final String version;
- public Version(AAFcli aafcli) {
+ public Version(AAFcli aafcli) {
super(aafcli, "version");
version = aafcli.access.getProperty(Config.AAF_DEPLOYED_VERSION, Config.AAF_DEFAULT_API_VERSION);
}
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Delete.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Delete.java
index 3edc0e59..feffbdb0 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Delete.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/perm/Delete.java
@@ -60,10 +60,10 @@ public class Delete extends Cmd {
pk.setAction(args[idx++]);
if(pk.getType().contains("@")) { // User Perm deletion... Must remove from hidden role
- client.setQueryParams("force");
+ client.setQueryParams("force");
} else {
- // Set "Force" if set
- setQueryParamsOn(client);
+ // Set "Force" if set
+ setQueryParamsOn(client);
}
Future<PermRequest> fp = client.delete(
"/authz/perm",
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/List.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/List.java
index 2f84f583..d4d6c702 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/List.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/List.java
@@ -123,12 +123,12 @@ public class List extends BaseCmd<Role> {
pw().format(roleFormat, "["+ns+"]"+roleName.substring(ns.length()),XXXX_XX_XX);
}
} else {
- String fullname;
- if(ns==null) {
- fullname = roleName;
- } else {
- fullname = ns+'.'+roleName;
- }
+ String fullname;
+ if(ns==null) {
+ fullname = roleName;
+ } else {
+ fullname = ns+'.'+roleName;
+ }
UserRole ur = get(fullname,urs);
if (ur!=null && now.compare(ur.getExpires().normalize())>0) {
if (ns==null) {
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/ListByUser.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/ListByUser.java
index 2471c21a..8111fedc 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/ListByUser.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/role/ListByUser.java
@@ -77,8 +77,8 @@ public class ListByUser extends Cmd {
urs = fur.value;
code = fur.code();
} else {
- error(fur);
- return fur.code();
+ error(fur);
+ return fur.code();
}
if (aafcli.isDetailed()) {
@@ -88,37 +88,37 @@ public class ListByUser extends Cmd {
getDF(Perms.class)
);
if (fp.get(AAFcli.timeout())) {
- Map<String, Role> rs = new TreeMap<>();
+ Map<String, Role> rs = new TreeMap<>();
perms = fp.value;
for( Perm p : perms.getPerm()) {
- for(String sr : p.getRoles()) {
- Role r = rs.get(sr);
- if(r==null) {
- r = new Role();
- String[] split = Split.split('|', sr);
- if(split.length>1) {
- r.setNs(split[0]);
- r.setName(split[1]);
- } else {
- r.setName(sr);
- }
- rs.put(sr, r);
- roles.getRole().add(r);
- }
- r.getPerms().add(p);
- }
+ for(String sr : p.getRoles()) {
+ Role r = rs.get(sr);
+ if(r==null) {
+ r = new Role();
+ String[] split = Split.split('|', sr);
+ if(split.length>1) {
+ r.setNs(split[0]);
+ r.setName(split[1]);
+ } else {
+ r.setName(sr);
+ }
+ rs.put(sr, r);
+ roles.getRole().add(r);
+ }
+ r.getPerms().add(p);
+ }
}
}
code = fp.code();
} else {
- roles = new Roles();
- java.util.List<Role> lr = roles.getRole();
- Role r;
- for(UserRole ur : urs.getUserRole()) {
- r = new Role();
- r.setName(ur.getRole());
- lr.add(r);
- }
+ roles = new Roles();
+ java.util.List<Role> lr = roles.getRole();
+ Role r;
+ for(UserRole ur : urs.getUserRole()) {
+ r = new Role();
+ r.setName(ur.getRole());
+ lr.add(r);
+ }
}
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java
index d7431be1..1613b2f9 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Cred.java
@@ -44,7 +44,7 @@ public class Cred extends Cmd {
public static final String ATTEMPT_FAILED_SPECIFICS_WITHELD = "Attempt Failed. Specifics witheld.";
private static final String CRED_PATH = "/authn/cred";
private static final String[] options = {"add","del","reset","extend"/*,"clean"*/};
- private ErrMessage em;
+ private ErrMessage em;
public Cred(User parent) throws APIException {
super(parent,"cred",
new Param(optionsToString(options),true),
@@ -126,18 +126,18 @@ public class Cred extends Cmd {
} else if (fp.code()==202) {
pw().println("Credential Action Accepted, but requires Approvals before actualizing");
} else if (fp.code()==300 || fp.code()==406) {
- Error err = em.getError(fp);
- String text = err.getText();
- List<String> vars = err.getVariables();
-
- // IMPORTANT! We do this backward, because it is looking for string
- // %1 or %13. If we replace %1 first, that messes up %13
- for(int i=vars.size()-1;i>0;--i) {
- text = text.replace("%"+(i+1), (i<10?" ":"") + i+") " + vars.get(i));
- }
+ Error err = em.getError(fp);
+ String text = err.getText();
+ List<String> vars = err.getVariables();
+
+ // IMPORTANT! We do this backward, because it is looking for string
+ // %1 or %13. If we replace %1 first, that messes up %13
+ for(int i=vars.size()-1;i>0;--i) {
+ text = text.replace("%"+(i+1), (i<10?" ":"") + i+") " + vars.get(i));
+ }
- text = text.replace("%1",vars.get(0));
- pw().println(text);
+ text = text.replace("%1",vars.get(0));
+ pw().println(text);
} else if (fp.code()==406 && option==1) {
pw().println("You cannot delete this Credential");
} else if (fp.code()==409 && option==0) {
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java
index 444a82ab..212df8ab 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/List.java
@@ -64,9 +64,9 @@ public class List extends BaseCmd<User> {
String tag=user.getTag();
Integer type = user.getType();
if(tag==null) {
- tag="";
+ tag="";
} else if(type!=null && type>=200) {
- tag = "\n\tfingerprint: " + tag;
+ tag = "\n\tfingerprint: " + tag;
}
pw().format(format,
user.getId(),
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListForPermission.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListForPermission.java
index 5df11617..dff3dc5e 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListForPermission.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/ListForPermission.java
@@ -69,7 +69,7 @@ public class ListForPermission extends Cmd {
);
if (fp.get(AAFcli.timeout())) {
if (aafcli.isTest())
- Collections.sort(fp.value.getUser(), (Comparator<User>) (u1, u2) -> u1.getId().compareTo(u2.getId()));
+ Collections.sort(fp.value.getUser(), (Comparator<User>) (u1, u2) -> u1.getId().compareTo(u2.getId()));
((org.onap.aaf.auth.cmd.user.List)parent).report(fp.value,false,HEADER,type+"|"+instance+"|"+action);
if (fp.code()==404)return 200;
} else {
diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Role.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Role.java
index 4787cabc..b177778e 100644
--- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Role.java
+++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/user/Role.java
@@ -44,7 +44,7 @@ public class Role extends Cmd {
private static final String[] options = {"add", "del", "extend"};
public Role(User parent) {
super(parent, "role", new Param(optionsToString(options), true), new Param("user", true),
- new Param("role[,role]*", false));
+ new Param("role[,role]*", false));
}
@Override