- Added
AccessToken.RefreshOn
and updatedBearerTokenPolicy
to consider nonzero values of it when deciding whether to request a new token
- Upgraded to Go 1.23
- Upgraded dependencies
- Added field
OperationLocationResultPath
toruntime.NewPollerOptions[T]
for LROs that use theOperation-Location
pattern. - Support
encoding.TextMarshaler
andencoding.TextUnmarshaler
interfaces inarm.ResourceID
.
- Added field
Kind
toruntime.StartSpanOptions
to allow a kind to be set when starting a span.
BearerTokenPolicy
now rewinds request bodies before retrying
BearerTokenPolicy
handles CAE claims challenges
- Omit the
ResponseError.RawResponse
field from JSON marshaling so instances can be marshaled. - Fixed an integer overflow in the retry policy.
- Update dependencies.
- Added field
Attributes
toruntime.StartSpanOptions
to simplify creating spans with attributes.
- Include the HTTP verb and URL in
log.EventRetryPolicy
log entries so it's clear which operation is being retried.
- Added runtime.NewRequestFromRequest(), allowing for a policy.Request to be created from an existing *http.Request.
- Added field
StatusCodes
toruntime.FetcherForNextLinkOptions
allowing for additional HTTP status codes indicating success. - Added func
NewUUID
to theruntime
package for generating UUIDs.
- Fixed an issue that prevented pollers using the
Operation-Location
strategy from unmarshaling the final result in some cases.
- Updated dependencies.
- Pollers that use the
Location
header won't considerhttp.StatusRequestTimeout
a terminal failure. runtime.Poller[T].Result
won't consider non-terminal error responses as terminal.
- Added
StatusCodes
toarm/policy.RegistrationOptions
to allow supporting non-standard HTTP status codes during registration. - Added field
InsecureAllowCredentialWithHTTP
toazcore.ClientOptions
and dependent authentication pipeline policies. - Added type
MultipartContent
to thestreaming
package to support multipart/form payloads with custom Content-Type and file name.
runtime.SetMultipartFormData
won't try to stringify[]byte
values.- Pollers that use the
Location
header won't considerhttp.StatusTooManyRequests
a terminal failure.
- Update dependencies.
- Added logging event
log.EventResponseError
that will contain the contents ofResponseError.Error()
whenever anazcore.ResponseError
is created. - Added
runtime.NewResponseErrorWithErrorCode
for creating anazcore.ResponseError
with a caller-supplied error code. - Added type
MatchConditions
for use in conditional requests.
- Fixed a potential race condition between
NullValue
andIsNullValue
. runtime.EncodeQueryParams
will escape semicolons before callingurl.ParseQuery
.
- Update dependencies.
runtime.MarshalAsByteArray
andruntime.MarshalAsJSON
will preserve the preexisting value of theContent-Type
header.
- Update to latest version of
internal
.
- The
retry-after-ms
andx-ms-retry-after-ms
headers weren't being checked during retries.
- Update dependencies.
These changes affect only code written against previous beta versions of
v1.7.0
andv1.8.0
- The function
NewTokenCredential
has been removed from thefake
package. Use a literal&fake.TokenCredential{}
instead. - The field
TracingNamespace
inruntime.PipelineOptions
has been replaced byTracingOptions
.
- Fixed an issue that could cause some allowed HTTP header values to not show up in logs.
- Include error text instead of error type in traces when the transport returns an error.
- Fixed an issue that could cause an HTTP/2 request to hang when the TCP connection becomes unresponsive.
- Block key and SAS authentication for non TLS protected endpoints.
- Passing a
nil
credential value will no longer cause a panic. Instead, the authentication is skipped. - Calling
Error
on a zero-valueazcore.ResponseError
will no longer panic. - Fixed an issue in
fake.PagerResponder[T]
that would cause a trailing error to be omitted when iterating over pages. - Context values created by
azcore
will no longer flow across disjoint HTTP requests.
- Skip generating trace info for no-op tracers.
- The
clientName
paramater in client constructors has been renamed tomoduleName
.
- The beta features for tracing and fakes have been reinstated.
- This includes the following features from
v1.8.0-beta.N
releases.- Claims and CAE for authentication.
- New
messaging
package. - Various helpers in the
runtime
package. - Deprecation of
runtime.With*
funcs and their replacements in thepolicy
package.
- Added types
KeyCredential
andSASCredential
to theazcore
package.- Includes their respective constructor functions.
- Added types
KeyCredentialPolicy
andSASCredentialPolicy
to theazcore/runtime
package.- Includes their respective constructor functions and options types.
These changes affect only code written against beta versions of
v1.8.0
- The beta features for tracing and fakes have been omitted for this release.
- Fixed an issue that could cause some ARM RPs to not be automatically registered.
- Block bearer token authentication for non TLS protected endpoints.
- Updated dependencies.
- Added function
FetcherForNextLink
andFetcherForNextLinkOptions
to theruntime
package to centralize creation ofPager[T].Fetcher
from a next link URL.
- Suppress creating spans for nested SDK API calls. The HTTP span will be a child of the outer API span.
- The following functions in the
runtime
package are now exposed from thepolicy
package, and theruntime
versions have been deprecated.WithCaptureResponse
WithHTTPHeader
WithRetryOptions
- Fix default HTTP transport to work in WASM modules.
- Added function
SanitizePagerPollerPath
to theserver
package to centralize sanitization and formalize the contract. - Added
TokenRequestOptions.EnableCAE
to indicate whether to request a CAE token.
This change affects only code written against beta version
v1.8.0-beta.1
.
messaging.CloudEvent
deserializes JSON objects as[]byte
, instead ofjson.RawMessage
. See the documentation for CloudEvent.Data for more information.
This change affects only code written against beta versions
v1.7.0-beta.2
andv1.8.0-beta.1
.
- Removed parameter from method
Span.End()
and its typetracing.SpanEndOptions
. This API GA'ed inv1.2.0
so we cannot change it.
- Propagate any query parameters when constructing a fake poller and/or injecting next links.
- Enable TLS renegotiation in the default transport policy.
messaging/CloudEvent
allows you to serialize/deserialize CloudEvents, as described in the CloudEvents 1.0 specification: link
- The beta features for CAE, tracing, and fakes have been reinstated.
- Added method
WithClientName()
to typeazcore.Client
to support shallow cloning of a client with a new name used for tracing.
These changes affect only code written against beta versions v1.7.0-beta.1 or v1.7.0-beta.2
- The beta features for CAE, tracing, and fakes have been omitted for this release.
These changes affect only code written against beta version v1.7.0-beta.1
- Method
SpanFromContext()
on typetracing.Tracer
had thebool
return value removed.- This includes the field
SpanFromContext
in supporting typetracing.TracerOptions
.
- This includes the field
- Method
AddError()
has been removed from typetracing.Span
. - Method
Span.End()
now requires an argument of type*tracing.SpanEndOptions
.
- Fixed an issue in
azcore.NewClient()
andarm.NewClient()
that could cause an incorrect module name to be used in telemetry.
- This version contains all bug fixes from
v1.7.0-beta.1
- Restored CAE support for ARM clients.
- Added supporting features to enable distributed tracing.
- Added func
runtime.StartSpan()
for use by SDKs to start spans. - Added method
WithContext()
toruntime.Request
to support shallow cloning with a new context. - Added field
TracingNamespace
toruntime.PipelineOptions
. - Added field
Tracer
toruntime.NewPollerOptions
andruntime.NewPollerFromResumeTokenOptions
types. - Added field
SpanFromContext
totracing.TracerOptions
. - Added methods
Enabled()
,SetAttributes()
, andSpanFromContext()
totracing.Tracer
. - Added supporting pipeline policies to include HTTP spans when creating clients.
- Added func
- Added package
fake
to support generated fakes packages in SDKs.- The package contains public surface area exposed by fake servers and supporting APIs intended only for use by the fake server implementations.
- Added an internal fake poller implementation.
- Retry policy always clones the underlying
*http.Request
before invoking the next policy. - Added some non-standard error codes to the list of error codes for unregistered resource providers.
- Added support for ARM cross-tenant authentication. Set the
AuxiliaryTenants
field ofarm.ClientOptions
to enable. - Added
TenantID
field topolicy.TokenRequestOptions
.
- Added
ShouldRetry
topolicy.RetryOptions
for finer-grained control over when to retry.
These changes affect only code written against a beta version such as v1.5.0-beta.1 These features will return in v1.6.0-beta.1.
- Removed
TokenRequestOptions.Claims
and.TenantID
- Removed ARM client support for CAE and cross-tenant auth.
- Added non-conformant LRO terminal states
Cancelled
andCompleted
.
- Updated to latest
internal
module.
- This release includes the features added in v1.4.0-beta.1
This release doesn't include features added in v1.4.0-beta.1. They will return in v1.5.0-beta.1.
- Add
Clone()
method forarm/policy.ClientOptions
.
- ARM's RP registration policy will no longer swallow unrecognized errors.
- Fixed an issue in
runtime.NewPollerFromResumeToken()
when resuming aPoller
with a customPollingHandler
. - Fixed wrong policy copy in
arm/runtime.NewPipeline()
.
- Added support for ARM cross-tenant authentication. Set the
AuxiliaryTenants
field ofarm.ClientOptions
to enable. - Added
Claims
andTenantID
fields topolicy.TokenRequestOptions
. - ARM bearer token policy handles CAE challenges.
- Update dependencies to latest versions.
- Added
BearerTokenOptions.AuthorizationHandler
to enable extendingruntime.BearerTokenPolicy
with custom authorization logic - Added
Client
types and matching constructors to theazcore
andarm
packages. These represent a basic client for HTTP and ARM respectively.
- Updated
internal
module to latest version. policy/Request.SetBody()
allows replacing a request's body with an empty one
- Added
ClientOptions.APIVersion
field, which overrides the default version a client requests of the service, if the client supports this (all ARM clients do). - Added package
tracing
that contains the building blocks for distributed tracing. - Added field
TracingProvider
to typepolicy.ClientOptions
that will be used to set the per-client tracing implementation.
- Fixed an issue in
runtime.SetMultipartFormData
to properly handle slices ofio.ReadSeekCloser
. - Fixed the MaxRetryDelay default to be 60s.
- Failure to poll the state of an LRO will now return an
*azcore.ResponseError
for poller types that require this behavior. - Fixed a bug in
runtime.NewPipeline
that would cause pipeline-specified allowed headers and query parameters to be lost.
- Retain contents of read-only fields when sending requests.
- Don't retry a request if the
Retry-After
delay is greater than the configuredRetryOptions.MaxRetryDelay
. runtime.JoinPaths
: do not unconditionally add a forward slash before the query string
- Removed logging URL from retry policy as it's redundant.
- Retry policy logs when it exits due to a non-retriable status code.
- Adjusted the initial retry delay to 800ms per the Azure SDK guidelines.
- Fixed various doc bugs.
- Avoid polling when a RELO LRO synchronously terminates.
- The one-second floor for
Frequency
when callingPollUntilDone()
has been removed when running tests.
- Added interface
runtime.PollingHandler
to support custom poller implementations.- Added field
PollingHandler
of this type toruntime.NewPollerOptions[T]
andruntime.NewPollerFromResumeTokenOptions[T]
.
- Added field
- Renamed
cloud.Configuration.LoginEndpoint
to.ActiveDirectoryAuthorityHost
- Renamed
cloud.AzurePublicCloud
tocloud.AzurePublic
- Removed
AuxiliaryTenants
field fromarm/ClientOptions
andarm/policy/BearerTokenOptions
- Removed
TokenRequestOptions.TenantID
Poller[T].PollUntilDone()
now takes anoptions *PollUntilDoneOptions
param instead offreq time.Duration
- Removed
arm/runtime.Poller[T]
,arm/runtime.NewPoller[T]()
andarm/runtime.NewPollerFromResumeToken[T]()
- Removed
arm/runtime.FinalStateVia
and relatedconst
values - Renamed
runtime.PageProcessor
toruntime.PagingHandler
- The
arm/runtime.ProviderRepsonse
andarm/runtime.Provider
types are no longer exported. - Renamed
NewRequestIdPolicy()
toNewRequestIDPolicy()
TokenCredential.GetToken
now returnsAccessToken
by value.
- When per-try timeouts are enabled, only cancel the context after the body has been read and closed.
- The
Operation-Location
poller now properly handlesfinal-state-via
values. - Improvements in
runtime.Poller[T]
Poll()
shouldn't cache errors, allowing for additional retries when in a non-terminal state.Result()
will cache the terminal result or error but not transient errors, allowing for additional retries.
- Updated to latest
internal
module and absorbed breaking changes.- Use
temporal.Resource
and deleted copy.
- Use
- The internal poller implementation has been refactored.
- The implementation in
internal/pollers/poller.go
has been merged intoruntime/poller.go
with some slight modification. - The internal poller types had their methods updated to conform to the
runtime.PollingHandler
interface. - The creation of resume tokens has been refactored so that implementers of
runtime.PollingHandler
don't need to know about it.
- The implementation in
NewPipeline()
places policies fromClientOptions
after policies fromPipelineOptions
- Default User-Agent headers no longer include
azcore
version information
- Include XML header when marshalling XML content.
- Handle XML namespaces when searching for error code.
- Handle
odata.error
when searching for error code.
- Added
runtime.Pager[T any]
andruntime.Poller[T any]
supporting types for central, generic, implementations. - Added
cloud
package with a new API for cloud configuration - Added
FinalStateVia
field toruntime.NewPollerOptions[T any]
type.
- Removed the
Poller
type-alias to the internal poller implementation. - Added
Ptr[T any]
andSliceOfPtrs[T any]
in theto
package and removed all non-generic implementations. NullValue
andIsNullValue
now take a generic type parameter instead of an interface func parameter.- Replaced
arm.Endpoint
withcloud
API- Removed the
endpoint
parameter fromNewRPRegistrationPolicy()
arm/runtime.NewPipeline()
and.NewRPRegistrationPolicy()
now return anerror
- Removed the
- Refactored
NewPoller
andNewPollerFromResumeToken
funcs inarm/runtime
andruntime
packages.- Removed the
pollerID
parameter as it's no longer required. - Created optional parameter structs and moved optional parameters into them.
- Removed the
- Changed
FinalStateVia
field to aconst
type.
- Converted expiring resource and dependent types to use generics.
- Added header
WWW-Authenticate
to the default allow-list of headers for logging. - Added a pipeline policy that enables the retrieval of HTTP responses from API calls.
- Added
runtime.WithCaptureResponse
to enable the policy at the API level (off by default).
- Added
- Moved
WithHTTPHeader
andWithRetryOptions
from thepolicy
package to theruntime
package.
- Restore response body after reading in
Poller.FinalResponse()
. (#16911) - Fixed bug in
NullValue
that could lead to incorrect comparisons for empty maps/slices (#16969)
BearerTokenPolicy
is more resilient to transient authentication failures. (#16789)
- Added
AllowedHeaders
andAllowedQueryParams
topolicy.LogOptions
to control which headers and query parameters are written to the logger. - Added
azcore.ResponseError
type which is returned from APIs when a non-success HTTP status code is received.
- Moved
[]policy.Policy
parameters ofarm/runtime.NewPipeline
andruntime.NewPipeline
into a new struct,runtime.PipelineOptions
- Renamed
arm/ClientOptions.Host
to.Endpoint
- Moved
Request.SkipBodyDownload
method to functionruntime.SkipBodyDownload
- Removed
azcore.HTTPResponse
interface type arm.NewPoller()
andruntime.NewPoller()
no longer require aneu
parameterruntime.NewResponseError()
no longer requires anerror
parameter
- Removed
arm.Connection
- Removed
azcore.Credential
and.NewAnonymousCredential()
NewRPRegistrationPolicy
now requires anazcore.TokenCredential
runtime.NewPipeline
has a new signature that simplifies implementing custom authenticationarm/runtime.RegistrationOptions
embedspolicy.ClientOptions
- Contents in the
log
package have been slightly renamed. - Removed
AuthenticationOptions
in favor ofpolicy.BearerTokenOptions
- Changed parameters for
NewBearerTokenPolicy()
- Moved policy config options out of
arm/runtime
and intoarm/policy
- Updating Documentation
- Added string typdef
arm.Endpoint
to provide a hint toward expected ARM client endpoints azcore.ClientOptions
contains common pipeline configuration settings- Added support for multi-tenant authorization in
arm/runtime
- Require one second minimum when calling
PollUntilDone()
- Fixed a potential panic when creating the default Transporter.
- Close LRO initial response body when creating a poller.
- Fixed a panic when recursively cloning structs that contain time.Time.
- Split content out of
azcore
into various packages. The intent is to separate content based on its usage (common, uncommon, SDK authors).azcore
has all core functionality.log
contains facilities for configuring in-box logging.policy
is used for configuring pipeline options and creating custom pipeline policies.runtime
contains various helpers used by SDK authors and generated content.streaming
has helpers for streaming IO operations.
NewTelemetryPolicy()
now requires module and version parameters and theValue
option has been removed.- As a result, the
Request.Telemetry()
method has been removed.
- As a result, the
- The telemetry policy now includes the SDK prefix
azsdk-go-
so callers no longer need to provide it. - The
*http.Request
inruntime.Request
is no longer anonymously embedded. Use theRaw()
method to access it. - The
UserAgent
andVersion
constants have been made internal,Module
andVersion
respectively.
- Fixed an issue in the retry policy where the request body could be overwritten after a rewind.
- Moved modules
armcore
andto
content intoarm
andto
packages respectively.- The
Pipeline()
method onarmcore.Connection
has been replaced byNewPipeline()
inarm.Connection
. It takes module and version parameters used by the telemetry policy.
- The
- Poller logic has been consolidated across ARM and core implementations.
- This required some changes to the internal interfaces for core pollers.
- The core poller types have been improved, including more logging and test coverage.
- Adds an
ETag
type for comparing etags and handling etags on requests - Simplifies the
requestBodyProgess
andresponseBodyProgress
into a singleprogress
object
JoinPaths
will preserve query parameters encoded in theroot
url.
- Bumps dependency on
internal
module to the latest version (v0.7.0)
- Replaces methods from Logger type with two package methods for interacting with the logging functionality.
azcore.SetClassifications
replacesazcore.Logger().SetClassifications
azcore.SetListener
replacesazcore.Logger().SetListener
- Removes
Logger
type fromazcore
- Adding TenantID to TokenRequestOptions (#14879)
- Adding AuxiliaryTenants to AuthenticationOptions (#15123)
- Rename
AnonymousCredential
toNewAnonymousCredential
(#15104) - rename
AuthenticationPolicyOptions
toAuthenticationOptions
(#15103) - Make Header constants private (#15038)
- Improved support for byte arrays #14715
- Add license.txt to azcore module #14682
- Remove extra
*
in UnmarshalAsByteArray() #14642
- Cache the original request body on Request #14634
- Add support for null map and slice
- Export
Response.Payload
method
- remove
Response.UnmarshalError
as it's no longer required
- Add
UnmarshalError()
onazcore.Response
- Support for basic LRO polling
- Added type
LROPoller
and supporting types for basic polling on long running operations. - rename poller param and added doc comment
- Fixed content type detection bug in logging.
- Add support for multi-part form data
- Added method
WriteMultipartFormData()
to Request.
- Add support for encoding JSON null values
- Adds
NullValue()
andIsNullValue()
functions for setting and detecting sentinel values used for encoding a JSON null. - Documentation fixes
- Fixed improper error wrapping
- Add
Pager
andPoller
interfaces to azcore
- Accept zero-value options for default values
- Specify zero-value options structs to accept default values.
- Remove
DefaultXxxOptions()
methods. - Do not silently change TryTimeout on negative values
- make per-try timeout opt-in
- Include telemetry string in User Agent
- Updating response body handling on
azcore.Response
- Remove implementation of stateless policies as first-class functions.
- Add
Telemetry()
method toazcore.Request()
- Rename
log
tologger
to avoid name collision with the log package. - Documentation improvements
- Simplified
DefaultHTTPClientTransport()
implementation
- Update
internal
module dependence tov0.5.0
- Removed storage specific content
- Removed internal content to prevent API clutter
- Refactored various policy options to conform with our options pattern
- Removed
LogError
andLogSlowResponse
. - Renamed
options
inRequestLogOptions
. - Updated
NewRequestLogPolicy()
to follow standard pattern for options. - Refactored
requestLogPolicy.Do()
per above changes. - Cleaned up/added logging in retry policy.
- Export
NewResponseError()
- Fix
RequestLogOptions
comment
- Add default console logger
- Default console logger writes to stderr. To enable it, set env var
AZURE_SDK_GO_LOGGING
to the value 'all'. - Added
Logger.Writef()
to reduce the need forShouldLog()
checks. - Add
LogLongRunningOperation
- The
request
andtransport
interfaces have been refactored to align with the patterns in the standard library. NewRequest()
now useshttp.NewRequestWithContext()
and performs additional validation, it also requires a context parameter.- The
Policy
andTransport
interfaces have had their context parameter removed as the context is associated with the underlyinghttp.Request
. Pipeline.Do()
will validate the HTTP request before sending it through the pipeline, avoiding retries on a malformed request.- The
Retrier
interface has been replaced with theNonRetriableError
interface, and the retry policy updated to test for this. Request.SetBody()
now requires a content type parameter for setting the request's MIME type.- moved path concatenation into
JoinPaths()
func
- Improvements to body download policy
- Always download the response body for error responses, i.e. HTTP status codes >= 400.
- Simplify variable declarations
- Set the Content-Length header in
Request.SetBody
- Fix cancellation of per try timeout
- Per try timeout is used to ensure that an HTTP operation doesn't take too long, e.g. that a GET on some URL doesn't take an inordinant amount of time.
- Once the HTTP request returns, the per try timeout should be cancelled, not when the response has been read to completion.
- Do not drain response body if there are no more retries
- Do not retry non-idempotent operations when body download fails
- Add support for custom HTTP request headers
- Inserts an internal policy into the pipeline that can extract HTTP header values from the caller's context, adding them to the request.
- Use
azcore.WithHTTPHeader
to add HTTP headers to a context. - Remove method specific to Go 1.14
- Omit read-only content from request payloads
- If any field in a payload's object graph contains
azure:"ro"
, make a clone of the object graph, omitting all fields with this annotation. - Verify no fields were dropped
- Handle embedded struct types
- Added test for cloning by value
- Add messages to failures
- Updated dependency on internal module to fix race condition.
- Add
HTTPResponse
interface to be used by callers to access the raw HTTP response from an error in the event of an API call failure. - Updated
sdk/internal
dependency to latest version. - Rename package alias
- Added missing documentation comments
- Fixed a bug in body download policy.
- Miscellaneous clean-up reported by linters
- Differentiate between standard and URL encoding.
- Add support for for base64 encoding and decoding of payloads.
- Change
RetryAfter()
to a function.
- Updating
RetryAfter
to only return the detaion in the RetryAfter header
- Export
TransportFunc
- Removed
IterationDone
- Ensure per-try timeout is properly cancelled
- Explicitly call cancel the per-try timeout when the response body has been read/closed by the body download policy.
- When the response body is returned to the caller for reading/closing, wrap it in a
responseBodyReader
that will cancel the timeout when the body is closed. Logger.Should()
will return false if no listener is set.
- Enable custom
RetryOptions
to be specified per API call - Added
WithRetryOptions()
that adds a customRetryOptions
to the provided context, allowing custom settings per API call. - Remove 429 from the list of default HTTP status codes for retry.
- Change StatusCodesForRetry to a slice so consumers can append to it.
- Added support for retry-after in HTTP-date format.
- Cleaned up some comments specific to storage.
- Remove
Request.SetQueryParam()
- Renamed
MaxTries
toMaxRetries
- Added
DefaultRetryOptions
to create initialized default options.
- Removed
Response.CheckStatusCode()
- Add support for marshalling and unmarshalling JSON
- Removed
Response.Payload
field - Exit early when unmarsahlling if there is no payload
- Initial release