Documentation
¶
Overview ¶
Package grant signs and verifies the bearer grants of the store.
Index ¶
Constants ¶
const MaxRefs = 64
MaxRefs is the most patterns that a grant holds.
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"`
// Refs are the ref patterns that a merge grant may move: a ref name, or a prefix that ends in "*". A merge grant
// moves only the refs that a pattern matches, and a merge grant without Refs is not valid. No other scope carries
// Refs.
Refs []string `json:"refs,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.