authz

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	Authorize(context.Context, uuid.UUID, ...string) (bool, error)
}

type Guard

type Guard interface {
	// Check authorizes the Identity ID stored in the context with the given permissions.
	// Therefore, it should be used after the Enforce() middleware.
	Check(...string) Middleware
}

type GuardImpl

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

GuardImpl implements Guard. It stores a IdentityService to use to authorize an identity.

func NewGuard

func NewGuard(authorizer Authorizer) *GuardImpl

func (*GuardImpl) Check

func (g *GuardImpl) Check(permissions ...string) Middleware

type Middleware added in v0.1.19

type Middleware func(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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