engine

package
v0.0.0-...-275d326 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProjectList

func ProjectList(projects ...string) []string

Types

type Action

type Action string

type Authorizer

type Authorizer interface {
	ProjectsAuthorized(ctx context.Context, subjects Subjects, action Action, resource Resource, projects Projects) ([]string, error)

	FilterAuthorizedPairs(ctx context.Context, subjects Subjects, pairs []Pair) ([]Pair, error)

	FilterAuthorizedProjects(ctx context.Context, subjects Subjects) ([]string, error)
}

type Engine

type Engine interface {
	Authorizer
	Writer
}

type Pair

type Pair struct {
	Resource Resource `json:"resource"`
	Action   Action   `json:"action"`
}

func MakePair

func MakePair(res, act string) Pair

type Project

type Project string

type Projects

type Projects []string

type Resource

type Resource string

type Subjects

type Subjects []string

func SubjectList

func SubjectList(subs ...string) Subjects

type Writer

type Writer interface {
	SetPolicies(ctx context.Context, policyMap map[string]interface{}, roleMap map[string]interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL