synthesis

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forbid added in v0.6.0

func Forbid(_ http.HandlerFunc, _ ...string) http.HandlerFunc

Forbid is special function to disable specific http.HandlerFunc on a route. It is useful to programmatically shutoff access to the specific resource.

func NoAuth

func NoAuth(h http.HandlerFunc, _ ...string) http.HandlerFunc

NoAuth is a dummy function to bypass http.HandlerFunc. It is useful to route unprotected resources.

func UnAuth added in v0.6.0

func UnAuth(_ http.HandlerFunc, _ ...string) http.HandlerFunc

UnAuth is special function to disable specific route with 401 status code. It is useful to programmatically shutoff access to the specific resource.

Types

type AuthWrapper

type AuthWrapper func(http.HandlerFunc, ...string) http.HandlerFunc

AuthWrapper is wrapper function for http.HandlerFunc, for whom not using httprouter. It receives single http.HandlerFunc function and returns http.HandlerFunc. Users can define how traffics are evaluated inside the wrapper and what is returned.

func AuthAND

func AuthAND(auth1 AuthWrapper, auth2 AuthWrapper) AuthWrapper

AuthAND realizes function synthesis (AND pipeline) for two filter.AuthWrapper. Two authentication wrappers (auth1 and auth2) are applied for inbound traffic in the order, and finally returns httprouter.Handle for route for valid traffics. (experimental)

func AuthAll

func AuthAll(auth ...AuthWrapper) AuthWrapper

AuthAll realizes two or more AuthWrapper pipeline with AND condition. (experimental)

func AuthOR

func AuthOR(auth1 AuthWrapper, auth2 AuthWrapper) AuthWrapper

AuthOR (experimental)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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