Versions in this module Expand all Collapse all v3 v3.0.0 Mar 8, 2021 Changes in this version + const CondDeclared + const CondError + const CondNeedDeclared + const CondTimeBefore + const StdNamespace + var ErrCaveatNotRecognized = errgo.New("caveat not recognized") + func Condition(name, arg string) string + func ConditionWithPrefix(prefix, condition string) string + func ContextWithClock(ctx context.Context, clock Clock) context.Context + func ContextWithMacaroons(ctx context.Context, ns *Namespace, ms macaroon.Slice) context.Context + func ExpiryTime(ns *Namespace, cavs []macaroon.Caveat) (time.Time, bool) + func InferDeclared(ns *Namespace, ms macaroon.Slice) map[string]string + func InferDeclaredFromConditions(ns *Namespace, conds []string) map[string]string + func IsValidPrefix(prefix string) bool + func IsValidSchemaURI(uri string) bool + func MacaroonsExpiryTime(ns *Namespace, ms macaroon.Slice) (time.Time, bool) + func ParseCaveat(cav string) (cond, arg string, err error) + func RegisterStd(c *Checker) + type Caveat struct + Condition string + Location string + Namespace string + func DeclaredCaveat(key string, value string) Caveat + func ErrorCaveatf(f string, a ...interface{}) Caveat + func NeedDeclaredCaveat(cav Caveat, keys ...string) Caveat + func TimeBeforeCaveat(t time.Time) Caveat + type Checker struct + func New(ns *Namespace) *Checker + func NewEmpty(ns *Namespace) *Checker + func (c *Checker) CheckFirstPartyCaveat(ctx context.Context, cav string) error + func (c *Checker) Info() []CheckerInfo + func (c *Checker) Namespace() *Namespace + func (c *Checker) Register(cond, uri string, check Func) + type CheckerInfo struct + Check Func + Name string + Namespace string + Prefix string + type Clock interface + Now func() time.Time + type Func func(ctx context.Context, cond, arg string) error + type Namespace struct + func MacaroonsFromContext(ctx context.Context) (*Namespace, macaroon.Slice) + func NewNamespace(uriToPrefix map[string]string) *Namespace + func (ns *Namespace) EnsureResolved(uri string) (string, bool) + func (ns *Namespace) MarshalText() ([]byte, error) + func (ns *Namespace) Register(uri, prefix string) + func (ns *Namespace) Resolve(uri string) (string, bool) + func (ns *Namespace) ResolveCaveat(cav Caveat) Caveat + func (ns *Namespace) String() string + func (ns *Namespace) UnmarshalText(data []byte) error + func (ns1 *Namespace) Equal(ns2 *Namespace) bool Other modules containing this package gopkg.in/macaroon-bakery.v2 gopkg.in/macaroon-bakery.v2-unstable