Versions in this module Expand all Collapse all v0 v0.1.0 Aug 3, 2026 Changes in this version + const BlessFile + var ErrEmptyIdentity = errors.New("bless: empty identity") + var ErrInvalidIdentity = errors.New("bless: invalid identity") + var ErrInvalidReason = errors.New("bless: invalid reason") + var ErrInvalidRef = errors.New("bless: invalid inherit ref") + var ErrInvalidRole = errors.New("bless: entry has an unrecognized role") + var ErrMaxDepth = errors.New("bless: maximum inheritance depth exceeded") + var ErrMaxRefs = errors.New("bless: maximum refs exceeded") + var ErrNoLoader = errors.New("bless: resolver has no loader") + var ErrNoRole = errors.New("bless: entry has no role") + var ErrNotFound = errors.New("bless: trust file not found") + type Entry struct + Identity Identity + Reason string + Role Role + func (e Entry) Matches(identity Identity) bool + type File struct + func Parse(content []byte) (*File, error) + func (f *File) Add(e Entry) + func (f *File) AddInherit(ref string) + func (f *File) Bless(identity Identity, reason string, asMaintainer bool) + func (f *File) Check(identity Identity) Role + func (f *File) Curse(identity Identity, reason string) + func (f *File) Encode() ([]byte, error) + func (f *File) Entries() []Entry + func (f *File) Inherits() []Inherit + func (f *File) Lookup(identity Identity) (Entry, bool) + func (f *File) Remove(identity Identity) bool + func (f *File) RemoveInherit(ref string) bool + func (f *File) Validate() error + type Identity struct + Kind Kind + Value string + func Bare(value string) Identity + func Email(value string) Identity + func ParseIdentity(s string) (Identity, error) + func SSH(value string) Identity + func Username(value string) Identity + func (i Identity) Matches(other Identity) bool + func (i Identity) String() string + type Inherit struct + Ref string + type Kind string + const KindEmail + const KindNone + const KindSSH + const KindUsername + type Loader interface + LoadTrust func(ref string) (*File, error) + type Option func(*Resolver) + func WithMaxDepth(n int) Option + func WithMaxRefs(n int) Option + type Resolver struct + func NewResolver(loader Loader, opts ...Option) *Resolver + func (r *Resolver) Resolve(ref string, identity Identity) (Result, error) + type Result struct + Entry *Entry + Role Role + Source string + type Role int + const RoleContributor + const RoleCursed + const RoleMaintainer + const RoleUnknown + func (r Role) IsAllowed() bool + func (r Role) String() string