I guess I’m hoping if any of you are familiar with or have any past experience with this error of the GitHub plugin.
I was using this guide Generating an Installation Access Token for a GitHub App to manually go from the generated JWT to the access_token using the installation_ids… And that works, so I don’t know what’s going on with the plugin.
Hi @neat-kingfish, how are you referencing the private key in the spec?
Can you share the configuration spec without any private information?
I’m assuming you’ve also configured the correct URLs for enterprise_github?
I’m also assuming you’re following this guide to use the private key to create a JWT to later use to obtain the installation access token?
I use Jinja to swap in the values for organization, installation_id, and the ghes_url. In my code, I use the private key to generate the JWT like you linked in the aforementioned docs in order to produce the access token so that I can make a call to /api/v3/app/installations to generate all the installations, which lets me feed in the organization and installation_id to the Jinja template for that ${PRIVATE_KEY_PATH} variable.
I provision the same private key (which was used to generate the access token, to be absolutely pedantic) with the following code
The private key should be enough as the Go GitHub client should generate those tokens. I’m going over the GitHub Go client code to see if something pops up.
Ah ok, so at least some progress. The docs do say something about 406.
Let me take a look one sec.
OK, I think I know what might be the issue. I think we need to trim /api/v3/ from the base URL when passing to that module.
In the spec, the base URL is with /api/v3/, but the endpoint for generating the tokens is https://<host>/app/installations/<id>/access_tokens.
Sorry for the back and forth; I can’t really test this as we don’t have a GitHub Enterprise setup. https://github.com/cloudquery/cloudquery/pull/16834 should fix it. v8.0.2 is published with this fix.
oauth2: cannot fetch token: 406 Not Acceptable\nResponse: ",
got the same. I was afk earlier, but I think I can work with you via release candidates now that I have the login workflow. You can see how the public GitHub and enterprise have different URL paths in these two docs: