authz

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthnService

type AuthnService interface {
	GetPrincipal(ctx context.Context, via ...authenticate.ClientAssertion) (authenticate.Principal, error)
}

type Authz

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

func New

func New(
	log log.Logger,
	next http.Handler,
	userIDHeaderKey string,
	resourceService ResourceService,
	principalService AuthnService) *Authz

func (Authz) Info

func (c Authz) Info() *middleware.MiddlewareInfo

func (*Authz) ServeHTTP

func (c *Authz) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Config

type Config struct {
	Actions     []string                        `yaml:"actions" mapstructure:"actions"`
	Permissions []Permission                    `yaml:"permissions" mapstructure:"permissions"`
	Attributes  map[string]middleware.Attribute `yaml:"attributes" mapstructure:"attributes"`
}

type Permission

type Permission struct {
	Name      string `yaml:"name" mapstructure:"name"`
	Namespace string `yaml:"namespace" mapstructure:"namespace"`
	Attribute string `yaml:"attribute" mapstructure:"attribute"`
}

type ResourceService

type ResourceService interface {
	CheckAuthz(ctx context.Context, rel relation.Object, permissionName string) (bool, error)
}

Jump to

Keyboard shortcuts

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