8000 [#171467326] Fix minimum level and Response-issuer-format validation by BurnedMarshal · Pull Request #18 · pagopa/io-spid-commons · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[#171467326] Fix minimum level and Response-issuer-format validation #18

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 1 commit into from
Feb 27, 2020

Conversation

BurnedMarshal
Copy link
Contributor

No description provided.

() => right(_),
_1 =>
fromPredicate(
FormatValue => !FormatValue || FormatValue === ISSUER_FORMAT,
Copy link
Contributor

Choose a reason for hiding this comment

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

this test pass if FormatValue is an empty string (!"" === true), I guess that we should compare it with undefined / null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but for some reason, if the Format attribute is missing the method getAttribute returns an empty string instead of null.
Into the SPID Validator rules the are only two tests for Format attribute of Issuer into the Response element, which are missing Format and Invalid Format, so the preValidate works as expected into the tests.

AuthnContextClassRef.textContent ===
requestAuthnContextClassRef
);
return requestAuthnContextClassRef ===
Copy link
Contributor

Choose a reason for hiding this comment

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

since it looks like we are forcing a comparison for "minimum" here we should hardcode
optionsRACComparison = "minimum" into the strategy instead of accepting it as an option

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forcing RACComparison = "minimum" imho will be less transparent and limits the library use context. We can instead extend the preValidator to support all possible comparison method (exact, minimum, maximum, better). Anyway, this code inside the preValidate never will throw an error with all the possible RACComparison's option provided (maybe only with maximum if the Response use RAC lower than the Request).

@gunzip gunzip merged commit 2cb75e4 into master Feb 27, 2020
@gunzip gunzip deleted the 171467326-validator-fixes branch February 27, 2020 08:25
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.

2 participants
0