pasetoclaims

package
v0.0.0-...-836e728 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pasetoclaims provides claim declaration for token generation and verification

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomClaims

type CustomClaims struct {
	WalletAddress string `json:"walletAddress"`
	SignedBy      string `json:"signedBy"`
	pvx.RegisteredClaims
}

CustomClaims defines claims for paseto containing wallet address, signed by and RegisteredClaims

func New

func New(walletAddress string, expiration time.Duration, signedBy string) CustomClaims

New returns CustomClaims with wallet address, signed by and expiration

func (CustomClaims) Valid

func (c CustomClaims) Valid() error

Valid checks if the claims are valid agaist RegisteredClaims and checks if wallet address exist in database

Jump to

Keyboard shortcuts

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