Documentation ¶
Index ¶
- type RegistryAuthProvider
- func (r *RegistryAuthProvider) AddCredential(address, username, secret string) error
- func (r *RegistryAuthProvider) Credentials(ctx context.Context, req *bkauth.CredentialsRequest) (*bkauth.CredentialsResponse, error)
- func (r *RegistryAuthProvider) Register(server *grpc.Server)
- func (r *RegistryAuthProvider) RemoveCredential(address string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RegistryAuthProvider ¶
type RegistryAuthProvider struct { bkauth.UnimplementedAuthServer // contains filtered or unexported fields }
RegistryAuthProvider is a custom auth provider for image's registry authentication from dynamic user provided secrets. Adapted from: https://github.com/dagger/dagger/blob/v0.2.36/solver/registryauth.go and merge with Buildkit DockerAuthProvider from https://github.com/moby/buildkit/blob/master/session/auth/authprovider/authprovider.go#L42
RegistryAuthProvider implements session.Attachable to be used by Buildkit as credential provider. It also implements auth.AuthServer to merge dockerAuthProvider capabilities with in memory storage.
func NewRegistryAuthProvider ¶
func NewRegistryAuthProvider() *RegistryAuthProvider
NewRegistryAuthProvider initializes a new store.
func (*RegistryAuthProvider) AddCredential ¶
func (r *RegistryAuthProvider) AddCredential(address, username, secret string) error
AddCredential inserts a new credential for the corresponding address. Returns an error if the address does not match the standard registry address: {registry_domain}.{extension}.
func (*RegistryAuthProvider) Credentials ¶
func (r *RegistryAuthProvider) Credentials(ctx context.Context, req *bkauth.CredentialsRequest) (*bkauth.CredentialsResponse, error)
Credentials retrieves credentials of the requested address. It searches in the memory map for the standardize address.
If the address isn't registered in the memory map, it will search on DockerAuthProvider.
func (*RegistryAuthProvider) Register ¶
func (r *RegistryAuthProvider) Register(server *grpc.Server)
func (*RegistryAuthProvider) RemoveCredential ¶
func (r *RegistryAuthProvider) RemoveCredential(address string) error
RemoveCredential suppress the credential bind to the given address. Nothing happens if the address has no credential.