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

(PF-2437) Prepend 'Bearer' string to authorization #89

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

caseywilliams
Copy link
Contributor

@caseywilliams caseywilliams commented Aug 20, 2021

Authorized requests to the Forge require an authorization header of
"Bearer <api-key>". This changes the connection process so that if a
user has set PuppetForge::Connection.authorization to something that
looks like a Forge API key (a 64-character hex string), it automatically
prepends the "Bearer " string. This will not take effect if the user
has already prepended "Bearer " themselves, or if the authorization
value doesn't fit the expected key format.

Also updates the README with basic information on authorization.

@caseywilliams caseywilliams requested a review from a team as a code owner August 20, 2021 21:11
Authorized requests to the Forge require an authorization header of
"Bearer <api-key>". This changes the connection process so that if a
user has set `PuppetForge::Connection.authorization` to something that
looks like a Forge API key (a 64-character hex string), it automatically
prepends the "Bearer " string. This will not take effect if the user
has already prepended "Bearer " themselves, or if the authorization
value doesn't fit the expected key format.

Also updates the README with basic information on authorization.
@caseywilliams
Copy link
Contributor Author

(Force-pushed to update the commit message)

Copy link
Contributor

@nkanderson nkanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@caseywilliams caseywilliams merged commit 97e4f44 into puppetlabs:main Aug 20, 2021
@caseywilliams caseywilliams deleted the PF-2437/prepend-bearer branch August 20, 2021 21:29
@binford2k
Copy link
Member

@caseywilliams
Copy link
Contributor Author

If a user has already prepended Bearer , nothing will happen - their string will be left alone

@caseywilliams
Copy link
Contributor Author

caseywilliams commented Aug 23, 2021

Also @binford2k, fwiw, you would have had to prepend Bearer to a forge auth token (in additon to an artifactory token, as that doc mentions) before this commit, so that wording could probably use an update either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants