aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/main')
-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
-rw-r--r--framework/src/main/resources/open-cli-schema/basic-login.yaml7
-rw-r--r--framework/src/main/resources/open-cli-schema/basic-logout.yaml1
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