authz

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authz

type Authz struct {
	// contains filtered or unexported fields
}

func New

func New(log log.Logger, next, escape hook.Service, resourceService ResourceService, relationService RelationService, identityProxyHeaderKey string) Authz

func (Authz) Info

func (a Authz) Info() hook.Info

func (Authz) ServeHook

func (a Authz) ServeHook(res *http.Response, err error) (*http.Response, error)

type Config

type Config struct {
	Action     string                    `yaml:"action" mapstructure:"action"`
	Attributes map[string]hook.Attribute `yaml:"attributes" mapstructure:"attributes"`
	Relations  []Relation                `yaml:"relations" mapstructure:"relations"`
}

type ProjectService

type ProjectService interface {
	Get(ctx context.Context, id string) (project.Project, error)
}

type Relation

type Relation struct {
	Role               string `yaml:"role" mapstructure:"role"`
	SubjectPrincipal   string `yaml:"subject_principal" mapstructure:"subject_principal"`
	SubjectIDAttribute string `yaml:"subject_id" mapstructure:"subject_id_attribute"`
}

type RelationService

type RelationService interface {
	Create(ctx context.Context, relation relation.RelationV2) (relation.RelationV2, error)
}

type ResourceService

type ResourceService interface {
	Create(ctx context.Context, resource resource.Resource) (resource.Resource, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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