middleware

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogIdentity

func LogIdentity() func(http.Handler) http.Handler

LogIdentity checks for Service Auth or Florence Token and logs the embedded User Identity if present.

Types

type Permissions

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

Permissions is the middleware for checking the caller has the required permissions (CRUD) for the given route

func NewPermissions

func NewPermissions(zebedeeURL string, enabled bool) *Permissions

NewPermissions returns a new Permissions middleware struct.

func (*Permissions) Require

func (p *Permissions) Require(required auth.Permissions) func(http.Handler) http.Handler

Require is the middleware handler you wrap around each route, providing which permissions level is required for the call.

func (*Permissions) RequireCreate

func (p *Permissions) RequireCreate(next http.HandlerFunc) http.HandlerFunc

RequireCreate is a helper function for directly adding a 'Create' requirement to a given route

func (*Permissions) RequireDelete

func (p *Permissions) RequireDelete(next http.HandlerFunc) http.HandlerFunc

RequireDelete is a helper function for directly adding a 'Delete' requirement to a given route

func (*Permissions) RequireRead

func (p *Permissions) RequireRead(next http.HandlerFunc) http.HandlerFunc

RequireRead is a helper function for directly adding a 'Read' requirement to a given route

func (*Permissions) RequireUpdate

func (p *Permissions) RequireUpdate(next http.HandlerFunc) http.HandlerFunc

RequireUpdate is a helper function for directly adding a 'Update' requirement to a given route

Jump to

Keyboard shortcuts

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