authorization

package
v0.0.0-...-6f9a9ad Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTokenSigningMethod invalid token signing method
	ErrInvalidTokenSigningMethod = errors.New("invalid token signing method")
	// ErrMissingRoleName missing role name
	ErrMissingRoleName = errors.New("missing role name")
	// ErrMissingSub missing sub
	ErrMissingSub = errors.New("missing sub")
)

Functions

This section is empty.

Types

type Authorizer

type Authorizer interface {
	Validate(ctx context.Context, token, resource, action string) (bool, string, error)
}

Authorizer defines the authorization methods

func NewAuthorizer

func NewAuthorizer(authRepository repository.Repository, tokenSigningMethod jwt.SigningMethod) Authorizer

NewAuthorizer returna new authorizer entity

Jump to

Keyboard shortcuts

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