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

Introduce more granular interface into credentials package #873

Open
Wwwsylvia opened this issue Jan 16, 2025 · 0 comments
Open

Introduce more granular interface into credentials package #873

Wwwsylvia opened this issue Jan 16, 2025 · 0 comments
Labels
v3 Things belongs to version 3.x
Milestone

Comments

@Wwwsylvia
Copy link
Member

Currently we pass the credentials.Store interface as the input of the registry.Credential() function, but this is not the best implementation. Ideally we should pass a more granular interface that provides the Get() method.

Since changing the function signature is considered breaking, we will leave it to v3.

// Credential returns a Credential() function that can be used by auth.Client.
func Credential(store Store) auth.CredentialFunc {
return func(ctx context.Context, hostport string) (auth.Credential, error) {
hostport = ServerAddressFromHostname(hostport)
if hostport == "" {
return auth.EmptyCredential, nil
}
return store.Get(ctx, hostport)
}
}

@Wwwsylvia Wwwsylvia added the v3 Things belongs to version 3.x label Jan 16, 2025
@Wwwsylvia Wwwsylvia added this to the future milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 Things belongs to version 3.x
Projects
None yet
Development

No branches or pull requests

1 participant