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

Expose pure uncached validation function #126

Merged
merged 2 commits into from
Dec 22, 2021

Conversation

infinisil
Copy link
Contributor

This is useful when we want to do validation without requiring IO

This is useful when we want to do validation without requiring IO
It was only used for not evaluating later errors if there's already an error
and `checkExhaustive` is `False`. We can easily just use `m ~ Identity`,
but at that point we might as well inline it, which this commit does.
@infinisil
Copy link
Contributor Author

Warning: The most recent force push fixes a problem that prevented certificates from being checked. A test case should be added to ensure this can't happen.

infinisil added a commit to tweag/webauthn that referenced this pull request Dec 15, 2021
This commit changes the getPayload function to be jwtToJson instead, and
making that function be pure by allowing the date of verification to be
passed in manually.

However, this date needs to be used by not only the JWT library, but also by
the x509-validation library. Unfortunately the current version of
x509-validation on hackage always gets the current time from IO. So
instead we're using a fork of x509-validation which has support for
doing this purely, the PR for the change is
haskell-tls/hs-certificate#126. Notably this pure
function is also needed to have a pure version of attestation
verification, which is going to be done in the future.
infinisil added a commit to tweag/webauthn that referenced this pull request Dec 17, 2021
This commit changes the getPayload function to be jwtToJson instead, and
making that function be pure by allowing the date of verification to be
passed in manually.

However, this date needs to be used by not only the JWT library, but also by
the x509-validation library. Unfortunately the current version of
x509-validation on hackage always gets the current time from IO. So
instead we're using a fork of x509-validation which has support for
doing this purely, the PR for the change is
haskell-tls/hs-certificate#126. Notably this pure
function is also needed to have a pure version of attestation
verification, which is going to be done in the future.
infinisil added a commit to tweag/webauthn that referenced this pull request Dec 17, 2021
This commit changes the getPayload function to be jwtToJson instead, and
making that function be pure by allowing the date of verification to be
passed in manually.

However, this date needs to be used by not only the JWT library, but also by
the x509-validation library. Unfortunately the current version of
x509-validation on hackage always gets the current time from IO. So
instead we're using a fork of x509-validation which has support for
doing this purely, the PR for the change is
haskell-tls/hs-certificate#126. Notably this pure
function is also needed to have a pure version of attestation
verification, which is going to be done in the future.
@vincenthz vincenthz merged commit 824cca5 into haskell-tls:master Dec 22, 2021
@vincenthz
Copy link
Collaborator

Thanks, not sure the removal of the Monad m is useful but also can't remember if there was a real reason to add it

@infinisil
Copy link
Contributor Author

Thanks a lot! Could you also create a new Hackage release from master?

@infinisil infinisil deleted the pure-validation branch December 22, 2021 12:41
@infinisil infinisil restored the pure-validation branch December 22, 2021 14:49
infinisil added a commit to tweag/webauthn that referenced this pull request Jan 12, 2022
The 'validatePure' function is part of upstream
x509-certificate in master after <haskell-tls/hs-certificate#126>,
but no new version has yet been released
[on hackage](https://hackage.haskell.org/package/x509-validation).

In order to be able to release this webauthn library onto hackage we're
temporarily inlining its implementation here.
infinisil added a commit to tweag/webauthn that referenced this pull request Jan 13, 2022
The 'validatePure' function is part of upstream
x509-certificate in master after <haskell-tls/hs-certificate#126>,
but no new version has yet been released
[on hackage](https://hackage.haskell.org/package/x509-validation).

In order to be able to release this webauthn library onto hackage we're
temporarily inlining its implementation here.
infinisil added a commit to tweag/webauthn that referenced this pull request Jan 13, 2022
The 'validatePure' function is part of upstream
x509-certificate in master after <haskell-tls/hs-certificate#126>,
but no new version has yet been released
[on hackage](https://hackage.haskell.org/package/x509-validation).

In order to be able to release this webauthn library onto hackage we're
temporarily inlining its implementation here.
@infinisil infinisil deleted the pure-validation branch January 18, 2022 12:23
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