middlewares

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationMiddleware

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

A middleware that checks for a valid session and passes the authorization status as well as the user to the next middleware/handler.

func (*AuthorizationMiddleware) Register

func (middleware *AuthorizationMiddleware) Register(db database.Database, config *config.Config, store *session.Store, router fiber.Router)

Registers this middleware to the passed router and injects all needed dependencies.

type TokenMiddleware

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

A middleware that checks for an authorization header and extracts the token in it.

The token is then validated and if it's valid, the authorization middleware is skipped.

func (*TokenMiddleware) Register

func (middleware *TokenMiddleware) Register(db database.Database, config *config.Config, store *session.Store, router fiber.Router)

Registers this middleware to the passed router and injects all needed dependencies.

Jump to

Keyboard shortcuts

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