mw

package
Version: v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mw contains middlewares.

Index

Constants

View Source
const VerificationTokenHeader = "Verification-Token"

VerificationTokenHeader defines a verification token name that should be passed in request headers.

Variables

This section is empty.

Functions

func Logging

func Logging(next http.Handler) http.Handler

Logging logs the incoming request.

Types

type Auth

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

Auth defines an authorization middleware of the Database Lab HTTP server.

func NewAuth

func NewAuth(verificationToken string, personalTokenVerifier platform.PersonalTokenVerifier) *Auth

NewAuth creates a new Auth middleware.

func (*Auth) Authorized

func (a *Auth) Authorized(h http.HandlerFunc) http.HandlerFunc

Authorized checks if the user has permission to access.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL