notebookjwt

package
v0.59.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package notebookjwt mints + verifies short-lived HMAC-SHA256 tokens for the agentserver web notebook proxy. Claims: user_id, workspace_id, exp. Format mirrors internal/codexappgateway/captoken.go (JWT-shape, base64url-no-pad).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mint

func Mint(secret []byte, userID, workspaceID string, ttl time.Duration) (string, error)

Mint produces a token valid for ttl from now.

Types

type Claims

type Claims struct {
	UserID      string `json:"user_id"`
	WorkspaceID string `json:"workspace_id"`
	Exp         int64  `json:"exp"`
}

Claims are what callers get back from Verify.

func Verify

func Verify(secret []byte, tok string) (*Claims, error)

Verify parses, checks signature + expiry, returns claims.

Jump to

Keyboard shortcuts

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