sign

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2015 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signable

type Signable signable.Signable

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

func (signer *Signer) RefreshCredentials() error

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) Sign

func (signer *Signer) Sign(signable Signable) error

Sign request with AWS AuthV4 headers.

func (*Signer) SignDetails

func (signer *Signer) SignDetails(now time.Time, signable Signable) (SigningKey, string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL