Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultTokenTTL = 90 * 24 * time.Hour
DefaultTokenTTL defines the default time-to-live for worker tokens. Tokens are valid for 90 days from creation. After expiration, the system will log a warning but continue to accept the token, allowing operations to proceed.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Spec ¶
type Spec struct {
Prefix string
RandomLength int // number of random bytes
SecretKey []byte // secret key for HMAC
TTL time.Duration // token time-to-live
RandReader io.Reader // random number generator
}
func DefaultSpec ¶
func DefaultSpec() *Spec
func (*Spec) WithPrefix ¶
WithPrefix sets a custom prefix for the spec
func (*Spec) WithRandReader ¶
WithRandReader sets a custom random number generator
func (*Spec) WithRandomLength ¶
WithRandomLength sets the length of random bytes
func (*Spec) WithSecretKey ¶
WithSecretKey sets a custom secret key
Click to show internal directories.
Click to hide internal directories.