authorization

package
v0.0.0-...-8094d75 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthorization

func CheckAuthorization(endpoint func(http.ResponseWriter, *http.Request)) http.Handler

CheckAuthorization checks if user is authorized (valid JWT Token available)

func CreateJWTToken

func CreateJWTToken(userid int, userrole int, configuration structs.Configuration) (string, error)

CreateJWTToken creates a JWT Token with User ID and User Role

func ParseUserIDAndRole

func ParseUserIDAndRole(request *http.Request) (int, int, error)

ParseUserIDAndRole parses User ID and Role from JWT Token

Types

This section is empty.

Jump to

Keyboard shortcuts

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