Documentation ¶
Index ¶
- Variables
- type AuthzRepository
- type CheckPair
- type Object
- type Relation
- type Repository
- type Service
- func (s Service) BatchCheckPermission(ctx context.Context, relations []Relation) ([]CheckPair, error)
- func (s Service) CheckPermission(ctx context.Context, rel Relation) (bool, error)
- func (s Service) Create(ctx context.Context, rel Relation) (Relation, error)
- func (s Service) Delete(ctx context.Context, rel Relation) error
- func (s Service) Get(ctx context.Context, id string) (Relation, error)
- func (s Service) GetRelationsByFields(ctx context.Context, rel Relation) ([]Relation, error)
- func (s Service) List(ctx context.Context) ([]Relation, error)
- func (s Service) ListRelations(ctx context.Context, rel Relation) ([]Relation, error)
- func (s Service) LookupResources(ctx context.Context, rel Relation) ([]string, error)
- func (s Service) LookupSubjects(ctx context.Context, rel Relation) ([]string, error)
- type Subject
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotExist = errors.New("relation doesn't exist") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrInvalidID = errors.New("relation id is invalid") ErrConflict = errors.New("relation already exist") ErrInvalidDetail = errors.New("invalid relation detail") ErrCreatingRelationInStore = errors.New("error while creating relation") ErrCreatingRelationInAuthzEngine = errors.New("error while creating relation in authz engine") ErrFetchingUser = errors.New("error while fetching user") )
Functions ¶
This section is empty.
Types ¶
type AuthzRepository ¶
type AuthzRepository interface { Check(ctx context.Context, rel Relation) (bool, error) BatchCheck(ctx context.Context, relations []Relation) ([]CheckPair, error) Delete(ctx context.Context, rel Relation) error Add(ctx context.Context, rel Relation) error LookupSubjects(ctx context.Context, rel Relation) ([]string, error) LookupResources(ctx context.Context, rel Relation) ([]string, error) ListRelations(ctx context.Context, rel Relation) ([]Relation, error) }
type Repository ¶
type Repository interface { Get(ctx context.Context, id string) (Relation, error) Upsert(ctx context.Context, relation Relation) (Relation, error) List(ctx context.Context) ([]Relation, error) DeleteByID(ctx context.Context, id string) error GetByFields(ctx context.Context, rel Relation) ([]Relation, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository, authzRepository AuthzRepository) *Service
func (Service) BatchCheckPermission ¶ added in v0.7.4
func (Service) CheckPermission ¶
func (Service) GetRelationsByFields ¶
func (Service) ListRelations ¶
ListRelations lists a set of the relationships matching filter
func (Service) LookupResources ¶
LookupResources returns all the resources of a given type that a subject can access whether via a computed permission or relation membership.
Click to show internal directories.
Click to hide internal directories.