token

package
v0.0.0-...-2f1b7bc Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHmacKey

func CreateHmacKey(key crypto.PrivateKey) ([]byte, error)

CreateHmacKey creates a key by signing the seedString

func NewSignedToken

func NewSignedToken(claims *Claims, key []byte) (string, error)

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims

	Name      string `json:"nm,omitempty"`
	Namespace string `json:"nmspc,omitempty"`
	UID       string `json:"uid,omitempty"`
}

func ParseToken

func ParseToken(tokenString string, key []byte) (*Claims, error)

func (*Claims) Valid

func (c *Claims) Valid() error

Jump to

Keyboard shortcuts

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