jwtauth

package
v0.0.0-...-5559093 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package jwtauth is an authentication function to be used by the httpauth package

it has a background runner and channel plus caching for authentication request

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthCheckFunc

func AuthCheckFunc(logger *zap.Logger, authChan chan *AuthRequest) httpauth.AuthProvider

AuthCheckFunc returns a authentication check function for use with `httpauth.BasicAuth()“

func AuthRunner

func AuthRunner(ctx context.Context, logger *zap.Logger, verifier jwt.Verifier, authChan chan *AuthRequest)

AuthRunner is the routine that runs the authentication checking channels

Types

type AuthRequest

type AuthRequest struct {
	Token         []byte
	ReturnChannel chan *AuthResponse
}

AuthRequest is the authentication request and a return channel for the response.

type AuthResponse

type AuthResponse struct {
	Result jwt.VerifyResult
	Error  error
}

AuthResponse is contains the response for a `AuthRequest`

Jump to

Keyboard shortcuts

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