diff --git a/.github/workflows/deploy_with_github_runner.yml b/.github/workflows/deploy_with_github_runner.yml index 106d56c..5eec356 100644 --- a/.github/workflows/deploy_with_github_runner.yml +++ b/.github/workflows/deploy_with_github_runner.yml @@ -41,7 +41,7 @@ jobs: container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }} resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner pat_token: ${{ secrets.BOT_TOKEN_GITHUB }} - + self_hosted_runner_image_tag: "latest" deploy: needs: [ create_runner ] runs-on: [ self-hosted, "${{ needs.create_runner.outputs.runner_name }}" ] diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 55198a6..f44eded 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pagopa-shared-platform-authorizer description: Microservice handling authorization caching for the Authorizer system type: application -version: 0.110.0 -appVersion: 0.2.8 +version: 0.111.0 +appVersion: 0.2.7-2-PAGOPA-2066 dependencies: - name: microservice-chart version: 2.8.0 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index a710cb8..747419b 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-platform-authorizer - tag: "0.2.8" + tag: "0.2.7-2-PAGOPA-2066" pullPolicy: Always # https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs livenessProbe: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 4b61229..71fedd7 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-platform-authorizer - tag: "0.2.8" + tag: "0.2.7-2-PAGOPA-2066" pullPolicy: Always # https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs livenessProbe: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index bbd4fe2..41891ec 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -4,7 +4,7 @@ microservice-chart: fullnameOverride: "" image: repository: ghcr.io/pagopa/pagopa-platform-authorizer - tag: "0.2.8" + tag: "0.2.7-2-PAGOPA-2066" pullPolicy: Always # https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Controllers/HostController.cs livenessProbe: diff --git a/openapi/openapi.json b/openapi/openapi.json index f7ce201..64caddf 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.1", "info": { "title": "OpenAPI definition - Enrolled EC", - "version": "0.2.8" + "version": "0.2.7-2-PAGOPA-2066" }, "servers": [ { diff --git a/pom.xml b/pom.xml index bc5d097..31e3f95 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ it.gov.pagopa.authorizer platform-authorizer - 0.2.8 + 0.2.7-2-PAGOPA-2066 jar Azure Authorizer cache Fn diff --git a/src/main/java/it/gov/pagopa/authorizer/util/Utility.java b/src/main/java/it/gov/pagopa/authorizer/util/Utility.java index b35aaa3..939c11b 100644 --- a/src/main/java/it/gov/pagopa/authorizer/util/Utility.java +++ b/src/main/java/it/gov/pagopa/authorizer/util/Utility.java @@ -43,6 +43,7 @@ public static String extractMetadataAsString(@NonNull List metadata) { List content = singleMetadata.getContent(); if (content.size() == 1) { GenericPair metadataPair = content.get(0); + builder.append(metadataPair.getKey()).append(":"); builder.append(getMetadataValueAsString(metadataPair)); } else { Iterator it = content.iterator(); diff --git a/src/test/java/it/gov/pagopa/authorizer/service/CacheServiceTest.java b/src/test/java/it/gov/pagopa/authorizer/service/CacheServiceTest.java index 74ef1de..e7172c6 100644 --- a/src/test/java/it/gov/pagopa/authorizer/service/CacheServiceTest.java +++ b/src/test/java/it/gov/pagopa/authorizer/service/CacheServiceTest.java @@ -45,15 +45,15 @@ class CacheServiceTest { @SneakyThrows @ParameterizedTest @CsvSource(delimiterString = "/", value = { - "0/{\"key\":\"domain_1\",\"value\":\"entity1#entity2#entity3\",\"metadata\":\"_o=pagoPA;;\"}", - "1/{\"key\":\"domain_1\",\"value\":\"entity1#entity2|sub-entity\",\"metadata\":\"_o=pagoPA;;\"}", + "0/{\"key\":\"domain_1\",\"value\":\"entity1#entity2#entity3\",\"metadata\":\"_o=not-visible-key:pagoPA;;\"}", + "1/{\"key\":\"domain_1\",\"value\":\"entity1#entity2|sub-entity\",\"metadata\":\"_o=not-visible-key:pagoPA;;\"}", "3/{\"key\":\"domain_1\",\"value\":\"entity1#entity2#entity3\",\"metadata\":\"\"}" }) void addAuthConfigurationToAPIMAuthorizer_OK(int id, String subkeyDomainAsString) { // Mocking passed values SubscriptionKeyDomain subkeyDomain = getSubscriptionKeyDomains().get(id); - //String subkeyDomainAsString = "{\"key\":\"domain_1\",\"value\":\"entity1#entity2#entity3\",\"metadata\":\"_o=pagoPA;;\"}"; + //String subkeyDomainAsString = "{\"key\":\"domain_1\",\"value\":\"entity1#entity2#entity3\",\"metadata\":\"_o=not-visible-key:pagoPA;;\"}"; MockHttpResponse mockedHttpResponse = MockHttpResponse.builder().statusCode(200).uri(new URI("")).build(); // Mocking execution for service's internal component @@ -76,7 +76,7 @@ void addAuthConfigurationToAPIMAuthorizer_OK_noAuthorizationEntities() { // Mocking passed values SubscriptionKeyDomain subkeyDomain = getSubscriptionKeyDomains().get(0); subkeyDomain.setAuthorizedEntities(List.of()); - String subkeyDomainAsString = "{\"key\":\"domain_1\",\"value\":\"\",\"metadata\":\"_o=pagoPA;;\"}"; + String subkeyDomainAsString = "{\"key\":\"domain_1\",\"value\":\"\",\"metadata\":\"_o=not-visible-key:pagoPA;;\"}"; MockHttpResponse mockedHttpResponse = MockHttpResponse.builder().statusCode(200).uri(new URI("")).build(); // Mocking execution for service's internal component @@ -98,7 +98,7 @@ void addAuthConfigurationToAPIMAuthorizer_KO_communicationError() { // Mocking passed values SubscriptionKeyDomain subkeyDomain = getSubscriptionKeyDomains().get(0); - String subkeyDomainAsString = "{\"key\":\"domain_1\",\"value\":\"entity1#entity2#entity3\",\"metadata\":\"_o=pagoPA;;\"}"; + String subkeyDomainAsString = "{\"key\":\"domain_1\",\"value\":\"entity1#entity2#entity3\",\"metadata\":\"_o=not-visible-key:pagoPA;;\"}"; // Mocking execution for service's internal component HttpClient realHttpClient = spy(HttpClient.newHttpClient()); diff --git a/src/test/java/it/gov/pagopa/authorizer/util/UtilityTest.java b/src/test/java/it/gov/pagopa/authorizer/util/UtilityTest.java index ec55de6..8b47971 100644 --- a/src/test/java/it/gov/pagopa/authorizer/util/UtilityTest.java +++ b/src/test/java/it/gov/pagopa/authorizer/util/UtilityTest.java @@ -64,7 +64,7 @@ void convertListToString_KO_nullParameter() { @Test void extractMetadataAsString_OK() { - String expectedResult = "_md1=single-value;;_md2=value1,value2;;_md3=multiple-object-1:single-value;multiple-object-2:value1,value2;;"; + String expectedResult = "_md1=single-object:single-value;;_md2=single-object-with-multiple-values:value1,value2;;_md3=multiple-object-1:single-value;multiple-object-2:value1,value2;;"; String result = Utility.extractMetadataAsString(getMetadataList()); assertEquals(expectedResult, result); }