diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-26 20:42:28 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-11-14 14:39:05 +0530 |
commit | abf5898650417a9726c8eb8924b4b3aaebf54523 (patch) | |
tree | 56e698be5878ac96178628db24c88c1a3e0dc2d1 /framework/src/main | |
parent | 39f345954434553d10e0cea114e15e0521ec9471 (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')
4 files changed, 17 insertions, 8 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() { } diff --git a/framework/src/main/resources/open-cli-schema/basic-login.yaml b/framework/src/main/resources/open-cli-schema/basic-login.yaml index 78294fc5..a7f3b6ed 100644 --- a/framework/src/main/resources/open-cli-schema/basic-login.yaml +++ b/framework/src/main/resources/open-cli-schema/basic-login.yaml @@ -1,13 +1,18 @@ open_cli_schema_version: 1.0 + name: basic-login + description: basic login auth command + version: cli-1.0 + type: auth service: name: open-cli version: 1.0.0 - + mode: direct + results: direction: portrait attributes: diff --git a/framework/src/main/resources/open-cli-schema/basic-logout.yaml b/framework/src/main/resources/open-cli-schema/basic-logout.yaml index 2c0e3dbd..80255dd5 100644 --- a/framework/src/main/resources/open-cli-schema/basic-logout.yaml +++ b/framework/src/main/resources/open-cli-schema/basic-logout.yaml @@ -11,3 +11,4 @@ type: auth service: name: open-cli version: 1.0.0 + mode: direct
\ No newline at end of file |