authorization

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthModel = `` /* 710-byte string literal not displayed */
View Source
var ErrInvalidAuthModel = fmt.Errorf("Invalid authorization model schema")

Functions

This section is empty.

Types

type Authorizer

type Authorizer struct {
	Client AuthzClientInterface
	// contains filtered or unexported fields
}

func (*Authorizer) Check

func (a *Authorizer) Check(ctx context.Context, user string, relation string, object string) (bool, error)

func (*Authorizer) FilterObjects

func (a *Authorizer) FilterObjects(ctx context.Context, user string, relation string, objectType string, objs []string) ([]string, error)

func (*Authorizer) ListObjects

func (a *Authorizer) ListObjects(ctx context.Context, user string, relation string, objectType string) ([]string, error)

func (*Authorizer) ValidateModel

func (a *Authorizer) ValidateModel(ctx context.Context) error

type AuthorizerInterface

type AuthorizerInterface interface {
	ListObjects(context.Context, string, string, string) ([]string, error)
	Check(context.Context, string, string, string) (bool, error)
	FilterObjects(context.Context, string, string, string, []string) ([]string, error)
	ValidateModel(context.Context) error
}

type AuthzClientInterface

type AuthzClientInterface interface {
	ListObjects(context.Context, string, string, string) ([]string, error)
	Check(context.Context, string, string, string) (bool, error)
	ReadModel(context.Context) (*fga.AuthorizationModel, error)
	CompareModel(context.Context, fga.AuthorizationModel) (bool, error)
}

Jump to

Keyboard shortcuts

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