Documentation ¶
Index ¶
Constants ¶
const Version int = 1
Version is the internal policy version
Variables ¶
This section is empty.
Functions ¶
func DefaultPolicies ¶
DefaultPolicies returns all the default policies initially created. It is strictly used for testing and memstore.
TODO (tc) This is used for testing and memstore as postgres handles non-deletable policies directly. I think we should consider getting rid of memstore.
func IsNonDeletablePolicy ¶
IsNonDeletablePolicy returns true for UUID strings associated with policies marked as non-deletable and false otherwise.
TODO (tc) This is used for testing and memstore as postgres handles non-deletable policies directly. I think we should consider getting rid of memstore.
Types ¶
type PoliciesLister ¶
PoliciesLister is the interface that wraps the ListPoliciesWithSubjects method used for migrating to v2.
type Policy ¶
type Policy struct { Action string ID uuid.UUID Resource string Subjects []string Effect string CreatedAt time.Time UpdatedAt time.Time Version int }
Policy represents the policy that will be stored.
type Resetter ¶
Resetter is, if exposed, used for tests to reset the storage backend to a pristine state.
type Storage ¶
type Storage interface { StorePolicy(ctx context.Context, action string, subjects []string, resource string, effect string) (*Policy, error) DeletePolicy(ctx context.Context, id string) (*Policy, error) PurgeSubjectFromPolicies(ctx context.Context, subject string) ([]uuid.UUID, error) ListPolicies(ctx context.Context) ([]*Policy, error) PoliciesLister }
Storage is the interface provided by our various storage backends.