auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyAuth

type APIKeyAuth struct {
	PermissionList map[string][]string // Map of route -> permission mappings
	AdminKeys      bool                // True when the authorizer checks admin keys instead of account keys
}

APIKeyAuth is a middleware that automatically verifies given API key

func (*APIKeyAuth) Authenticate

func (a *APIKeyAuth) Authenticate(req *http.Request, route string) (middleware.AuthStatus, context.Context, error)

Authenticate will check if an API key matches the request

type JwtAuth

type JwtAuth struct{}

JwtAuth is a middleware that automatically verifies given JWT token

func (*JwtAuth) Authenticate

func (mw *JwtAuth) Authenticate(req *http.Request, _ string) (middleware.AuthStatus, context.Context, error)

Authenticate will check if an API key matches the request

type OnBehalfJwtAuth

type OnBehalfJwtAuth struct{}

OnBehalfJwtAuth is a middleware that automatically verifies given JWT token

func (*OnBehalfJwtAuth) Authenticate

Authenticate will check if an API key matches the request

Jump to

Keyboard shortcuts

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