jwt

package
v6.6.10 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package jwt provides means of obtaining more info from JWT tokens

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Claims

func Claims(token string) (map[string]interface{}, error)

Claims retrieves claims payload off a JWT token

func ContractNumber added in v6.6.6

func ContractNumber(claims map[string]interface{}) (int64, error)

ContractNumber extracts contract number from JWT token claims

func Headers

func Headers(token string) (map[string]interface{}, error)

Headers retrieves headers off a JWT token

func Kid added in v6.6.6

func Kid(headers map[string]interface{}) (string, error)

Kid extracts TokenId from JWT token headers

func Privileges added in v6.6.6

func Privileges(claims map[string]interface{}) ([]string, error)

Privileges extracts privileges from JWT token claims

func Role added in v6.6.6

func Role(claims map[string]interface{}) (string, error)

Role extracts role from JWT token claims

func Username

func Username(token string) (string, error)

Username retrieves user email using the identity found in the JWT token claims; and using CloudAPI User Management API to query the found UUID. Note that the UUID can only be queried if its respective user is managed by (or is) the user with that JWT

func Uuid added in v6.6.6

func Uuid(claims map[string]interface{}) (string, error)

Uuid extracts UserId from JWT token claims

Types

This section is empty.

Jump to

Keyboard shortcuts

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