Documentation
¶
Overview ¶
Package grant signs and verifies the bearer grants of the store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrGrant = errors.New("grant: not accepted")
ErrGrant is the one error of a rejected grant. It never says why.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct {
Kid string `json:"kid"`
Scope Scope `json:"scope"`
WS string `json:"ws,omitempty"`
Epoch uint64 `json:"epoch,omitempty"`
Repo string `json:"repo,omitempty"`
Owner string `json:"owner,omitempty"`
Subject string `json:"subject,omitempty"`
Exp int64 `json:"exp"`
}
Claims name what a bearer may do. Epoch is the claim epoch of the workspace when the grant was minted. Subject is for traces and grants nothing.
type Signer ¶
type Signer struct {
Kid string
Key ed25519.PrivateKey
}
Signer mints grants with an Ed25519 private key.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier accepts grants signed by one of its keys.