middleware

package
v0.0.0-...-5a62e24 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2017 License: GPL-3.0 Imports: 4 Imported by: 4

Documentation

Overview

Package middleware offers pluggable capabilities of varying purpose such as session authentication checks. They can be placed in the call stack of any HTTP handler routine so that they are called prior to advancing to the main work of each handler function, keeping them small.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorized

func Authorized(jwtGetter JWTSigningSecretGetter) gin.HandlerFunc

Authorized is run as a middleware in every callstack of an HTTP service endpoint that requires authentication. It looks for, parses, and validates the JWT supplied by requesting client.

func CookieRemoveRedirect

func CookieRemoveRedirect(c *gin.Context)

CookieRemoveRedirect deletes this application's authentication cookie and redirects to index page.

func NotAuthorized

func NotAuthorized() gin.HandlerFunc

NotAuthorized ensures that only clients with no 'Protokollamt' cookie present continue to the index page again. This allows to directly redirect to restricted pages if a correctly named cookie is found. Its validity is checked on a restricted page.

Types

type JWTSigningSecretGetter

type JWTSigningSecretGetter interface {
	GetJWTSigningSecret() string
}

JWTSigningSecretGetter defines the one method needed to obtain initially set JWT signing secret.

Jump to

Keyboard shortcuts

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