auth

package
v0.11.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL