github Azure/azure-sdk-for-go sdk/azidentity/v0.12.0

latest releases: sdk/resourcemanager/hybridcompute/armhybridcompute/v2.1.0-beta.1, sdk/ai/azopenai/v0.7.1, sdk/security/keyvault/azadmin/v1.3.0...
pre-release3 years ago

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 type string
  • 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, and ExcludeMSICredential
    from DefaultAzureCredentialOptions
  • NewClientCertificateCredential requires a []*x509.Certificate and crypto.PrivateKey instead of
    a path to a certificate file. Added ParseCertificates 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 of NewManagedIdentityCredential(). User assigned identities are now
    specified by ManagedIdentityCredentialOptions.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 renames HTTPClient fields to Transport.
  • Renamed LogCredential to EventCredential
  • AzureCLICredential no longer reads the environment variable AZURE_CLI_PATH
  • NewManagedIdentityCredential no longer reads environment variables AZURE_CLIENT_ID and
    AZURE_RESOURCE_ID. Use ManagedIdentityCredentialOptions.ID instead.
  • Unexported AuthenticationFailedError and CredentialUnavailableError structs. In their place are two
    interfaces having the same names.

Bugs Fixed

  • AzureCLICredential.GetToken no longer mutates its opts.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 to DefaultAzureCredentialOptions and AzureCLICredentialOptions

Don't miss a new azure-sdk-for-go release

NewReleases is sending notifications on new releases.