Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidTenantID is returned when an invalid Tenant ID is provided. ErrInvalidTenantID = errors.New("invalid tenant ID") // ErrInvalidClientID is returned when an invalid Client ID is provided. ErrInvalidClientID = errors.New("invalid client ID") )
var ( // ErrEmptyTokenResponse is returned when the response from a token request // is empty. ErrEmptyTokenResponse = errors.New("empty token response") // ErrTokenResponse is an erroneous token request. ErrTokenResponse = errors.New("token response error") )
var ( // ErrUnsupportedManagedIdentityType is returned when the type of the managed identity // cannot be established. ErrUnsupportedManagedIdentityType = errors.New("unsupported managed identity type") // ErrInvalidManagedIdentityResourceID is returned when an invalid managed // identity resource ID is provided. ErrInvalidManagedIdentityResourceID = errors.New("invalid managed identity resource ID") )
var ( // ErrMissingCredentials is returned when credentials such as a client secret is missing. ErrMissingCredentials = errors.New("missing credentials, needs a shared secret") )
Functions ¶
This section is empty.
Types ¶
type ClientCredential ¶
type ClientCredential struct {
// contains filtered or unexported fields
}
ClientCredential represents a client credential for authentication to Azure according to the client credential flow. It contains all the necessary settings to perform token requests.
func NewClientCredential ¶
func NewClientCredential(tenantID string, clientID string, options ...CredentialOption) (*ClientCredential, error)
NewClientCredential creates and returns a new *ClientCredential.
func NewClientSecretCredential ¶
func NewClientSecretCredential(tenantID, clientID, clientSecret string, options ...CredentialOption) (*ClientCredential, error)
NewClientSecretCredential creates and return a new *ClientCredential with secret (ClientSecretCredential).
type CredentialOption ¶
type CredentialOption func(o *CredentialOptions)
CredentialOption is a function to set *CredentialOptions.
func WithHTTPClient ¶
func WithHTTPClient(c httpClient) CredentialOption
WithHTTPClient sets the HTTP client of the credential.
func WithResourceID ¶
func WithResourceID(id string) CredentialOption
WithResourceID sets the resource ID.
func WithSecret ¶
func WithSecret(secret string) CredentialOption
WithSecret sets the client secret.
type CredentialOptions ¶
type CredentialOptions struct {
// contains filtered or unexported fields
}
CredentialOptions contains options for the various credential types.
type ManagedIdentityCredential ¶
type ManagedIdentityCredential struct {
// contains filtered or unexported fields
}
ManagedIdentityCredential represents a managed identity credential for authentication to Azure according to the managed identity credential flow. It contains all the necessary settings to perform token requests.
func NewManagedIdentityCredential ¶
func NewManagedIdentityCredential(options ...CredentialOption) (*ManagedIdentityCredential, error)
NewManagedIdentityCredential creates and returns a new *ManagedIdentityCredential.