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

Add support for specifying Packit tokens directly. #181

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

plietar
Copy link
Member

@plietar plietar commented Sep 20, 2024

As part of experimenting with new authentication methods for Packit, it is useful to be able to provide Packit tokens directly to orderly2. Until now, orderly2 would only accept GitHub tokens, and would perform a request to exchange it for a Packit token.

Thankfully, GitHub tokens have a well defined and documented prefix, of the form ghp_, gho_, ... The underscore makes sure it so that it never could never be confused with a JWT. Thanks to this, the distinction between Packit and GitHub tokens is unambiguous.

Eventually we may want to implement some of these authentication methods in orderly2 itself, but it the meantime this makes experimentation easier.

As part of experimenting with new authentication methods for Packit, it
is useful to be able to provide Packit tokens directly to orderly2.
Until now, orderly2 would only accept GitHub tokens, and would perform a
request to exchange it for a Packit token.

Thankfully, GitHub tokens have a [well defined and documented
prefix][ghblog], of the form `ghp_`, `gho_`, ... The underscore makes
sure it so that it never could never be confused with a JWT. Thanks to
this, the distinction between Packit and GitHub tokens is unambiguous.

Eventually we may want to implement some of these authentication methods
in orderly2 itself, but it the meantime this makes experimentation
easier.

[ghblog]: https://github.blog/engineering/platform-security/behind-githubs-new-authentication-token-formats/
@plietar
Copy link
Member Author

plietar commented Sep 20, 2024

For an example of this being used https://github.com/plietar/orderly-ci-test/blob/f1987986d5fceeaf7b4cceb9aacf2708ae776f0a/run.R

We'll probably want to export that code somewhere, either in orderly2 or in a reusable action.

@richfitz richfitz merged commit ebabe7f into main Sep 27, 2024
10 checks passed
@plietar plietar deleted the service-token branch September 27, 2024 14:10
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.

2 participants