Documentation
¶
Overview ¶
Package signer signs outbound HTTP requests using AWS Signature Version 4.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPClient ¶
HTTPClient copies a client and installs signing without changing its owner. Redirects are disabled by default to avoid signing an untrusted destination. Supply CheckRedirect explicitly to permit trusted redirects; each is re-signed.
Types ¶
type Config ¶
type Config struct {
Service string
Region string
Credentials aws.CredentialsProvider
Clock func() time.Time
// DisableURIPathEscaping is needed for S3's single-escaped path convention.
DisableURIPathEscaping bool
}
Config controls signing without loading the SDK configuration/provider chain. Credentials are retrieved for every request; use aws.CredentialsCache explicitly when provider caching is desired. Callbacks must be safe for concurrent use.
type ConfigError ¶
type ConfigError struct{ Message string }
ConfigError indicates missing signing configuration or environment credentials.
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
type SigV4Signer ¶
type SigV4Signer struct {
// contains filtered or unexported fields
}
SigV4Signer is immutable after construction and safe for concurrent requests.
func New ¶
func New(config Config) (*SigV4Signer, error)
func (*SigV4Signer) Sign ¶
Sign clones headers and URL and returns a request with a replayable body. With GetBody, the input stream is untouched. Otherwise the input body is read and restored; it must not be used concurrently. Callers retain ownership of the input body and must close both requests' bodies when signing standalone. Provider failures and cancellation remain discoverable through errors.Is/As.
type SigningError ¶
type SigningError struct{ Err error }
SigningError preserves the underlying request conversion or signing failure.
func (*SigningError) Error ¶
func (e *SigningError) Error() string
func (*SigningError) Unwrap ¶
func (e *SigningError) Unwrap() error
type Transport ¶
type Transport struct {
Signer Signer
Base http.RoundTripper
}
Transport signs each round trip, including requests followed by http.Client. It performs no retries. Signer and Base must support concurrent calls.