authorizes

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAccessDenied = accessDenied{}

Functions

func Action added in v0.30.2

func Action(
	handler miruken.Handler,
	action any,
	constraints ...any,
) (bool, *promise.Promise[bool], error)

Action performs authorization on `action`.

Types

type Access

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

Access is a FilterProvider for authorization.

func (*Access) AppliesTo

func (a *Access) AppliesTo(
	callback miruken.Callback,
) bool

func (*Access) Filters

func (a *Access) Filters(
	binding miruken.Binding,
	callback any,
	composer miruken.Handler,
) ([]miruken.Filter, error)

func (*Access) InitWithTag

func (a *Access) InitWithTag(tag reflect.StructTag) error

func (*Access) Policy added in v0.30.2

func (a *Access) Policy() any

func (*Access) Required

func (a *Access) Required() bool

type Builder

type Builder struct {
	miruken.CallbackBuilder
	// contains filtered or unexported fields
}

Builder builds It callbacks.

func (*Builder) ForAction added in v0.30.2

func (b *Builder) ForAction(
	action any,
) *Builder

func (*Builder) New

func (b *Builder) New() *It

func (*Builder) WithSubject

func (b *Builder) WithSubject(
	subject security.Subject,
) *Builder

type It

type It struct {
	miruken.CallbackBase
	// contains filtered or unexported fields
}

It authorizes callbacks contravariantly.

func (*It) Dispatch

func (a *It) Dispatch(
	handler any,
	greedy bool,
	composer miruken.Handler,
) miruken.HandleResult

func (*It) Key

func (a *It) Key() any

func (*It) Policy

func (a *It) Policy() miruken.Policy

func (*It) Source

func (a *It) Source() any

func (*It) String

func (a *It) String() string

type Options

type Options struct {
	RequirePolicy bool
}

Options control the authorization process.

Jump to

Keyboard shortcuts

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