Versions in this module Expand all Collapse all v3 v3.0.2 Jul 12, 2024 v3.0.1 Aug 25, 2022 Changes in this version + const KeyLen + const NonceLen + var ErrNotFound = errgo.New("not found") + var ErrPermissionDenied = errgo.New("permission denied") + var NoOp = Op + func DischargeAll(ctx context.Context, m *Macaroon, ...) (macaroon.Slice, error) + func DischargeAllWithKey(ctx context.Context, m *Macaroon, ...) (macaroon.Slice, error) + func IsDischargeRequiredError(err error) bool + func LocalThirdPartyCaveat(key *PublicKey, version Version) checkers.Caveat + func MacaroonVersion(v Version) macaroon.Version + type AuthChecker struct + func (a *AuthChecker) Allow(ctx context.Context, ops ...Op) (*AuthInfo, error) + func (a *AuthChecker) Allowed(ctx context.Context) (*AuthInfo, error) + func (a *AuthChecker) Macaroons() []macaroon.Slice + type AuthInfo struct + Macaroons []macaroon.Slice + OpIndexes map[Op]int + Used []bool + func (a *AuthInfo) Conditions() []string + type Bakery struct + Checker *Checker + Oven *Oven + func New(p BakeryParams) *Bakery + type BakeryParams struct + Checker FirstPartyCaveatChecker + Key *KeyPair + LegacyMacaroonOp Op + Location string + Locator ThirdPartyLocator + Logger Logger + OpsAuthorizer OpsAuthorizer + RootKeyStore RootKeyStore + type Checker struct + func NewChecker(p CheckerParams) *Checker + func (c *Checker) Auth(mss ...macaroon.Slice) *AuthChecker + type CheckerParams struct + Checker FirstPartyCaveatChecker + Logger Logger + MacaroonVerifier MacaroonVerifier + OpsAuthorizer OpsAuthorizer + type DischargeParams struct + Caveat []byte + Checker ThirdPartyCaveatChecker + Id []byte + Key *KeyPair + Locator ThirdPartyLocator + type DischargeRequiredError struct + Caveats []checkers.Caveat + ForAuthentication bool + Message string + Ops []Op + func (e *DischargeRequiredError) Error() string + type FirstPartyCaveatChecker interface + CheckFirstPartyCaveat func(ctx context.Context, caveat string) error + Namespace func() *checkers.Namespace + type Key [KeyLen]byte + func (k *Key) UnmarshalBinary(data []byte) error + func (k *Key) UnmarshalText(text []byte) error + func (k Key) MarshalBinary() ([]byte, error) + func (k Key) MarshalText() ([]byte, error) + func (k Key) String() string + type KeyPair struct + Private PrivateKey + Public PublicKey + func GenerateKey() (*KeyPair, error) + func MustGenerateKey() *KeyPair + func (k *KeyPair) UnmarshalJSON(data []byte) error + func (k *KeyPair) UnmarshalYAML(unmarshal func(interface{}) error) error + func (key *KeyPair) String() string + type Logger interface + Debugf func(ctx context.Context, f string, args ...interface{}) + Infof func(ctx context.Context, f string, args ...interface{}) + func DefaultLogger(name string) Logger + type Macaroon struct + func Discharge(ctx context.Context, p DischargeParams) (*Macaroon, error) + func NewLegacyMacaroon(m *macaroon.Macaroon) (*Macaroon, error) + func NewMacaroon(rootKey, id []byte, location string, version Version, ns *checkers.Namespace) (*Macaroon, error) + func (m *Macaroon) AddCaveat(ctx context.Context, cav checkers.Caveat, key *KeyPair, loc ThirdPartyLocator) error + func (m *Macaroon) AddCaveats(ctx context.Context, cavs []checkers.Caveat, key *KeyPair, ...) error + func (m *Macaroon) Clone() *Macaroon + func (m *Macaroon) M() *macaroon.Macaroon + func (m *Macaroon) MarshalJSON() ([]byte, error) + func (m *Macaroon) Namespace() *checkers.Namespace + func (m *Macaroon) UnmarshalJSON(data []byte) error + func (m *Macaroon) Version() Version + type MacaroonVerifier interface + VerifyMacaroon func(ctx context.Context, ms macaroon.Slice) ([]Op, []string, error) + type Op struct + Action string + Entity string + func CanonicalOps(ops []Op) []Op + type OpsAuthorizer interface + AuthorizeOps func(ctx context.Context, authorizedOp Op, queryOps []Op) ([]bool, []checkers.Caveat, error) + type Oven struct + func NewOven(p OvenParams) *Oven + func (o *Oven) AddCaveat(ctx context.Context, m *Macaroon, cav checkers.Caveat) error + func (o *Oven) AddCaveats(ctx context.Context, m *Macaroon, caveats []checkers.Caveat) error + func (o *Oven) Key() *KeyPair + func (o *Oven) Locator() ThirdPartyLocator + func (o *Oven) NewMacaroon(ctx context.Context, version Version, caveats []checkers.Caveat, ops ...Op) (*Macaroon, error) + func (o *Oven) VerifyMacaroon(ctx context.Context, ms macaroon.Slice) (ops []Op, conditions []string, err error) + type OvenParams struct + Key *KeyPair + LegacyMacaroonOp Op + Location string + Locator ThirdPartyLocator + Namespace *checkers.Namespace + RootKeyStoreForOps func(ops []Op) RootKeyStore + type PrivateKey struct + func (k PrivateKey) Public() PublicKey + type PublicKey struct + type RootKeyStore interface + Get func(ctx context.Context, id []byte) ([]byte, error) + RootKey func(ctx context.Context) (rootKey []byte, id []byte, err error) + func NewMemRootKeyStore() RootKeyStore + type Slice []*Macaroon + func (ms Slice) DischargeAll(ctx context.Context, ...) (Slice, error) + func (ms Slice) Purge(t time.Time) Slice + func (s Slice) Bind() macaroon.Slice + type ThirdPartyCaveatChecker interface + CheckThirdPartyCaveat func(ctx context.Context, info *ThirdPartyCaveatInfo) ([]checkers.Caveat, error) + type ThirdPartyCaveatCheckerFunc func(context.Context, *ThirdPartyCaveatInfo) ([]checkers.Caveat, error) + func (c ThirdPartyCaveatCheckerFunc) CheckThirdPartyCaveat(ctx context.Context, info *ThirdPartyCaveatInfo) ([]checkers.Caveat, error) + type ThirdPartyCaveatInfo struct + Caveat []byte + Condition []byte + FirstPartyPublicKey PublicKey + Id []byte + Namespace *checkers.Namespace + RootKey []byte + ThirdPartyKeyPair KeyPair + Version Version + type ThirdPartyInfo struct + PublicKey PublicKey + Version Version + type ThirdPartyLocator interface + ThirdPartyInfo func(ctx context.Context, loc string) (ThirdPartyInfo, error) + type ThirdPartyStore struct + func NewThirdPartyStore() *ThirdPartyStore + func (s *ThirdPartyStore) AddInfo(loc string, info ThirdPartyInfo) + func (s *ThirdPartyStore) ThirdPartyInfo(ctx context.Context, loc string) (ThirdPartyInfo, error) + type VerificationError struct + Reason error + func (e *VerificationError) Error() string + type Version int + const LatestVersion + const Version0 + const Version1 + const Version2 + const Version3 Other modules containing this package github.com/go-macaroon-bakery/macaroon-bakery