Documentation ¶
Overview ¶
Package hmactoken implements generation and validation HMAC-tagged Swarming tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
Secret can be used to generate and validate HMAC-tagged tokens.
func NewRotatingSecret ¶
NewRotatingSecret creates a new secret given a key name and subscribes to its rotations.
func NewStaticSecret ¶
NewStaticSecret creates a new secret from a given static secret value.
Mostly for tests.
func (*Secret) GenerateToken ¶
GenerateToken wraps `msg` into a serialized TaggedMessage.
The produced token can be validated and deserialized with validateToken.
TODO: To be deleted once poll tokens are gone.
func (*Secret) ValidateToken ¶
ValidateToken deserializes a TaggedMessage, checks the HMAC and deserializes the payload into `msg`.
TODO: To be deleted once poll tokens are gone.