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 function to explicitly request a certain provider #1837

Merged
merged 1 commit into from May 4, 2022

Conversation

priyawadhwa
Copy link
Contributor

I'm trying to use this library in Chains to request a token via SPIRE, but it keeps defaulting to google GKE credentials (which just happens to come first in the list via providers.Provide). With this function, I can explicitly call out spiffe as the desired provider.

Signed-off-by: Priya Wadhwa priya@chainguard.dev

Summary

Ticket Link

Fixes

Release Note


@priyawadhwa priyawadhwa requested a review from mattmoor May 4, 2022 17:17
Comment on lines 87 to 88
// ExplicitProvide fetches an OIDC token from the specified provider
func ExplicitProvide(ctx context.Context, audience, provider string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe something like ProvideFrom(ctx, provider) that returns the Provider?

Copy link
Member

Choose a reason for hiding this comment

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

This would let folks look it up and check enabled themselves, which could be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, updated!

Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
@priyawadhwa priyawadhwa merged commit c6ca9a2 into sigstore:main May 4, 2022
@priyawadhwa priyawadhwa deleted the provider branch May 4, 2022 18:10
@github-actions github-actions bot added this to the v1.9.0 milestone May 4, 2022
mlieberman85 pushed a commit to mlieberman85/cosign that referenced this pull request May 6, 2022
Signed-off-by: Priya Wadhwa <priya@chainguard.dev>
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.

None yet

2 participants