authtest

package
v0.0.0-...-994fc53 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(req *http.Request, id, role string, creds jwt.Credentials)

func Test401and403

func Test401and403(opts TestOpts, forbiddenRoles ...string)

Types

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(creds jwt.Credentials) Authenticator

func (Authenticator) Authenticate

func (a Authenticator) Authenticate(req *http.Request, id, role string)

type TestOpts

type TestOpts struct {
	T        *testing.T
	Router   http.Handler
	JWTCreds jwt.Credentials
	Method   string
	Path     string
}

Jump to

Keyboard shortcuts

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