Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // this error is returned when an implementation of policy storage // interface is required but nil was provided instead ErrNilPolicyStorage = errors.New("nil policy storage") // policy storage returns this error when update policy for the resource type // is requested but the resource type is not supported by the service ErrUnsupportedRtype = errors.New("unsupported resource type") // policy storage returns this error when update policy for the sub // is requested but the sub is not found in the local storage ErrSubNotCached = errors.New("sub is not cached") // this errors is returned when policy is of invalid type ErrInvalidPolicy = errors.New("invalid policy") )
Functions ¶
This section is empty.
Types ¶
type PolicyEnforcer ¶
type PolicyEnforcer interface { Enforce(ctx context.Context, s string, matcher matcherFunc) bool GetResourceIDs(ctx context.Context, sub, rtype, act string) []string }
func NewPolicyEnforcer ¶
func NewPolicyEnforcer(ps PolicyStorage) (PolicyEnforcer, error)
type PolicyStorage ¶
type PolicyStorage interface { GetPolicyForSub(ctx context.Context, sub string) []Policy UpdatePolicy(method, sub, rtype, rid, act string) error }
func NewCachedPolicyStorageMW ¶
func NewCachedPolicyStorageMW(url string, rtype []string, c *cache.Cache) (PolicyStorage, error)
type PolicyStorageMW ¶
type PolicyStorageMW func(PolicyStorage) PolicyStorage
Click to show internal directories.
Click to hide internal directories.