middleware

package
v1.13.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProjectCreationMiddleware

func ProjectCreationMiddleware(next http.Handler) http.Handler

Types

type Authorizer

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

func NewAuthorizer

func NewAuthorizer(enforcer enforcer.Enforcer) *Authorizer

func (*Authorizer) AuthorizationMiddleware

func (a *Authorizer) AuthorizationMiddleware(next http.Handler) http.Handler

AuthorizationMiddleware is a middleware that checks if the request is authorized.

func (*Authorizer) GetPermission added in v1.10.0

func (a *Authorizer) GetPermission(requestPath string, requestMethod string) string

GetPermission returns the permission required to authorized a request. It's assumed that permission to request is a one to one mapping.

func (*Authorizer) RequireAuthorization added in v1.10.0

func (a *Authorizer) RequireAuthorization(requestPath string, requestMethod string) bool

RequireAuthorization returns true if the request requires authorization.

type Operation added in v1.10.0

type Operation struct {
	RequestPath   string
	RequestMethod []string
}

Jump to

Keyboard shortcuts

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