aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/main/java
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-26 20:42:28 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-11-14 14:39:05 +0530
commitabf5898650417a9726c8eb8924b4b3aaebf54523 (patch)
tree56e698be5878ac96178628db24c88c1a3e0dc2d1 /framework/src/main/java
parent39f345954434553d10e0cea114e15e0521ec9471 (diff)
Fix auth plugin issues
Now OCLIP is enabled to be very generic platform. Issue-Id: CLI-66 Change-Id: Id431f2eca5e516ad3b070c2c80e4fcd2ba0b54b2 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/main/java')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/cmd/BasicAuthLoginCommand.java7
-rw-r--r--framework/src/main/java/org/onap/cli/fw/conf/Constants.java10
2 files changed, 10 insertions, 7 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/cmd/BasicAuthLoginCommand.java b/framework/src/main/java/org/onap/cli/fw/cmd/BasicAuthLoginCommand.java
index a7b7181f..df1892fb 100644
--- a/framework/src/main/java/org/onap/cli/fw/cmd/BasicAuthLoginCommand.java
+++ b/framework/src/main/java/org/onap/cli/fw/cmd/BasicAuthLoginCommand.java
@@ -22,6 +22,7 @@ import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.impl.auth.BasicScheme;
import org.onap.cli.fw.OnapCommand;
import org.onap.cli.fw.OnapCommandSchema;
+import org.onap.cli.fw.conf.Constants;
import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cli.fw.input.OnapCommandParameter;
@@ -33,9 +34,9 @@ public class BasicAuthLoginCommand extends OnapCommand {
//get the input arguments
Map<String, OnapCommandParameter> paramMap = getParametersMap();
- OnapCommandParameter usernameParam = paramMap.get("username");
+ OnapCommandParameter usernameParam = paramMap.get(Constants.DEAFULT_PARAMETER_USERNAME);
String username = usernameParam.getValue().toString();
- OnapCommandParameter usernamePassword = paramMap.get("password");
+ OnapCommandParameter usernamePassword = paramMap.get(Constants.DEAFULT_PARAMETER_PASS_WORD);
String password = usernamePassword.getValue().toString();
//Execute the command to get token
@@ -43,6 +44,6 @@ public class BasicAuthLoginCommand extends OnapCommand {
username, password), "UTF-8", false).getValue();
//Fill out the result part
- this.getResult().getRecordsMap().get("Authorization").getValues().add(authToken);
+ this.getResult().getRecordsMap().get(Constants.AUTH_SERVICE_AUTHORIZATION).getValues().add(authToken);
}
}
diff --git a/framework/src/main/java/org/onap/cli/fw/conf/Constants.java b/framework/src/main/java/org/onap/cli/fw/conf/Constants.java
index 5ae3c502..a1ade420 100644
--- a/framework/src/main/java/org/onap/cli/fw/conf/Constants.java
+++ b/framework/src/main/java/org/onap/cli/fw/conf/Constants.java
@@ -197,14 +197,16 @@ public class Constants {
public static final String SPL_ENTRY_UUID = "uuid";
public static final String SPL_ENTRY_ENV = "env:";
+ public static final String AUTH_SERVICE_AUTHORIZATION = "Authorization";
+
public static final String CATALOG_SERVICE_NAME = "catalog-service-name";
-
+
public static final String CATALOG_SERVICE_VERSION = "catalog-service-version";
-
+
public static final String CATALOG_SERVICE_BASE_PATH = "catalog-service-base-path";
-
+
public static final String CATALOG_SERVICE_HOST_URL = "catalog-service-host-url";
-
+
private Constants() {
}