Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

feat: Poc requirements #1

Merged
merged 5 commits into from
May 17, 2023
Merged

feat: Poc requirements #1

merged 5 commits into from
May 17, 2023

Conversation

fabrizioacn
Copy link
Contributor

No description provided.

@fabrizioacn fabrizioacn requested a review from a team January 23, 2023 11:28
added postman collections
Copy link
Contributor

@antoniotarricone antoniotarricone left a comment

Choose a reason for hiding this comment

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

Risolvere i commenti riportati.

*/
@HeaderParam("id")
@NotNull(message = "[" + ErrorCode.SESSION_ID_MUST_NOT_BE_NULL + "] SessionId must not be null")
@Pattern(regexp = "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$", message = "[" + ErrorCode.SESSION_ID_MUST_MATCH_REGEXP + "] RequestId must match \"{regexp}\"")
Copy link
Contributor

Choose a reason for hiding this comment

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

Attenzione al messaggio: c'è scritto 'RequestId' ma lo header param si chiama 'id'.

* Session ID
*/
@HeaderParam("id")
@NotNull(message = "[" + ErrorCode.SESSION_ID_MUST_NOT_BE_NULL + "] SessionId must not be null")
Copy link
Contributor

Choose a reason for hiding this comment

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

Attenzione al messaggio: c'è scritto 'SessionId' ma lo header param si chiama 'id'.

public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("PmWalletCardsRequest [taxCode=");
builder.append(taxCode);
Copy link
Contributor

Choose a reason for hiding this comment

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

'taxCode' è un dato sensibile, metterlo nel toString comporta il suo logging accidentale: rimuoverlo o sostituirlo con ***.

builder.append("SessionResponse [outcome=");
builder.append(outcome);
builder.append(", taxCode=");
builder.append(taxCode);
Copy link
Contributor

Choose a reason for hiding this comment

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

'taxCode' è un dato sensibile, metterlo nel toString comporta il suo logging accidentale: rimuoverlo o sostituirlo con ***.

return sessionService.getSessionById(headers.getSessionId(), headers).onFailure()
.transform(f -> {
if (f instanceof ClientWebApplicationException c) {
Log.errorf(f, "[%s] Error while retrieving session. Http Status code [%s] " , ErrorCode.ERROR_SESSION_NOT_FOUND_SERVICE,c.getResponse().getStatus()) ;
Copy link
Contributor

Choose a reason for hiding this comment

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

ERROR_SESSION_NOT_FOUND_SERVICE -> SESSION_NOT_FOUND_ERROR

})
.chain (s -> {
if (Outcome.TERMS_AND_CONDITIONS_NOT_YET_ACCEPTED.toString().equals(s.getOutcome())) {
Log.errorf("[%s] The terms and conditions are not yet accepted ", ErrorCode.ERROR_TC_NOT_YET_ACCEPTED);
Copy link
Contributor

Choose a reason for hiding this comment

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

ERROR_TC_NOT_YET_ACCEPTED -> TC_NOT_YET_ACCEPTED_ERROR


} else {
if (Boolean.FALSE.equals(s.getSaveNewCards())) {
Log.errorf("[%s] Save cards is not active ", ErrorCode.ERROR_SAVE_CARD_NOT_ACTIVE);
Copy link
Contributor

Choose a reason for hiding this comment

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

ERROR_SAVE_CARD_NOT_ACTIVE -> SAVE_CARD_NOT_ACTIVE_ERROR

if (f.getStatus() != Status.NO_CONTENT.getStatusCode()) {
return Response
.status(Status.INTERNAL_SERVER_ERROR)
.entity(new Errors(List.of(ErrorCode.ERROR_GENERIC_CALLING_PM_WALLET_SERVICE)))
Copy link
Contributor

Choose a reason for hiding this comment

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

ERROR_GENERIC_CALLING_PM_WALLET_SERVICE -> GENERIC_ERROR_CALLING_PM_WALLET_SERVICE

obfuscated taxCode
fix message names
@fabrizioacn fabrizioacn changed the title feat: poc requirements feat: Poc requirements Mar 10, 2023
PSCF2-86 Migrazione package mil-wallet
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@antoniotarricone antoniotarricone merged commit 979d6a4 into main May 17, 2023
@antoniotarricone antoniotarricone deleted the feature/poc branch May 17, 2023 07:04
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants