Documentation ¶
Index ¶
- Constants
- Variables
- func BuildJWTAuthHandler(keysURLs []string, caFile, aclFile string, exclude []string, next http.Handler) (handler http.Handler, err error)
- func GetFromClaims(ctx context.Context, keys []string) (string, error)
- func TenantChannelMiddleware(tenantProviderFields []string, onFail error) func(next echo.HandlerFunc) echo.HandlerFunc
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 ¶
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 ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.