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

allow multiple credential helpers for a single site #22933

Closed
peakschris opened this issue Jul 1, 2024 · 4 comments
Closed

allow multiple credential helpers for a single site #22933

peakschris opened this issue Jul 1, 2024 · 4 comments
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request untriaged

Comments

@peakschris
Copy link

Description of the feature request:

I have two different sets of credentials for two different subdirectories of a site:

my.site.com/sub1 <- credentials A
my.site.com/sub2 <- credentials B

the credential helper works great for specifying one set of credentials, but is specified not to consider the subdirectory in the scope.

I would like to be able to do this:

common --credential_helper=my.site.com/sub1=sub1_credentials.bat
common --credential_helper=my.site.com/sub2=sub2_credentials.bat

But I get:

ERROR: While parsing option --credential_helper=my.site.com/sub1=sub1_credentials.bat: Credential helper scope 'my.site.com/sub1' must be a valid domain name with an optional leading '*.' wildcard

Which category does this issue belong to?

Configurability

What underlying problem are you trying to solve with this feature?

Connecting to websites such as github, typically different tokens can be assigned for different subdirectories on the main site.

Which operating system are you running Bazel on?

windows

What is the output of bazel info release?

bazel 7.2.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Jul 1, 2024
@peakschris
Copy link
Author

@Yannic this may interest you

@peakschris
Copy link
Author

Another option would be to follow docker's protocol, https://github.com/docker/docker-credential-helpers?tab=readme-ov-file#development; the URL is supplied to the credential helper, which can then return the appropriate auth.

@tjgq
Copy link
Contributor

tjgq commented Jul 1, 2024

the URL is supplied to the credential helper, which can then return the appropriate auth

This is already the case. The standard input to a credential helper is a JSON object with a uri key.

@peakschris
Copy link
Author

I missed this, thank you.
For others: this is documented here: https://github.com/bazelbuild/proposals/blob/main/designs/2022-06-07-bazel-credential-helpers.md

@iancha1992 iancha1992 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions type: feature request untriaged
Projects
None yet
Development

No branches or pull requests

5 participants