diff options
Diffstat (limited to 'certServiceClient')
5 files changed, 14 insertions, 14 deletions
diff --git a/certServiceClient/pom.xml b/certServiceClient/pom.xml index b1b2af92..799d9aac 100644 --- a/certServiceClient/pom.xml +++ b/certServiceClient/pom.xml @@ -18,12 +18,12 @@ <parent> <artifactId>oom-certservice</artifactId> <groupId>org.onap.oom.platform.cert-service</groupId> - <version>2.3.1-SNAPSHOT</version> + <version>2.3.2-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>oom-certservice-client</artifactId> - <version>2.3.1-SNAPSHOT</version> + <version>2.3.2-SNAPSHOT</version> <name>oom-certservice-client</name> <description>OOM Certification Service Api Client</description> <packaging>jar</packaging> diff --git a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java index f1541b04..2bd57f77 100644 --- a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java +++ b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/factory/ClientConfigurationFactory.java @@ -59,7 +59,7 @@ public class ClientConfigurationFactory implements ConfigurationFactory<ClientCo .orElseThrow(() -> new ClientConfigurationException(ClientConfigurationEnvs.OUTPUT_PATH + " is invalid.")); envsForClient.getCaName() - .filter(ClientEnvsValueValidators::isAlphaNumeric) + .filter(ClientEnvsValueValidators::isCaNameValid) .map(configuration::setCaName) .orElseThrow(() -> new ClientConfigurationException(ClientConfigurationEnvs.CA_NAME + " is invalid.")); diff --git a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidators.java b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidators.java index 503b7e46..86d1e0f0 100644 --- a/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidators.java +++ b/certServiceClient/src/main/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidators.java @@ -20,11 +20,11 @@ package org.onap.oom.certservice.client.configuration.validation.client; public final class ClientEnvsValueValidators { - private static final String ALPHA_NUMERIC_REGEX = "^[a-zA-Z0-9]*$"; + private static final String CA_NAME_REGEX = "^[a-zA-Z0-9_.~-]{1,128}$"; private static final String VALID_PATH_REGEX = "^/|(/[a-zA-Z0-9_-]+)+/?$"; - public static boolean isAlphaNumeric(String caName) { - return caName.matches(ALPHA_NUMERIC_REGEX); + public static boolean isCaNameValid(String caName) { + return caName.matches(CA_NAME_REGEX); } public static boolean isPathValid(String path) { diff --git a/certServiceClient/src/test/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidatorsTest.java b/certServiceClient/src/test/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidatorsTest.java index 9ed46c1a..d219873f 100644 --- a/certServiceClient/src/test/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidatorsTest.java +++ b/certServiceClient/src/test/java/org/onap/oom/certservice/client/configuration/validation/client/ClientEnvsValueValidatorsTest.java @@ -21,7 +21,7 @@ package org.onap.oom.certservice.client.configuration.validation.client; import static org.assertj.core.api.Assertions.assertThat; -import static org.onap.oom.certservice.client.configuration.validation.client.ClientEnvsValueValidators.isAlphaNumeric; +import static org.onap.oom.certservice.client.configuration.validation.client.ClientEnvsValueValidators.isCaNameValid; import static org.onap.oom.certservice.client.configuration.validation.client.ClientEnvsValueValidators.isPathValid; import org.junit.jupiter.params.ParameterizedTest; @@ -29,15 +29,15 @@ import org.junit.jupiter.params.provider.ValueSource; class ClientEnvsValueValidatorsTest { @ParameterizedTest - @ValueSource(strings = {"caname", "caname1", "123caName", "ca1name"}) - void shouldAcceptValidAlphanumeric(String caName) { - assertThat(isAlphaNumeric(caName)).isTrue(); + @ValueSource(strings = {"caname", "caname1", "123caName", "ca1name", "ca_name", "ca-name", "ca.na~me"}) + void shouldAcceptValidCaName(String caName) { + assertThat(isCaNameValid(caName)).isTrue(); } @ParameterizedTest - @ValueSource(strings = {"44caname$", "#caname1", "1c_aname", "ca1-name"}) - void shouldRejectInvalidAlphanumeric(String caName) { - assertThat(isAlphaNumeric(caName)).isFalse(); + @ValueSource(strings = {"44caname$", "#caname1", "1c[aname]", "ca1/name", "", " "}) + void shouldRejectInvalidCaName(String caName) { + assertThat(isCaNameValid(caName)).isFalse(); } @ParameterizedTest diff --git a/certServiceClient/version.properties b/certServiceClient/version.properties index f1c5779d..29a89d0c 100644 --- a/certServiceClient/version.properties +++ b/certServiceClient/version.properties @@ -1,6 +1,6 @@ major=2 minor=3 -patch=1 +patch=2 base_version=${major}.${minor}.${patch} release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT |