jwtutils

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAudiencesFromJWT

func GetAudiencesFromJWT(rlog log.Ext1FieldLogger, token string) ([]string, bool)

GetAudiencesFromJWT parses the passed jwt token and returns the aud claim as a slice of strings

func GetStringFromJWT

func GetStringFromJWT(rlog log.Ext1FieldLogger, token, key string) (string, bool)

GetStringFromJWT returns a string value for the given key

func GetValueFromJWT added in v0.4.0

func GetValueFromJWT(rlog log.Ext1FieldLogger, token, key string) interface{}

GetValueFromJWT returns the value for the given key

Types

type ResultSet

type ResultSet []struct {
	Value interface{}
	Set   bool
}

ResultSet is a slice of values with an additional value indicating if it was set

func GetFromJWT

func GetFromJWT(rlog log.Ext1FieldLogger, token string, key ...string) (values ResultSet)

GetFromJWT returns the values for the requested keys from the JWT

Jump to

Keyboard shortcuts

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