Documentation ¶
Overview ¶
Package tokenutils contains various utilities used to interact with Aporeto JWTs.
Index ¶
- Constants
- func ExtractQuota(token string) (int, error)
- func ExtractRestrictions(token string) (ns string, perms []string, networks []string, err error)
- func SigAlg(token string) (string, error)
- func Snip(err error, token string) error
- func UnsecureClaimsMap(token string) (claims map[string]interface{}, err error)
- type Audience
- type AudiencesList
Constants ¶
const AudienceAny = "*"
AudienceAny represents any operation, identity or namespace.
Variables ¶
This section is empty.
Functions ¶
func ExtractQuota ¶
ExtractQuota extracts the eventual quota from a token. Not that the token is not verified in the process, you the verification must be done before trusting the extracted quota value.
func ExtractRestrictions ¶ added in v1.77.1
ExtractRestrictions extracts the eventual authz restrictions embded in the token.
func UnsecureClaimsMap ¶
UnsecureClaimsMap decodes the claims in the given JWT token without verifying its validity. Only use or trust this after proper validation.
Types ¶
type AudiencesList ¶
type AudiencesList []Audience
AudiencesList is a list of audiences.
func ParseAudience ¶
func ParseAudience(audString string, modelManager elemental.ModelManager) (AudiencesList, error)
ParseAudience parses the audience string and returns an AudiencesList.
func UnsecureAudience ¶
func UnsecureAudience(token string, modelManager elemental.ModelManager) (AudiencesList, error)
UnsecureAudience extracts the audience list from a token string without verifying its validity. Only use or trust this after proper validation.
func (AudiencesList) String ¶
func (a AudiencesList) String() string