diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-09-20 16:34:10 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-11-14 14:38:13 +0530 |
commit | 1ecc057676a6ef788d5193261abd98bd364f10c0 (patch) | |
tree | 8b2df724a18ee189ccfef46467e88e3138595a68 /framework/src | |
parent | 92075994f7a2a399f2dced6fb207ebb4e717d8f0 (diff) |
Migrate onap-username and onap-password
onap-username and onap-password are migrated into
host-username and host-password respectively
Issue-Id: CLI-66
Change-Id: I4d658283523e75a2223dac9d0b839fdbc6ae2da3
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src')
12 files changed, 43 insertions, 43 deletions
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 29cdbce9..d90f000c 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 @@ -115,8 +115,8 @@ public class Constants { public static final String DEFAULT_PARAMETER_FILE_NAME = "default_input_parameters.yaml"; // Common parameters used across all commands. - public static final String DEAFULT_PARAMETER_USERNAME = "onap-username"; - public static final String DEAFULT_PARAMETER_PASS_WORD = "onap-password"; + public static final String DEAFULT_PARAMETER_USERNAME = "host-username"; + public static final String DEAFULT_PARAMETER_PASS_WORD = "host-password"; public static final String DEAFULT_PARAMETER_HOST_URL = "host-url"; public static final String DEFAULT_PARAMETER_HELP = "help"; public static final String DEFAULT_PARAMETER_VERSION = "version"; diff --git a/framework/src/main/resources/default_input_parameters.yaml b/framework/src/main/resources/default_input_parameters.yaml index c65f4d8d..7f06e2bd 100644 --- a/framework/src/main/resources/default_input_parameters.yaml +++ b/framework/src/main/resources/default_input_parameters.yaml @@ -1,18 +1,18 @@ open_cli_schema_version: 1.0 parameters: - - name: onap-username + - name: host-username type: string - description: Onap user name + description: Host user name short_option: u - long_option: onap-username - default_value: $s{env:ONAP_USERNAME} + long_option: host-username + default_value: $s{env:HOST_USERNAME} is_optional: false - - name: onap-password + - name: host-password type: string - description: Onap user password + description: Host user password short_option: p - long_option: onap-password - default_value: $s{env:ONAP_PASSWORD} + long_option: host-password + default_value: $s{env:HOST_PASSWORD} is_secured: true is_optional: false - name: host-url diff --git a/framework/src/main/resources/onap-cli-schema/schema-validate.yaml b/framework/src/main/resources/onap-cli-schema/schema-validate.yaml index 5eb29f0b..55e61e58 100644 --- a/framework/src/main/resources/onap-cli-schema/schema-validate.yaml +++ b/framework/src/main/resources/onap-cli-schema/schema-validate.yaml @@ -8,8 +8,8 @@ service: version: 1.0.0 default_parameters: exclude: - - onap-username - - onap-password + - host-username + - host-password - host-url - no-auth parameters: diff --git a/framework/src/main/resources/onap.properties b/framework/src/main/resources/onap.properties index a963b386..d73f1454 100644 --- a/framework/src/main/resources/onap.properties +++ b/framework/src/main/resources/onap.properties @@ -8,9 +8,9 @@ cli.api_gateway=msb cli.auth_service=auth # service section -cli.exclude_params_internal_cmd=onap-username,onap-password,host-url,no-auth -cli.no_auth_disable_include_params_external_cmd=onap-username,onap-password,host-url,no-auth -cli.no_auth_enable_exclude_params_external_cmd=onap-username,onap-password,no-auth +cli.exclude_params_internal_cmd=host-username,host-password,host-url,no-auth +cli.no_auth_disable_include_params_external_cmd=host-username,host-password,host-url,no-auth +cli.no_auth_enable_exclude_params_external_cmd=host-username,host-password,no-auth cli.no_auth_enable_include_params_external_cmd=host-url cli.http.basic.common_headers=x-auth-token,x-transaction-id,x-app-id @@ -23,7 +23,7 @@ cli.http.basic.common_headers.x-app-id.value=onap-cli # Service specific headers cli.http.basic.common_headers.sdc=user-id cli.http.basic.common_headers.sdc.user-id=USER_ID -cli.http.basic.common_headers.sdc.user-id.value=${onap-username} +cli.http.basic.common_headers.sdc.user-id.value=${host-username} #TODO mrkanag add support for aaf like defined above for basic #cli.service.auth=aaf diff --git a/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java b/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java index bfdb14a5..7552cacb 100644 --- a/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java +++ b/framework/src/test/java/org/onap/cli/fw/cmd/OnapHttpCommandTest.java @@ -31,12 +31,12 @@ public class OnapHttpCommandTest { @Test(expected = OnapCommandException.class) public void runTest() throws OnapCommandException { OnapCommandParameter param1 = new OnapCommandParameter(); - param1.setLongOption("onap-username"); - param1.setName("onap-username"); + param1.setLongOption("host-username"); + param1.setName("host-username"); param1.setParameterType(ParameterType.STRING); OnapCommandParameter param2 = new OnapCommandParameter(); - param2.setLongOption("onap-password"); - param2.setName("onap-password"); + param2.setLongOption("host-password"); + param2.setName("host-password"); param2.setParameterType(ParameterType.STRING); OnapCommandParameter param3 = new OnapCommandParameter(); param3.setLongOption("host-url"); diff --git a/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java b/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java index 89c32c99..2355d668 100644 --- a/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java +++ b/framework/src/test/java/org/onap/cli/fw/cmd/OnapSchemaValidateCommandTest.java @@ -28,9 +28,9 @@ public class OnapSchemaValidateCommandTest { OnapSchemaValidateCommand cmd = new OnapSchemaValidateCommand(); cmd.initializeSchema("schema-validate.yaml"); for (OnapCommandParameter param : cmd.getParameters()) { - if ("onap-username".equals(param.getName())) { + if ("host-username".equals(param.getName())) { param.setValue("test"); - } else if ("onap-password".equals(param.getName())) { + } else if ("host-password".equals(param.getName())) { param.setValue("test"); } else if ("host-url".equals(param.getName())) { param.setValue("test-url"); @@ -48,9 +48,9 @@ public class OnapSchemaValidateCommandTest { OnapSchemaValidateCommand cmd = new OnapSchemaValidateCommand(); cmd.initializeSchema("schema-validate.yaml"); for (OnapCommandParameter param : cmd.getParameters()) { - if ("onap-username".equals(param.getName())) { + if ("host-username".equals(param.getName())) { param.setValue("test"); - } else if ("onap-password".equals(param.getName())) { + } else if ("host-password".equals(param.getName())) { param.setValue("test"); } else if ("host-url".equals(param.getName())) { param.setValue("test-url"); diff --git a/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java b/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java index 20ca10f7..b0590791 100644 --- a/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java +++ b/framework/src/test/java/org/onap/cli/fw/defaultParameter/TestDefaultParameterSection.java @@ -41,8 +41,8 @@ public class TestDefaultParameterSection { OnapCommandUtils.loadSchema(cmd, "sample-test-include-param.yaml", true, false); List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList()); - assertTrue(parameters.contains("onap-username")); - assertTrue(parameters.contains("onap-password")); + assertTrue(parameters.contains("host-username")); + assertTrue(parameters.contains("host-password")); assertTrue(parameters.contains("host-url")); } @@ -55,8 +55,8 @@ public class TestDefaultParameterSection { OnapCommandUtils.loadSchema(cmd, "sample-test-exclude-param.yaml", true, false); List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList()); - assertTrue(parameters.contains("onap-username")); - assertTrue(parameters.contains("onap-password")); + assertTrue(parameters.contains("host-username")); + assertTrue(parameters.contains("host-password")); assertTrue(parameters.contains("host-url")); assertFalse(parameters.contains("long")); assertFalse(parameters.contains("format")); @@ -73,8 +73,8 @@ public class TestDefaultParameterSection { OnapCommandUtils.loadSchema(cmd, "sample-test-include-exclude.yaml", true, false); List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList()); - assertTrue(parameters.contains("onap-username")); - assertTrue(parameters.contains("onap-password")); + assertTrue(parameters.contains("host-username")); + assertTrue(parameters.contains("host-password")); assertTrue(parameters.contains("host-url")); } @@ -88,8 +88,8 @@ public class TestDefaultParameterSection { OnapCommandUtils.loadSchema(cmd, "onap-test-schema.yaml", true, false); List<String> parameters = cmd.getParameters().stream().map(p -> p.getName()).collect(Collectors.toList()); - assertFalse(parameters.contains("onap-username")); - assertFalse(parameters.contains("onap-password")); + assertFalse(parameters.contains("host-username")); + assertFalse(parameters.contains("host-password")); assertTrue(parameters.contains("host-url")); assertTrue(parameters.contains("debug")); assertTrue(parameters.contains("long")); diff --git a/framework/src/test/resources/sample-cmd-test-help.txt b/framework/src/test/resources/sample-cmd-test-help.txt index 074e833e..3d3d2415 100644 --- a/framework/src/test/resources/sample-cmd-test-help.txt +++ b/framework/src/test/resources/sample-cmd-test-help.txt @@ -5,7 +5,7 @@ Onap sample command to test the command features Onap service: sample v1 Options: -[-u | --onap-username] [-p | --onap-password] [-m | --host-url] +[-u | --host-username] [-p | --host-password] [-m | --host-url] [-h | --help] [-v | --version] [-d | --debug] [-f | --format] [-s | --long] [-t | --no-title] [-a | --no-auth] [-b | --bool] [-x | --secure] @@ -13,12 +13,12 @@ Options: [-l | --long-opt] [-r | --url] [-z | --env] <positional-args> where, --u | --onap-username Onap user name. It is of type STRING. By +-u | --host-username Onap user name. It is of type STRING. By default, it is read from environment variable - ONAP_USERNAME. --p | --onap-password Onap user password. It is of type STRING. By + HOST_USERNAME. +-p | --host-password Onap user password. It is of type STRING. By default, it is read from environment variable - ONAP_PASSWORD. Secured. + HOST_PASSWORD. Secured. -m | --host-url Onap MSB url. It is of type URL. By default, it is read from environment variable ONAP_MSB_URL. -h | --help Onap command help message. It is of type STRING. diff --git a/framework/src/test/resources/sample-test-include-exclude.yaml b/framework/src/test/resources/sample-test-include-exclude.yaml index 77d3211c..3568372b 100644 --- a/framework/src/test/resources/sample-test-include-exclude.yaml +++ b/framework/src/test/resources/sample-test-include-exclude.yaml @@ -1,8 +1,8 @@ open_cli_schema_version: 1.0 default_parameters: include: - - onap-username - - onap-password + - host-username + - host-password - host-url - no-auth exclude: diff --git a/framework/src/test/resources/sample-test-include-param.yaml b/framework/src/test/resources/sample-test-include-param.yaml index 18097129..38e5149e 100644 --- a/framework/src/test/resources/sample-test-include-param.yaml +++ b/framework/src/test/resources/sample-test-include-param.yaml @@ -1,6 +1,6 @@ open_cli_schema_version: 1.0 default_parameters: include: - - onap-username - - onap-password + - host-username + - host-password - no-auth diff --git a/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml b/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml index 1a42b8d4..c1584116 100644 --- a/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml +++ b/framework/src/test/resources/sample-test-invalid-exclude-noauth.yaml @@ -1,4 +1,4 @@ open_cli_schema_version: 1.0 default_parameters: exclude: - - onap-username
\ No newline at end of file + - host-username
\ No newline at end of file diff --git a/framework/src/test/resources/sample-test-invalid-include-noauth.yaml b/framework/src/test/resources/sample-test-invalid-include-noauth.yaml index 2d53ab11..1dda3b96 100644 --- a/framework/src/test/resources/sample-test-invalid-include-noauth.yaml +++ b/framework/src/test/resources/sample-test-invalid-include-noauth.yaml @@ -3,4 +3,4 @@ service: auth: none default_parameters: include: - - onap-username
\ No newline at end of file + - host-username
\ No newline at end of file |