gin_authn

package module
v0.0.0-...-5aac000 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 8 Imported by: 0

README

gin-authn

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAccessTokenExtractor = CompositeExtractor(
	HeaderExtractor("Authorization: Bearer"),
	PostFormExtractor("access_token"),
	QueryExtractor("access_token"))
View Source
var DefaultIdTokenExtractor = HeaderExtractor("X-Id-Token")

Functions

func DenyAll

func DenyAll() gin.HandlerFunc

func OAuth2Aware

func OAuth2Aware(config ...Configuration) gin.HandlerFunc

func ScopesAllowed

func ScopesAllowed(allowedScopes ...string) gin.HandlerFunc

Types

type Configuration

type Configuration struct {
	VerifyToken          bool
	DiscoveryUrl         string
	JwksUrl              string
	AccessTokenExtractor TokenExtractor
	IdTokenExtractor     TokenExtractor
}

type CookieExtractor

type CookieExtractor string

func (CookieExtractor) Extract

func (e CookieExtractor) Extract(c *gin.Context) (string, error)

type HeaderExtractor

type HeaderExtractor string

func (HeaderExtractor) Extract

func (e HeaderExtractor) Extract(c *gin.Context) (string, error)

type PostFormExtractor

type PostFormExtractor string

func (PostFormExtractor) Extract

func (e PostFormExtractor) Extract(c *gin.Context) (string, error)

type QueryExtractor

type QueryExtractor string

func (QueryExtractor) Extract

func (qe QueryExtractor) Extract(c *gin.Context) (string, error)

type TokenExtractor

type TokenExtractor interface {
	Extract(c *gin.Context) (string, error)
}

func CompositeExtractor

func CompositeExtractor(extractor ...TokenExtractor) TokenExtractor

Jump to

Keyboard shortcuts

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