jwthandling

package
v0.0.0-...-229fae0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateNewManagementUserToken

func GenerateNewManagementUserToken(expiresIn time.Duration, id string, instanceID string, isAdmin bool, payload map[string]string, secretKey string) (tokenString string, err error)

func GenerateNewParticipantUserToken

func GenerateNewParticipantUserToken(
	expiresIn time.Duration,
	id string,
	instanceID string,
	profileID string,
	payload map[string]string,
	accountConfirmed bool,
	tempTokenInfos *userTypes.TempToken,
	otherProfileIDs []string,
	secretKey string,
	lastOTPProvided map[string]int64,
) (tokenString string, err error)

Types

type ManagementUserClaims

type ManagementUserClaims struct {
	InstanceID string            `json:"instance_id,omitempty"`
	IsAdmin    bool              `json:"is_admin,omitempty"`
	Payload    map[string]string `json:"payload,omitempty"`
	jwt.RegisteredClaims
}

Information a token enocodes

func ValidateManagementUserToken

func ValidateManagementUserToken(tokenString string, secretKey string) (claims *ManagementUserClaims, valid bool, err error)

type ParticipantUserClaims

type ParticipantUserClaims struct {
	InstanceID       string               `json:"instance_id,omitempty"`
	ProfileID        string               `json:"profile_id,omitempty"`
	Payload          map[string]string    `json:"payload,omitempty"`
	AccountConfirmed bool                 `json:"accountConfirmed,omitempty"`
	TempTokenInfos   *userTypes.TempToken `json:"temptoken,omitempty"`
	OtherProfileIDs  []string             `json:"other_profile_ids,omitempty"`
	LastOTPProvided  map[string]int64     `json:"last_otp_provided,omitempty"`
	jwt.RegisteredClaims
}

Information a token enocodes

func ValidateParticipantUserToken

func ValidateParticipantUserToken(tokenString string, secretKey string) (claims *ParticipantUserClaims, valid bool, err error)

Jump to

Keyboard shortcuts

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