authentication

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JWTMiddleware

func JWTMiddleware(auth Auth) gin.HandlerFunc

Types

type Auth

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

Auth ...

func NewAuth

func NewAuth(config *Config) *Auth

func (*Auth) CacheJWK

func (a *Auth) CacheJWK() error

func (*Auth) JWK

func (a *Auth) JWK() *JWK

func (*Auth) JWKURL

func (a *Auth) JWKURL() string

func (*Auth) ParseJWT

func (a *Auth) ParseJWT(tokenString string) (jwt.MapClaims, error)

type Config

type Config struct {
	CognitoRegion     string
	CognitoUserPoolID string
}

Config ...

type JWK

type JWK struct {
	Keys []struct {
		Alg string `json:"alg"`
		E   string `json:"e"`
		Kid string `json:"kid"`
		Kty string `json:"kty"`
		N   string `json:"n"`
	} `json:"keys"`
}

JWK ...

Jump to

Keyboard shortcuts

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