Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signer ¶
type Signer struct { sync.Mutex // to protect internal volatile structures // contains filtered or unexported fields }
Object to sign Signables with AuthV4.
func NewSigner ¶
func NewSigner(region, service string, credentialProvider credentials.AWSCredentialProvider, extraHeaders []string) *Signer
NewSigner creates a signer for the given region and service. It signs with the given credentialprovider and signs the headers "Host" plus whatever's in extraHeaders. It will add the date and security token headers
func (*Signer) GetSigningKey ¶
func (signer *Signer) GetSigningKey(today SigningDay) SigningKey
func (*Signer) RefreshCredentials ¶
RefreshCredentials checks if the AWSCredentialProvider needs to refresh credentials and does so as needed. The refreshed credentials are stored in the signer. We explicitly manage the credential refreshing because we don't want them to refresh without us knowing about it so we can always invalidate the cache
func (*Signer) SignDetails ¶
Useful for tests or other code that wants the SigningKey
type SigningDay ¶
type SigningDay string
func NewSigningDay ¶
func NewSigningDay(date time.Time) (string, SigningDay)
Return date as formated string and day string
type SigningKey ¶
type SigningKey []byte
func GetSigningKey ¶
func GetSigningKey(day SigningDay, secretKey, region, service string) SigningKey
Utility to calculate a signing key