Documentation ¶
Index ¶
- func ValidHost(host string) bool
- type Client
- func (c *Client) Login(ctx context.Context, autoLogin bool, image string, ref name.Reference) (authn.Authenticator, error)
- func (c *Client) LoginWithExpiry(ctx context.Context, autoLogin bool, image string, ref name.Reference) (authn.Authenticator, time.Time, error)
- func (c *Client) OIDCLogin(ctx context.Context, registryUrl string) (authn.Authenticator, error)deprecated
- func (c *Client) WithScheme(scheme string) *Client
- func (c *Client) WithTokenCredential(tc azcore.TokenCredential) *Client
- type FakeTokenCredential
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidHost ¶
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 (*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) LoginWithExpiry ¶ added in v0.38.0
func (c *Client) LoginWithExpiry(ctx context.Context, autoLogin bool, image string, ref name.Reference) (authn.Authenticator, time.Time, error)
LoginWithExpiry attempts to get the authentication material for ACR. It returns the authentication material and the expiry time of the token. The caller can ensure that the passed image is a valid ACR image using ValidHost().
func (*Client) OIDCLogin
deprecated
added in
v0.27.0
OIDCLogin attempts to get an Authenticator for the provided ACR registry URL endpoint.
If you want to construct an Authenticator based on an image reference, you may want to use Login instead.
Deprecated: Use LoginWithExpiry instead.
func (*Client) WithScheme ¶
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 ¶
func (*FakeTokenCredential) GetToken ¶
func (tc *FakeTokenCredential) GetToken(ctx context.Context, options policy.TokenRequestOptions) (azcore.AccessToken, error)