Documentation ¶
Index ¶
- Constants
- 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) (authn.Authenticator, error)deprecated
- func (c *Client) WithTokenSource(ts oauth2.TokenSource) *Client
- type Option
Constants ¶
View Source
const GCP_TOKEN_URL = "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token"
GCP_TOKEN_URL is the default GCP metadata endpoint used for authentication.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a GCP GCR 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 GCR. The caller can ensure that the passed image is a valid GCR image using ValidHost().
func (*Client) LoginWithExpiry ¶
func (c *Client) LoginWithExpiry(ctx context.Context, autoLogin bool, image string, ref name.Reference) (authn.Authenticator, time.Time, error)
Login attempts to get the authentication material for GCR. It returns the authentication material and the expiry time of the token. The caller can ensure that the passed image is a valid GCR image using ValidHost().
func (*Client) WithTokenSource ¶ added in v0.41.6
func (c *Client) WithTokenSource(ts oauth2.TokenSource) *Client
WithTokenSource sets a custom token source for the client.
Click to show internal directories.
Click to hide internal directories.