Documentation
¶
Overview ¶
Package token signs and verifies the caller tokens of ward.
Index ¶
Constants ¶
This section is empty.
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 Signer ¶
type Signer struct {
Kid string
Key ed25519.PrivateKey
}
Signer mints tokens with an Ed25519 private key.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier accepts tokens that one of its keys signed.