auth

package
v0.0.0-...-0c11bd6 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TenantCtxKey string = "tenant"

Variables

View Source
var NoJWTError = errors.New("request doesn't contain JWT")
View Source
var NoKeyError = errors.New("cannot find key in jwt claims")

Functions

func BuildJWTAuthHandler

func BuildJWTAuthHandler(keysURLs []string, caFile, aclFile string, exclude []string, next http.Handler) (handler http.Handler, err error)

When using this handler for auth, it should be run as high up as possible. Exceptions can be registered in the `exclude` slice

func GetFromClaims

func GetFromClaims(ctx context.Context, keys []string) (string, error)

GetFromClaims returns a value of JWT claim with the specified key

Caller can specify multiple keys. The value of first one that exists and is non-empty is returned.

If no claim is found, NoKeyError is returned

func TenantChannelMiddleware

func TenantChannelMiddleware(tenantProviderFields []string, onFail error) func(next echo.HandlerFunc) echo.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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