Search by

sugarcraft / sugar-jwt

detain

JWT and JWK verification for SugarCraft: signature and claim checks for JSON Web Tokens and key sets, shared by the channel bundles instead of per-bundle copies.

dev-master 2026-11-19 12:49 UTC

This package is auto-updated.

Last update: 2026-11-20 01:04:08 UTC


README

JWT and JWK verification for SugarCraft. This package is a skeleton: its namespace and wiring exist, and the verification classes arrive in later changes.

Original work. There is no upstream port, so no Mirrors charmbracelet/... citation applies.

composer require sugarcraft/sugar-jwt

Requires PHP ≥ 8.3. The package has no runtime dependencies beyond PHP, and it does not depend on any other SugarCraft package.

The role of this library is to verify JSON Web Tokens and the JSON Web Key sets that sign them. The channel bundles (candy-msteams, and the channel-bridge validator it replaces) carry this code today in their own copies: the Teams token validator, the JWK reader with its hand-written DER handling, and the JWT validator. Those copies move here in a later step, so every bundle shares one tested verifier instead of keeping a private one.

Namespace: SugarCraft\Jwt\. Source lives in src/, and tests in tests/.