Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into add-toPublish-and-fix…
Browse files Browse the repository at this point in the history
…-apim

# Conflicts:
#	src/main/java/it/gov/pagopa/spontaneouspayment/service/PaymentsService.java
svariant committed Dec 16, 2024
2 parents b0fc650 + 378d085 commit ee6f2cc
Showing 14 changed files with 70 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code_review.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ on:
workflow_dispatch:

env:
PROJECT_KEY: "pagopa-spontaneus-payments"
PROJECT_KEY: "pagopa-spontaneous-payments"

permissions:
id-token: write
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-spontaneous-payments
description: Microservice that handles spontaneous payments for pagoPA
type: application
version: 0.12.0
appVersion: 0.1.8
version: 0.14.0
appVersion: 0.1.10
dependencies:
- name: microservice-chart
version: 2.3.1
4 changes: 3 additions & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-spontaneous-payments
tag: "0.1.8" #improve
tag: "0.1.10" #improve
pullPolicy: Always
livenessProbe:
httpGet:
@@ -82,6 +82,8 @@ microservice-chart:
envSecret:
COSMOS_KEY: cosmos-gps-weu-d-pkey
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-d-connection-string'
API_KEY_IUV_GENERATOR: "apikey-iuv-generator"
API_KEY_EXTERNAL_SERVICE: "apikey-spontaneous-payments-services"
keyvault:
name: "pagopa-d-gps-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
4 changes: 3 additions & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-spontaneous-payments
tag: "0.1.8" #improve
tag: "0.1.10" #improve
pullPolicy: Always
livenessProbe:
httpGet:
@@ -82,6 +82,8 @@ microservice-chart:
envSecret:
COSMOS_KEY: cosmos-gps-weu-p-pkey
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-p-connection-string'
API_KEY_IUV_GENERATOR: "apikey-iuv-generator"
API_KEY_EXTERNAL_SERVICE: "apikey-spontaneous-payments-services"
keyvault:
name: "pagopa-p-gps-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
4 changes: 3 additions & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-spontaneous-payments
tag: "0.1.8" #improve
tag: "0.1.10" #improve
pullPolicy: Always
livenessProbe:
httpGet:
@@ -82,6 +82,8 @@ microservice-chart:
envSecret:
COSMOS_KEY: cosmos-gps-weu-u-pkey
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-u-connection-string'
API_KEY_IUV_GENERATOR: "apikey-iuv-generator"
API_KEY_EXTERNAL_SERVICE: "apikey-spontaneous-payments-services"
keyvault:
name: "pagopa-u-gps-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"title": "PagoPA API Spontaneous Payment",
"description": "Progetto Gestione Pagamenti Spontanei",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.1.8"
"version": "0.1.10"
},
"servers": [
{
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>spontaneouspayment</artifactId>
<version>0.1.8</version>
<version>0.1.10</version>
<name>Gestione Pagamenti Spontanei</name>
<description>Progetto Gestione Pagamenti Spontanei</description>

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package it.gov.pagopa.spontaneouspayment.config;

import feign.RequestInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

import static it.gov.pagopa.spontaneouspayment.utils.Constants.APIM_SUBSCRIPTION_KEY;

public class ExternalServiceConfig extends FeignConfig{
@Value("${authorization.external.services.subscription-key}")
private String externalServicesSubscriptionKey;

@Bean
public RequestInterceptor subscriptionKey() {
return requestTemplate -> requestTemplate.header(APIM_SUBSCRIPTION_KEY, externalServicesSubscriptionKey);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package it.gov.pagopa.spontaneouspayment.config;

import feign.RequestInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

import static it.gov.pagopa.spontaneouspayment.utils.Constants.APIM_SUBSCRIPTION_KEY;

public class IuvGeneratorConfig extends FeignConfig {

@Value("${authorization.iuv.generator.subscription-key}")
private String iuvGeneratorSubscriptionKey;

@Bean
public RequestInterceptor subscriptionKey() {
return requestTemplate -> requestTemplate.header(APIM_SUBSCRIPTION_KEY, iuvGeneratorSubscriptionKey);
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package it.gov.pagopa.spontaneouspayment.service.client;

import feign.FeignException;
import it.gov.pagopa.spontaneouspayment.config.FeignConfig;
import it.gov.pagopa.spontaneouspayment.config.ExternalServiceConfig;
import it.gov.pagopa.spontaneouspayment.model.response.PaymentOptionsModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
@@ -13,7 +13,7 @@
import java.net.URI;


@FeignClient(value = "externalservice", url = "runtime_url", configuration = FeignConfig.class)
@FeignClient(value = "externalservice", url = "runtime_url", configuration = ExternalServiceConfig.class)
public interface ExternalServiceClient {

@Retryable(exclude = FeignException.FeignClientException.class, maxAttemptsExpression = "${retry.ext-service.maxAttempts}",
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.gov.pagopa.spontaneouspayment.service.client;

import it.gov.pagopa.spontaneouspayment.config.IuvGeneratorConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.retry.annotation.Backoff;
import org.springframework.retry.annotation.Retryable;
@@ -8,12 +9,11 @@
import org.springframework.web.bind.annotation.RequestBody;

import feign.FeignException;
import it.gov.pagopa.spontaneouspayment.config.FeignConfig;
import it.gov.pagopa.spontaneouspayment.model.IuvGenerationModel;
import it.gov.pagopa.spontaneouspayment.model.response.IuvGenerationModelResponse;


@FeignClient(value = "iuvgenerator", url = "${service.iuv.generator.host}", configuration = FeignConfig.class)
@FeignClient(value = "iuvgenerator", url = "${service.iuv.generator.host}",configuration = IuvGeneratorConfig.class)
public interface IuvGeneratorClient {

@Retryable(exclude = FeignException.FeignClientException.class, maxAttemptsExpression = "${retry.iuv-generator.maxAttempts}",
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package it.gov.pagopa.spontaneouspayment.utils;

import lombok.experimental.UtilityClass;

@UtilityClass
public class Constants {

public static final String APIM_SUBSCRIPTION_KEY = "Ocp-Apim-Subscription-Key";
}
3 changes: 3 additions & 0 deletions src/main/resources/application-dev.properties
Original file line number Diff line number Diff line change
@@ -10,6 +10,9 @@ azure.cosmos.populate-query-metrics=false
azure.cosmos.ec-container-name=creditor_institutions
azure.cosmos.service-container-name=services

authorization.iuv.generator.subscription-key=${API_KEY_IUV_GENERATOR}
authorization.external.services.subscription-key=${API_KEY_EXTERNAL_SERVICE}

service.gpd.host=http://localhost:8085
service.iuv.generator.host=https://api.dev.platform.pagopa.it/shared/iuv-generator-service/v1
service.aux.digit=3
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -13,6 +13,10 @@ azure.cosmos.populate-query-metrics=${COSMOS_QUERY_METRICS}
azure.cosmos.ec-container-name=${EC_CONTAINER_NAME}
azure.cosmos.service-container-name=${SERVICE_CONTAINER_NAME}

# Authorization
authorization.iuv.generator.subscription-key=${API_KEY_IUV_GENERATOR}
authorization.external.services.subscription-key=${API_KEY_EXTERNAL_SERVICE}

# Service
service.gpd.host=${GPD_HOST}
service.iuv.generator.host=${IUV_GENERATOR_HOST}

0 comments on commit ee6f2cc

Please sign in to comment.