I want to implement a factory for creating GitHubAPI clients for my GitHub Apps that are authenticated for different roles. Already Gidgethub makes it easy to create a GitHubAPI that includes the OAuth token for a GitHub App's installation in a repo or org so that client doesn't need the oauth_token info repeated for each request.
I was thinking about doing the equivalent for a GitHub App's authentication as an app, which uses the jwt computed by gidgethub.apps.get_jwt. Doing this would involve:
- Adding a
jwt to the GitHubAPI constructor and making sure oauth_token wasn't also passed in.
- Using the cached
jwt in the request methods
Does this feature sound reasonable? The caveat is that the jwt has a short lifespan; I'm not sure if we'd need provide a way refresh the jwt and what that should look like. Should the GitHubAPI instance actually cache the private key and app id??
If you're interested I'd be happy to put together a PR. Thanks!
I want to implement a factory for creating
GitHubAPIclients for my GitHub Apps that are authenticated for different roles. Already Gidgethub makes it easy to create aGitHubAPIthat includes the OAuth token for a GitHub App's installation in a repo or org so that client doesn't need theoauth_tokeninfo repeated for each request.I was thinking about doing the equivalent for a GitHub App's authentication as an app, which uses the
jwtcomputed bygidgethub.apps.get_jwt. Doing this would involve:jwtto theGitHubAPIconstructor and making sureoauth_tokenwasn't also passed in.jwtin the request methodsDoes this feature sound reasonable? The caveat is that the jwt has a short lifespan; I'm not sure if we'd need provide a way refresh the jwt and what that should look like. Should the GitHubAPI instance actually cache the private key and app id??
If you're interested I'd be happy to put together a PR. Thanks!