jwtutil

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package jwtutil provides minimal HS256 JWT creation and validation for internal auth (API bearer tokens and view-link tokens). No external deps — uses only stdlib crypto/hmac, sha256, base64, and encoding/json.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Make

func Make(secret, sub, aud string, ttl time.Duration) (string, error)

Make creates a signed HS256 JWT with the given subject, audience and TTL.

func Validate

func Validate(token, secret, expectedAud string) (string, error)

Validate verifies the HS256 signature, expected audience, and expiry. Returns the sub claim on success.

Types

This section is empty.

Jump to

Keyboard shortcuts

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