signedtoken

package
v1.340.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package signedtoken signs and verifies Credimi's own tokens: base64url(json).base64url(hmac), with a key derived from the users collection's auth token secret and a label naming the token kind, so rotating that secret revokes every token and a token of one kind is never accepted as another.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsigned = errors.New("token not signed by Credimi")

ErrUnsigned rejects a token Credimi did not sign with the expected key.

Functions

func Sign

func Sign(app core.App, label string, v any) (string, error)

Sign returns the token base64url(json).base64url(hmac) of v, signed with the key of label.

func Verify

func Verify(app core.App, label, token string, v any) error

Verify decodes into v a token signed with the key of label. It returns ErrUnsigned for a token that is malformed or signed otherwise, and other errors when the key cannot be derived.

Types

This section is empty.

Jump to

Keyboard shortcuts

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