token

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeviceTokenSigningKey = []byte(os.Getenv("TOKEN_SALT"))
View Source
var SlotTokenSigningKey = []byte(os.Getenv("TOKEN_SALT"))

Functions

func ClaimDeviceToken

func ClaimDeviceToken(deviceID string) (string, error)

ClaimToken func

func ClaimSlotToken

func ClaimSlotToken(slotID string) (string, error)

ClaimToken func

func ValidateDeviceToken

func ValidateDeviceToken(myToken string) (bool, string)

ValidateToken func

func ValidateSlotToken

func ValidateSlotToken(myToken string) (bool, string)

ValidateToken func

Types

type DeviceClaims

type DeviceClaims struct {
	DeviceID string `json:"device_id"`
	jwt.StandardClaims
}

DeviceClaims struct

type SlotClaims

type SlotClaims struct {
	SlotID string `json:"Slot_id"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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