azure

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidHost

func ValidHost(host string) bool

ValidHost returns if a given host is a Azure container registry. List from https://github.com/kubernetes/kubernetes/blob/v1.23.1/pkg/credentialprovider/azure/azure_credentials.go#L55

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an Azure ACR client which can log into the registry and return authorization information.

func NewClient

func NewClient() *Client

NewClient creates a new ACR client with default configurations.

func (*Client) Login

func (c *Client) Login(ctx context.Context, autoLogin bool, image string, ref name.Reference) (authn.Authenticator, error)

Login attempts to get the authentication material for ACR. The caller can ensure that the passed image is a valid ACR image using ValidHost().

func (*Client) WithScheme

func (c *Client) WithScheme(scheme string) *Client

WithScheme sets the scheme of the http request that the client makes.

func (*Client) WithTokenCredential

func (c *Client) WithTokenCredential(tc azcore.TokenCredential) *Client

WithTokenCredential sets the token credential used by the ACR client.

type FakeTokenCredential

type FakeTokenCredential struct {
	Token     string
	ExpiresOn time.Time
	Err       error
}

func (*FakeTokenCredential) GetToken

Jump to

Keyboard shortcuts

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