You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, you cannot install private plugins/apps from GitHub repositories that use fine-grained tokens - only classic tokens are supported. This limits users who have moved to GitHub's recommended fine-grained token authentication system.
Describe the solution you'd like
Changing or adding support for the Authorization header format in the download_plugin_archive function to:
This matches GitHub's current API requirements for fine-grained token authentication.
You can test yourself by mounting up "./posthog/posthog/plugins:/code/posthog/plugins" under volumes, and swapping out the old code at the top of download_plugin_archive with:
defdownload_plugin_archive(url: str, tag: Optional[str] =None) ->bytes:
parsed_url=parse_url(url)
headers= {}
ifparsed_url["type"] =="github":
ifnot (tagorparsed_url.get("tag", None)):
raiseException("No GitHub tag given!")
# Ensure the token is included in the Authorization headertoken=parsed_url["private_token"] orsettings.GITHUB_TOKENiftoken:
headers= {"Authorization": "Bearer {}".format(token)}
else:
raiseException("Missing GitHub private token!")
# Construct the archive URLurl="https://api.github.com/repos/{user}/{repo}/zipball/{tag}".format(
user=parsed_url["user"],
repo=parsed_url["repo"],
tag=tagorparsed_url["tag"],
)
Would probably be a good idea to still support the old classic tokens, which I did not in the snippet above.
Describe alternatives you've considered
Continue using classic tokens (not recommended as GitHub is moving away from them)
Manually download and install plugins (cumbersome and defeats the purpose of the plugin system)
The text was updated successfully, but these errors were encountered:
Feature request
Is your feature request related to a problem?
Currently, you cannot install private plugins/apps from GitHub repositories that use fine-grained tokens - only classic tokens are supported. This limits users who have moved to GitHub's recommended fine-grained token authentication system.
Describe the solution you'd like
download_plugin_archive
function to:This matches GitHub's current API requirements for fine-grained token authentication.
You can test yourself by mounting up "./posthog/posthog/plugins:/code/posthog/plugins" under volumes, and swapping out the old code at the top of download_plugin_archive with:
Would probably be a good idea to still support the old classic tokens, which I did not in the snippet above.
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: