Versions in this module Expand all Collapse all v1 v1.0.0 Oct 10, 2026 Changes in this version + var ErrApprovalRequired = errors.New("transaction requires an independent approval decision") + var ErrDenied = errors.New("spending policy denied transaction") + var ErrIdentityConflict = errors.New("policy idempotency identity already has different transaction details") + func Allowed(list []string, id string) bool + func Apply(a *model.PolicyAdmission, t *model.Transaction) + func Integer(s string) (*big.Int, error) + func Internal(ctx context.Context) context.Context + func Intersect(key string, policies []model.KeyPolicy) *model.KeyPolicy + func IsInternal(ctx context.Context) bool + func RuleKey(currency string, precision float64) string + func Validate(p model.KeyPolicy) error + func ValidateNarrowing(child model.KeyPolicy, parent *model.KeyPolicy) error + func WithPrincipal(ctx context.Context, p Principal) context.Context + type Engine struct + Store Store + func (e Engine) Admit(ctx context.Context, identity string, legs []model.PolicyLeg) (*model.PolicyAdmission, error) + type Principal struct + APIKeyID string + Master bool + Scopes []string + func FromContext(ctx context.Context) Principal + func (p Principal) CanApprove() bool + func (p Principal) CanManagePolicies() bool + type Store interface + AdmitPolicy func(context.Context, string, string, []model.PolicyLeg) (*model.PolicyAdmission, error) + CheckPolicyCommit func(context.Context, string) error + DecidePolicyApproval func(context.Context, string, Principal, bool) (*model.PolicyAdmission, error) + DeleteKeyPolicy func(context.Context, string) error + GetKeyPolicy func(context.Context, string) (*model.KeyPolicy, error) + ListPolicyApprovals func(context.Context, string) ([]model.PolicyAdmission, error) + PolicyCapacity func(context.Context, string) ([]model.PolicyCapacity, error) + PolicyHoldIDs func(context.Context, string) ([]string, error) + PutKeyPolicy func(context.Context, model.KeyPolicy) (*model.KeyPolicy, error) + ReleasePolicyLeg func(context.Context, string) error + VerifyPolicyLeg func(context.Context, *model.Transaction) (*model.PolicyAdmission, error)