Search by

noas / jwt

rdjohou

Zero-dependency native JWT verifier and signer for Noas.

v0.1.0 2026-11-29 01:39 UTC

This package is auto-updated.

Last update: 2026-11-29 01:44:51 UTC


README

Native HS256 signing and verification for Noas, without third-party runtime packages. Bind the transport-independent port explicitly:

use Noas\Jwt\JwtVerifier;
use Noas\Security\TokenVerifierInterface;

$app->container()->bind(
    TokenVerifierInterface::class,
    static fn() => new JwtVerifier($secret),
);

Use an application-managed secret, not a hard-coded production key. Bearer authentication uses Noas\Middleware\BearerTokenMiddleware; HTTP rejections use RFC 9457 Problem Details. The former HTTP token-verifier namespace has no alias. Verified claims are named fields; signed JSON lists are rejected rather than returned outside the port's array-of-named-claims contract.

After composer install, run composer ci with native assertions enabled by the test script. Linting uses the same find/xargs tooling as the framework.