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) FetchToken(ctx context.Context, req *bkauth.FetchTokenRequest) (*bkauth.FetchTokenResponse, error)
- func (r *RegistryAuthProvider) GetTokenAuthority(ctx context.Context, req *bkauth.GetTokenAuthorityRequest) (*bkauth.GetTokenAuthorityResponse, error)
- func (r *RegistryAuthProvider) Register(server *grpc.Server)
- func (r *RegistryAuthProvider) RemoveCredential(address string) error
- func (r *RegistryAuthProvider) VerifyTokenAuthority(ctx context.Context, req *bkauth.VerifyTokenAuthorityRequest) (*bkauth.VerifyTokenAuthorityResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RegistryAuthProvider ¶
type RegistryAuthProvider struct {
// contains filtered or unexported fields
}
RegistryAuthProvider is a custom auth provider for image's registry authentication from both Docker config AND dynamic user provided secret. 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(cfg *configfile.ConfigFile) *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) FetchToken ¶
func (r *RegistryAuthProvider) FetchToken(ctx context.Context, req *bkauth.FetchTokenRequest) (*bkauth.FetchTokenResponse, error)
func (*RegistryAuthProvider) GetTokenAuthority ¶
func (r *RegistryAuthProvider) GetTokenAuthority(ctx context.Context, req *bkauth.GetTokenAuthorityRequest) (*bkauth.GetTokenAuthorityResponse, error)
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.
func (*RegistryAuthProvider) VerifyTokenAuthority ¶
func (r *RegistryAuthProvider) VerifyTokenAuthority(ctx context.Context, req *bkauth.VerifyTokenAuthorityRequest) (*bkauth.VerifyTokenAuthorityResponse, error)