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

Tolerate fine-grained GitHub tokens #11

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

rtyley
Copy link
Owner

@rtyley rtyley commented Jan 22, 2025

As Michael Barton reported with #10, switching from classic GitHub tokens to fine-grained tokens crashes Prout, because the play-git-hub library expected HTTP response headers to detail OAuth scopes (X-OAuth-Scopes & X-Accepted-OAuth-Scopes) - but those aren't returned in GitHub API responses for fine-grained tokens.

The change in this commit is a small alteration from Michael's PR - rather than returning a RequestScopes object containing empty Sets of scopes, it just makes the RequestScopes field optional within ResponseMeta.

As Michael Barton reported with #10,
switching from _classic_ GitHub tokens to fine-grained tokens crashes Prout,
because the play-git-hub expected HTTP response headers to detail OAuth scopes
(`X-OAuth-Scopes` & `X-Accepted-OAuth-Scopes`) - but those aren't returned in
GitHub API responses for fine-grained tokens.

The change in this commit is a small alteration from Michael's PR - rather than
returning a `RequestScopes` object containing empty Sets of scopes, it just makes
the `RequestScopes` field optional within `ResponseMeta`.
@rtyley rtyley marked this pull request as ready for review January 22, 2025 23:20
@rtyley rtyley merged commit b939f65 into main Jan 22, 2025
1 check passed
@rtyley rtyley deleted the tolerate-fine-grained-github-tokens branch January 22, 2025 23:20
rtyley added a commit to guardian/prout that referenced this pull request Jan 23, 2025
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.

1 participant