securetoken

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec struct {
	// contains filtered or unexported fields
}

Codec provides a means of encoding and decoding values to URL-friendly opaque tokens that clients cannot decode or tamper with. It encodes values using JSON before encrypting them, and uses base64 URL encoding for serializing the encrypted bytes to the token string. It's implemented as a thin wrapper around gorilla/securecookie, which already provides the necessary functionality.

func NewCodec

func NewCodec(keyPairs [][]byte) *Codec

func NewRandom

func NewRandom() *Codec

func (*Codec) Decode

func (c *Codec) Decode(value string, dst any) error

func (*Codec) Encode

func (c *Codec) Encode(value any) (string, error)

Jump to

Keyboard shortcuts

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