Documentation
¶
Index ¶
- func AbsDuration(d time.Duration) time.Duration
- func BuildSigningPayload(ts time.Time, canonicalBody []byte) []byte
- func CanonicalizeJSONBody(raw []byte) ([]byte, error)
- func ParseTimestamp(value string) (time.Time, error)
- func ReadAndBufferBody(r *http.Request) ([]byte, error)
- type HMACVerifier
- type Material
- type Verifier
- type VerifierFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsDuration ¶
AbsDuration returns the absolute value of the supplied duration.
func BuildSigningPayload ¶
BuildSigningPayload constructs the canonical string that is HMAC-signed.
func CanonicalizeJSONBody ¶
CanonicalizeJSONBody normalizes arbitrary JSON into canonical form for signing.
func ParseTimestamp ¶
ParseTimestamp accepts Timestamp header values in RFC3339 or RFC3339Nano format.
Types ¶
type HMACVerifier ¶
type HMACVerifier struct {
Key []byte
}
HMACVerifier validates signatures that were produced by taking the base64url-encoded HMAC-SHA256 of `RFC3339(timestamp) + "." + canonicalJSON`.
type Material ¶
type Material struct {
Signature string
Timestamp time.Time
CanonicalBody []byte
Method string
Path string
RawQuery string
Headers http.Header
}
Material captures the inputs needed to validate a signed request.
Click to show internal directories.
Click to hide internal directories.