Documentation ¶
Overview ¶
Package signer provides an implementation of the HSDP API signing algorithm. It can sign standard Go http.Request
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LOG_TIME_FORMAT = "2006-01-02T15:04:05.000Z07:00" TIME_FORMAT = time.RFC3339 AUTHORIZATION_HEADER = "hsdp-api-signature" SIGNED_DATE_HEADER = "SignedDate" DEFAULT_PREFIX_64 = "REhQV1M=" ALGORITHM_NAME = "HmacSHA256" )
Functions ¶
This section is empty.
Types ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer holds the configuration of a signer instance
func NewWithPrefixAndNowFunc ¶
func NewWithPrefixAndNowFunc(sharedKey, sharedSecret, prefix string, nowFunc NowFunc) (*Signer, error)
NewWithPrefixAndNowFunc create na instace of Signer, taking prefix and nowFunc as additional parameters
func (*Signer) SignRequest ¶
SignsRequest signs a http.Request by adding an Authorization and SignedDate header
Click to show internal directories.
Click to hide internal directories.