-
Notifications
You must be signed in to change notification settings - Fork 42
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
Support custom Authorization header #889
Comments
Specific proposal, add a
|
The fast-path would be to expand on the setup here https://github.com/pulp/pulp-cli/blob/main/pulp-glue/pulp_glue/common/openapi.py#L105 I think |
This is meant for the cli to be used with a special authentication mechanism? In what kind of a process do you expect this variable to be persisted? You are not trying to use the cli as library for scripting, are you? |
Yes it's for a different auth mechanism. It's a
I imagined a bash variable so we'd be scripting using bash. |
I was afraid of that. Can't you script using pulp-glue directly? I believe that would be better suited.
Tons thereof: |
Thanks for the examples. Where would one merge that subclass to I can't tell if we are saying to do things the same way or not. From a high level the usage would be like:
Help me understand if we're thinking similarly or not please. I can't tell. |
Glue uses requests. And we can easily pass any "auth" class requests can handle to glue. (There's a PR open that will bring that interface.) So when we want to use that auth mechanism, we need to "login" at a certain api to get the header token. Then we can use that until it's expired. So eventually, we will fail and a that point, we kind of need a way to "relogin" and retry. Or should we fail and abort any pending operation? |
Do you have a link to the PR? (would be #882 by any means?) |
This allows to pass arbitrary header values along with the requests. fixes pulp#889
This allows to pass arbitrary header values along with the requests. fixes pulp#889
This allows to pass arbitrary header values along with the requests. fixes pulp#889
This allows to pass arbitrary header values along with the requests. fixes #889
Summary
As a user I can submit a custom header auth token.
Background
There is an auth style used on console.redhat.com which involves using long-lived credentials to then fetch a hours-long credential that is a
Bearer
style token. ThatBearer
token would need to be used bypulp-cli
to access a Pulp install on console.redhat.comExamples
It would be great if somehow the CLI could be configured with a Bearer token to submit a header like:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
We'll wrap the CLI took with a script to do the fetching of this and save it in an environment variable. It would be great if we could just pass this header name and value (or just value?) to the CLI with each call. We want to avoid having to save it into a config file because we'll have to update that file every few hours then.
The text was updated successfully, but these errors were encountered: