0.12.0 (2021-11-02)
Breaking Changes
- Raised minimum go version to 1.16
- Removed
NewAuthenticationPolicy()
from credentials. Clients should instead use azcore's
runtime.NewBearerTokenPolicy()
to construct a bearer token authorization policy. - The
AuthorityHost
field in credential options structs is now a custom type,
AuthorityHost
, with underlying typestring
NewChainedTokenCredential
has a new signature to accommodate a placeholder
options struct:// before cred, err := NewChainedTokenCredential(credA, credB) // after cred, err := NewChainedTokenCredential([]azcore.TokenCredential{credA, credB}, nil)
- Removed
ExcludeAzureCLICredential
,ExcludeEnvironmentCredential
, andExcludeMSICredential
fromDefaultAzureCredentialOptions
NewClientCertificateCredential
requires a[]*x509.Certificate
andcrypto.PrivateKey
instead of
a path to a certificate file. AddedParseCertificates
to simplify getting these in common cases:// before cred, err := NewClientCertificateCredential("tenant", "client-id", "/cert.pem", nil) // after certData, err := os.ReadFile("/cert.pem") certs, key, err := ParseCertificates(certData, password) cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, nil)
- Removed
InteractiveBrowserCredentialOptions.ClientSecret
and.Port
- Removed
AADAuthenticationFailedError
- Removed
id
parameter ofNewManagedIdentityCredential()
. User assigned identities are now
specified byManagedIdentityCredentialOptions.ID
:// before cred, err := NewManagedIdentityCredential("client-id", nil) // or, for a resource ID opts := &ManagedIdentityCredentialOptions{ID: ResourceID} cred, err := NewManagedIdentityCredential("/subscriptions/...", opts) // after clientID := ClientID("7cf7db0d-...") opts := &ManagedIdentityCredentialOptions{ID: clientID} // or, for a resource ID resID: ResourceID("/subscriptions/...") opts := &ManagedIdentityCredentialOptions{ID: resID} cred, err := NewManagedIdentityCredential(opts)
DeviceCodeCredentialOptions.UserPrompt
has a new type:func(context.Context, DeviceCodeMessage) error
- Credential options structs now embed
azcore.ClientOptions
. In addition to changing literal initialization
syntax, this change renamesHTTPClient
fields toTransport
. - Renamed
LogCredential
toEventCredential
AzureCLICredential
no longer reads the environment variableAZURE_CLI_PATH
NewManagedIdentityCredential
no longer reads environment variablesAZURE_CLIENT_ID
and
AZURE_RESOURCE_ID
. UseManagedIdentityCredentialOptions.ID
instead.- Unexported
AuthenticationFailedError
andCredentialUnavailableError
structs. In their place are two
interfaces having the same names.
Bugs Fixed
AzureCLICredential.GetToken
no longer mutates itsopts.Scopes
Features Added
- Added connection configuration options to
DefaultAzureCredentialOptions
AuthenticationFailedError.RawResponse()
returns the HTTP response motivating the error,
if available
Other Changes
NewDefaultAzureCredential()
returns*DefaultAzureCredential
instead of*ChainedTokenCredential
- Added
TenantID
field toDefaultAzureCredentialOptions
andAzureCLICredentialOptions