jwtplay

package
v0.0.0-...-8faf8f0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: AGPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(c *gin.Context)

CheckToken checks if a token is valid using the `github.com/dgrijalva/jwt-go` package. It also additionally decodes the claims section into plain JSON.

func CheckTokenJWKS

func CheckTokenJWKS(c *gin.Context)

CheckTokenJWKS checks if a token is valid using `github.com/square/go-jose`. It also additionally decodes the claims section into plain JSON.

func CheckTokenManual

func CheckTokenManual(c *gin.Context)

CheckTokenManual manually checks if a JWT token is valid by computing the signature from header and claims sections and confirming that this signature matches the signature section. This assumes token is HS256

func DecodeB64

func DecodeB64(c *gin.Context)

DecodeB64 is a helper to decode Base64 strings

func GetToken

func GetToken(c *gin.Context)

GetToken to obtain JWT token

func GetTokenBody

func GetTokenBody(c *gin.Context)

GetTokenBody to obtain JWT token that's a signed version of request body X-Alg header has the algorithm used

func Init

func Init(r *gin.RouterGroup)

Init sets up authtest router

func SetSecret

func SetSecret(c *gin.Context)

SetSecret sets the secret used to sign the token

Types

This section is empty.

Jump to

Keyboard shortcuts

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