Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

infantesimone
Copy link
Contributor

@infantesimone infantesimone commented Sep 25, 2023

List of Changes

  • add api-key for nodo auth

Motivation and Context

The goal of this PR is to update nodo basepath in order to call node ws with api key:

  • Node for PSP WS (NM3) (AUTH)
  • Nodo per Payment Manager API (AUTH)

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@infantesimone infantesimone marked this pull request as ready for review September 27, 2023 12:19
@infantesimone infantesimone requested a review from a team as a code owner September 27, 2023 12:19
@infantesimone
Copy link
Contributor Author

infantesimone commented Sep 27, 2023

Depends pagopa/pagopa-ecommerce-local#98

@infantesimone infantesimone changed the title feat(nodo): add apy-key for auth nodo ws feat(nodo): CHK-1930 add apy-key for auth nodo ws Sep 27, 2023
@@ -76,7 +76,7 @@ microservice-chart:
REDIS_PORT: "6380"
REDIS_SSL_ENABLED: "true"
NODO_HOSTNAME: https://api.dev.platform.pagopa.it
NODE_FOR_PSP_URI: /nodo/node-for-psp/v1
NODE_FOR_PSP_URI: /nodo-auth/node-for-psp/v1
Copy link
Contributor

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 and NODO_CLOSEPAYMENT_API_KEY env secrets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -32,6 +32,12 @@ public class NodeForPspClient {
@Value("${nodo.nodeforpsp.uri}")
private String nodoPerPspUri;

@Value("${nodo.nodeforpsp.apikey}")
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, but better to do it in a dedicated PR

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 4, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

66.7% 66.7% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor

@pietro-tota pietro-tota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, just some trivial issue. 🚀

@pietro-tota
Copy link
Contributor

Please remember to make a PR for environments alignment against https://github.com/pagopa/pagopa-ecommerce-local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants