8000 [#IOCIT-118] make prevalidate errors more readable by arcogabbo · Pull Request #119 · pagopa/io-spid-commons · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[#IOCIT-118] make prevalidate errors more readable #119

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

Merged
merged 3 commits into

Conversation

arcogabbo
Copy link
Contributor

List of Changes

  • refactored the prevalidate method to generate more readable errors, including requestId and idpIssuer fields

Motivation and Context

when debugging a login issue, it can be useful to have more data to better understand the problem

How Has This Been Tested?

build and test passed

Screenshots (if appropriate):

Types of changes

  • Chore (nothing changes by a user perspective)
  • 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.

@pagopa-github-bot
Copy link
Contributor
pagopa-github-bot commented Sep 23, 2022
Warnings
⚠️ Please include a Pivotal story at the beginning of the PR title (see below).

Example of PR titles that include pivotal stories:

  • single story: [#123456] my PR title
  • multiple stories: [#123456,#123457,#123458] my PR title

Generated by 🚫 dangerJS against b6d1608

@arcogabbo arcogabbo force-pushed the IOCIT-118-readable-prevalidate-errors branch from 0be029a to 76ca1f1 Compare September 23, 2022 08:31
Copy link
Contributor
@balanza balanza left a comment

Choose a reason for hiding this comment

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

Implementation looks fine to me. I'd be more explicit about:

  1. the kind of data we are loggi 10000 ng to help privacy team to audit our code
  2. the queries we expect to do on logs once we have such data - and the ones we don't want to be able to do

Both can be achieved by commenting out the code imho

@@ -81,72 +134,70 @@ export const getPreValidateResponse = (
"Response"
);

const maybeIdpIssuer = getSamlIssuer(doc);

const hasStrictValidation = pipe(
O.fromNullable(strictValidationOptions),
O.chain(_ =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Please give _ a meaningful name, or @michaeldisaro gets mad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you think about validationOptions for that parameter?

Choose a reason for hiding this comment

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

I'm sure that it was @BurnedMarshal fault that _. 🤣

Choose a reason for hiding this comment

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

@arcogabbo that's a good name! And _[issuer] becomes validationOptions[issuer] that's a lot more readable and meaningful!

@@ -81,72 +134,70 @@ export const getPreValidateResponse = (
"Response"
);

const maybeIdpIssuer = getSamlIssuer(doc);

const hasStrictValidation = pipe(
O.fromNullable(strictValidationOptions),
O.chain(_ =>

Choose a reason for hiding this comment

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

I'm sure that it was @BurnedMarshal fault that _. 🤣

@@ -81,72 +134,70 @@ export const getPreValidateResponse = (
"Response"
);

const maybeIdpIssuer = getSamlIssuer(doc);

const hasStrictValidation = pipe(
O.fromNullable(strictValidationOptions),
O.chain(_ =>

Choose a reason for hiding this comment

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

@arcogabbo that's a good name! And _[issuer] becomes validationOptions[issuer] that's a lot more readable and meaningful!

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
0.0% 0.0% Duplication

@arcogabbo arcogabbo mentioned this pull request Sep 30, 2022
6 tasks
Copy link
@michaeldisaro michaeldisaro left a comment

Choose a reason for hiding this comment

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

LGTM

@arcogabbo arcogabbo merged commit 7718b2e into master Sep 30, 2022
@arcogabbo arcogabbo deleted the IOCIT-118-readable-prevalidate-errors branch September 30, 2022 13:53
Copy link
Contributor
@BurnedMarshal BurnedMarshal left a comment

Choose a reason for hiding this comment

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

This suggestion can be applied if needed to the next PR

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

Successfully merging this pull request may close these issues.

5 participants
0