engine

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Reason holds the error reason.
	Reason = "FORBIDDEN"
)

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, claims Claims) context.Context

NewContext injects the provided claims in to the parent context.

Types

type Authorizer

type Authorizer interface {
	// IsAuthorized returns nil if everything is ok
	IsAuthorized(ctx context.Context) error
}

Authorizer interface

type Claims

type Claims interface {
	GetSubject() string
	GetAction() string
	GetResource() string
	GetProject() string
}

Claims interface

func FromContext

func FromContext(ctx context.Context) (claims Claims, ok bool)

FromContext extracts the claims from the provided context (if any).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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