Documentation
¶
Overview ¶
Package token signs and verifies the caller tokens of ward.
Index ¶
Constants ¶
const ( // Context separates a token signature from every other signature of the same key. Context = "ward-token-v1" // MaxTokenBytes is the longest token that Mint makes and Verify reads. MaxTokenBytes = 32 << 10 )
Variables ¶
var ErrToken = errors.New("token: not accepted")
ErrToken is the one error of a rejected token. It never says why.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct {
Kid string `json:"kid"`
Scope Scope `json:"scope"`
Repo string `json:"repo,omitempty"`
Subject string `json:"subject,omitempty"`
Exp int64 `json:"exp"`
}
Claims name what a bearer may do. Subject is for logs and traces and grants nothing.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier accepts tokens that one of its keys signed.