authz

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 19 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, relationAdapter RelationTransformer, 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]proxyattr.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 RelationTransformer added in v0.6.5

type RelationTransformer interface {
	TransformRelation(ctx context.Context, rlt relation.RelationV2) (relation.RelationV2, error)
}

type ResourceService

type ResourceService interface {
	Upsert(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