httpcontext

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(r *http.Request) (string, error)

GetAccessToken is used to fetch an access token from request context

func GetIsOAuth

func GetIsOAuth(r *http.Request) (bool, error)

GetIsOAuth is used to fetch if used is auth from request context

func GetJWT

func GetJWT(r *http.Request) (string, error)

GetJWT is used to fetch a JWT token from request context

func GetRequestedProject

func GetRequestedProject(r *http.Request) (string, error)

Types

type Key

type Key string

Key is a special type used as a context key

const (
	// JWT is the key used to read a JWT value from a context
	JWT Key = "JWT"
	// AccessToken is the key used to read an AccessToken value from a context
	AccessToken Key = "AccessToken"
	// IsOAuth is the key used to check if user is auth from a context
	IsOAuth Key = "IsOAuth"
	// RequestedProject is the key used to check requested project from a context
	RequestedProject Key = "RequestedProject"
	User             Key = "User"
)

Jump to

Keyboard shortcuts

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