Skip to content

Conversation

@jonathansick
Copy link
Member

This fixes GitHubAppClientFactory.create_app_client. I mistakenly though that the oauth_token attribute on the GitHubAPI constructor could be used to cache the app's JWT. It turns out that the JWT is treated entirely separately, and currently can't be cached in GitHubAPI. Instead, the JWT needs to be passed to each request method. This commit achieves the desired behaviour by patching the Gidgethub GitHubAPI methods to always set the jwt keyword argument.

This fixes GitHubAppClientFactory.create_app_client. I mistakenly though
that the oauth_token attribute on the GitHubAPI constructor could be
used to cache the app's JWT. It turns out that the JWT is treated
entirely separately, and currently can't be cached in GitHubAPI.
Instead, the JWT needs to be passed to each request method. This commit
achieves the desired behaviour by patching the Gidgethub GitHubAPI
methods to always set the jwt keyword argument.
Rather than monkeypatch GitHubAPI to cache the JWT, it's type-safer to
create a new class with new methods that work with app authentication
and cached JWTs.
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