-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(nodo): CHK-1930 add apy-key for auth nodo ws #328
base: main
Are you sure you want to change the base?
Changes from 4 commits
462824c
1e9005b
80ab550
1e973f1
d9a0afe
141089a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
AFM_CONNECTION_TIMEOUT=10000;AFM_KEY=key;AFM_READ_TIMEOUT=10000;AFM_URI=http://pagopa-gec-mock:3000/afm/node/calculator-service/v1/fees;CLOSURE_RETRY_INTERVAL=30;ECOMMERCE_PAYMENT_INSTRUMENTS_CONNECTION_TIMEOUT=10000;ECOMMERCE_PAYMENT_INSTRUMENTS_READ_TIMEOUT=10000;ECOMMERCE_PAYMENT_INSTRUMENTS_URI=http://pagopa-ecommerce-payment-methods-service:8083;ECOMMERCE_PAYMENT_METHODS_APY_KEY=payment-methods-key;ECOMMERCE_PAYMENT_METHODS_CONNECTION_TIMEOUT=600;ECOMMERCE_PAYMENT_METHODS_READ_TIMEOUT=600;ECOMMERCE_PAYMENT_METHODS_URI=http://localhost:3000;ECOMMERCE_STORAGE_TRANSIENT_CONNECTION_STRING=DefaultEndpointsProtocol=http\;AccountName=devstoreaccount1\;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==\;QueueEndpoint=http://storage:10001/devstoreaccount1;JWT_SECRET=ODMzNUZBNTZENDg3NTYyREUyNDhGNDdCRUZDNzI3NDMzMzQwNTFEREZGQ0MyQzA5Mjc1RjY2NTQ1NDk5MDMxNzU5NDc0NUVFMTdDMDhGNzk4Q0Q3RENFMEJBODE1NURDREExNEY2Mzk4QzFEMTU0NTExNjUyMEExMzMwMTdDMDk;JWT_TOKEN_VALIDITY_TIME_MILLIS=600000;LOGO_CARD_BRANDING_MAPPING={VISA:'https://dev.checkout.pagopa.it/assets/creditcard/carta_visa.png',MASTERCARD:'https://dev.checkout.pagopa.it/assets/creditcard/carta_mc.png',DINERS:'https://dev.checkout.pagopa.it/assets/creditcard/carta_diners.png',MAESTRO:'https://dev.checkout.pagopa.it/assets/creditcard/carta_maestro.png',AMEX:'https://dev.checkout.pagopa.it/assets/creditcard/carta_amex.png',UNKNOWN:'https://dev.checkout.pagopa.it/assets/creditcard/generic.png'};MONGO_HOST=pagopa-ecommerce-mongo;MONGO_PASSWORD=password;MONGO_PORT=27017;MONGO_USERNAME=admin;NODE_FOR_PSP_URI=/webservices/pof/PagamentiTelematiciPspNodoservice;NODO_CONNECTION_STRING={"idPSP":"idPsp","idChannel":"idChannel","idBrokerPSP":"12345678912","password":"password"};NODO_CONNECTION_TIMEOUT=10000;NODO_HOSTNAME=http://pagopa-node-mock:3002;NODO_PARALLEL_REQUESTS=5;NODO_READ_TIMEOUT=10000;NODOPERPM_CONNECTION_TIMEOUT=10000;NODOPERPM_READ_TIMEOUT=10000;NODOPERPM_URI=/nodo/nodo-per-pm/v1/informazioniPagamento;NOTIFICATIONS_SERVICE_API_KEY=api-key;NOTIFICATIONS_SERVICE_CONNECTION_TIMEOUT=10000;NOTIFICATIONS_SERVICE_READ_TIMEOUT=10000;NOTIFICATIONS_SERVICE_URI=http://pagopa-ecommerce-traefik/notifications-service;PAYMENT_TOKEN_VALIDITY_TIME=120;PAYMENT_TRANSACTIONS_GATEWAY_API_KEY=key;PAYMENT_TRANSACTIONS_GATEWAY_CONNECTION_TIMEOUT=10000;PAYMENT_TRANSACTIONS_GATEWAY_READ_TIMEOUT=10000;PAYMENT_TRANSACTIONS_GATEWAY_URI=http://pagopa-ecommerce-traefik/transactions-gateway;PERSONAL_DATA_VAULT_API_BASE_PATH=http://pagopa-pdv-mock:8092;PERSONAL_DATA_VAULT_API_KEY=personal-data-vault-api-key;QueueEndpoint=http://storage:10001/devstoreaccount1;REDIS_HOST=pagopa-ecommerce-redis;REDIS_PASSWORD=redis_password;REDIS_PORT=6379;REDIS_SSL_ENABLED=false;TRANSACTION_CLOSE_PAYMENT_QUEUE_NAME=pagopa-ecommerce-transactions-close-payment-queue;TRANSACTION_CLOSE_PAYMENT_RETRY_QUEUE_NAME=pagopa-ecommerce-transactions-close-payment-retry-queue;TRANSACTION_EXPIRATION_QUEUE_NAME=pagopa-ecommerce-transactions-expiration-queue;TRANSACTION_NOTIFICATIONS_QUEUE_NAME=pagopa-ecommerce-transactions-notifications-queue;TRANSACTION_REFUND_QUEUE_NAME=pagopa-ecommerce-transactions-refund-queue;TRANSACTIONS_RETRY_OFFSET=60;NODO_ALL_CCP_ON_TRANSFER_IBAN_ENABLED=false | ||
AFM_CONNECTION_TIMEOUT=10000;AFM_KEY=key;AFM_READ_TIMEOUT=10000;AFM_URI=http://pagopa-gec-mock:3000/afm/node/calculator-service/v1/fees;CLOSURE_RETRY_INTERVAL=30;ECOMMERCE_PAYMENT_INSTRUMENTS_CONNECTION_TIMEOUT=10000;ECOMMERCE_PAYMENT_INSTRUMENTS_READ_TIMEOUT=10000;ECOMMERCE_PAYMENT_INSTRUMENTS_URI=http://pagopa-ecommerce-payment-methods-service:8083;ECOMMERCE_PAYMENT_METHODS_APY_KEY=payment-methods-key;ECOMMERCE_PAYMENT_METHODS_CONNECTION_TIMEOUT=600;ECOMMERCE_PAYMENT_METHODS_READ_TIMEOUT=600;ECOMMERCE_PAYMENT_METHODS_URI=http://localhost:3000;ECOMMERCE_STORAGE_TRANSIENT_CONNECTION_STRING=DefaultEndpointsProtocol=http\;AccountName=devstoreaccount1\;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==\;QueueEndpoint=http://storage:10001/devstoreaccount1;JWT_SECRET=ODMzNUZBNTZENDg3NTYyREUyNDhGNDdCRUZDNzI3NDMzMzQwNTFEREZGQ0MyQzA5Mjc1RjY2NTQ1NDk5MDMxNzU5NDc0NUVFMTdDMDhGNzk4Q0Q3RENFMEJBODE1NURDREExNEY2Mzk4QzFEMTU0NTExNjUyMEExMzMwMTdDMDk;JWT_TOKEN_VALIDITY_TIME_MILLIS=600000;LOGO_CARD_BRANDING_MAPPING={VISA:'https://dev.checkout.pagopa.it/assets/creditcard/carta_visa.png',MASTERCARD:'https://dev.checkout.pagopa.it/assets/creditcard/carta_mc.png',DINERS:'https://dev.checkout.pagopa.it/assets/creditcard/carta_diners.png',MAESTRO:'https://dev.checkout.pagopa.it/assets/creditcard/carta_maestro.png',AMEX:'https://dev.checkout.pagopa.it/assets/creditcard/carta_amex.png',UNKNOWN:'https://dev.checkout.pagopa.it/assets/creditcard/generic.png'};MONGO_HOST=pagopa-ecommerce-mongo;MONGO_PASSWORD=password;MONGO_PORT=27017;MONGO_USERNAME=admin;NODE_FOR_PSP_URI=/webservices/pof/PagamentiTelematiciPspNodoservice;NODO_CONNECTION_STRING={"idPSP":"idPsp","idChannel":"idChannel","idBrokerPSP":"12345678912","password":"password"};NODO_CONNECTION_TIMEOUT=10000;NODO_HOSTNAME=http://pagopa-node-mock:3002;NODO_PARALLEL_REQUESTS=5;NODO_READ_TIMEOUT=10000;NODO_NODEFORPSP_API_KEY=KEY;NODO_CLOSEPAYMENT_API_KEY=KEY;NODOPERPM_CONNECTION_TIMEOUT=10000;NODOPERPM_READ_TIMEOUT=10000;NODOPERPM_URI=/nodo/nodo-per-pm/v1/informazioniPagamento;NOTIFICATIONS_SERVICE_API_KEY=api-key;NOTIFICATIONS_SERVICE_CONNECTION_TIMEOUT=10000;NOTIFICATIONS_SERVICE_READ_TIMEOUT=10000;NOTIFICATIONS_SERVICE_URI=http://pagopa-ecommerce-traefik/notifications-service;PAYMENT_TOKEN_VALIDITY_TIME=120;PAYMENT_TRANSACTIONS_GATEWAY_API_KEY=key;PAYMENT_TRANSACTIONS_GATEWAY_CONNECTION_TIMEOUT=10000;PAYMENT_TRANSACTIONS_GATEWAY_READ_TIMEOUT=10000;PAYMENT_TRANSACTIONS_GATEWAY_URI=http://pagopa-ecommerce-traefik/transactions-gateway;PERSONAL_DATA_VAULT_API_BASE_PATH=http://pagopa-pdv-mock:8092;PERSONAL_DATA_VAULT_API_KEY=personal-data-vault-api-key;QueueEndpoint=http://storage:10001/devstoreaccount1;REDIS_HOST=pagopa-ecommerce-redis;REDIS_PASSWORD=redis_password;REDIS_PORT=6379;REDIS_SSL_ENABLED=false;TRANSACTION_CLOSE_PAYMENT_QUEUE_NAME=pagopa-ecommerce-transactions-close-payment-queue;TRANSACTION_CLOSE_PAYMENT_RETRY_QUEUE_NAME=pagopa-ecommerce-transactions-close-payment-retry-queue;TRANSACTION_EXPIRATION_QUEUE_NAME=pagopa-ecommerce-transactions-expiration-queue;TRANSACTION_NOTIFICATIONS_QUEUE_NAME=pagopa-ecommerce-transactions-notifications-queue;TRANSACTION_REFUND_QUEUE_NAME=pagopa-ecommerce-transactions-refund-queue;TRANSACTIONS_RETRY_OFFSET=60;NODO_ALL_CCP_ON_TRANSFER_IBAN_ENABLED=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,12 @@ public class NodeForPspClient { | |
@Value("${nodo.nodeforpsp.uri}") | ||
private String nodoPerPspUri; | ||
|
||
@Value("${nodo.nodeforpsp.apikey}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe here we can refactor this class to use constructor injection? what do you think? this way we can avoid reflection to set those api key into test class There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right, but better to do it in a dedicated PR |
||
private String nodoPerPspApiKey; | ||
|
||
@Value("${nodo.closepayment.apikey}") | ||
private String nodoClosePaymentApiKey; | ||
|
||
public Mono<ActivatePaymentNoticeV2Response> activatePaymentNoticeV2( | ||
JAXBElement<ActivatePaymentNoticeV2Request> request | ||
) { | ||
|
@@ -41,6 +47,7 @@ public Mono<ActivatePaymentNoticeV2Response> activatePaymentNoticeV2( | |
.uri(nodoPerPspUri) | ||
.header("Content-Type", MediaType.TEXT_XML_VALUE) | ||
.header("SOAPAction", "activatePaymentNoticeV2") | ||
.header("ocp-apim-subscription-key", nodoPerPspApiKey) | ||
.body(Mono.just(new SoapEnvelope("", request)), SoapEnvelope.class) | ||
.retrieve() | ||
.onStatus( | ||
|
@@ -81,10 +88,11 @@ public Mono<ClosePaymentResponseDto> closePaymentV2(ClosePaymentRequestV2Dto req | |
); | ||
return nodoWebClient.post() | ||
.uri( | ||
uriBuilder -> uriBuilder.path("/nodo/nodo-per-pm/v2/closepayment") | ||
uriBuilder -> uriBuilder.path("/nodo-auth/nodo-per-pm/v2/closepayment") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would parameterized (maybe in another PR) this path in order to change it's value upgrading helm instead of modifying code. What do you think? |
||
.queryParam("clientId", CLOSE_PAYMENT_CLIENT_ID).build() | ||
) | ||
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) | ||
.header("ocp-apim-subscription-key", nodoClosePaymentApiKey) | ||
.body(Mono.just(request), ClosePaymentRequestV2Dto.class) | ||
.retrieve() | ||
.onStatus( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
NODO_NODEFORPSP_API_KEY
andNODO_CLOSEPAYMENT_API_KEY
env secrets?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed