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

don't convert all oauth token verification errors to resource_unavailable #1389

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

pennae
Copy link
Contributor

@pennae pennae commented Aug 27, 2022

Description

we have a Result<VerifyOutput, BlockingError<TokenserverError>> here. mapping all BlockingError::Error values to resource_unavailable causes 503 response for expired oauth tokens, which breaks sync from firefox. we previously returned the wrapped error unaltered (only turning a JoinError into resource_unavailable), so go back to that.

Testing

reliably: use 0.12.1 with an expired or revoked oauth token and observe that sync does not work and does not recover. apply patch and see it recover.

Issue(s)

none.

…able

we have a `Result<VerifyOutput, BlockingError<TokenserverError>>` here. mapping all BlockingError::Error values to resource_unavailable causes 503 response for expired oauth tokens, which breaks sync from firefox. we previously returned the wrapped error unaltered (only turning a JoinError into resource_unavailable), so go back to that.
Copy link
Contributor

@ethowitz ethowitz left a comment

Choose a reason for hiding this comment

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

@pennae Really great catch. This would not affect our production deployment, since we cache FxA's public key there, but it would absolutely affect anybody self-hosting a Sync backend. I dug into why Tokenserver's end-to-end tests didn't catch this, and it's because we only run the e2e tests with a Tokenserver that has a cached JWK. I will open a separate PR to add an additional run of the e2e tests where Tokenserver does not have a cached JWK.

We really appreciate your contribution!

@ethowitz ethowitz merged commit ebdd609 into mozilla-services:master Aug 30, 2022
@pennae
Copy link
Contributor Author

pennae commented Aug 30, 2022

yup, that's exactly how we found it. thought our homegrown accounts server had broken an expectation again at first, but some digging eventually led us to here. 😅

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.

None yet

2 participants