Skip to content

feat: add Hono and NestJS framework adapters#24

Merged
muralx merged 1 commit into
mainfrom
feat/hono-nestjs-adapters
Jun 12, 2026
Merged

feat: add Hono and NestJS framework adapters#24
muralx merged 1 commit into
mainfrom
feat/hono-nestjs-adapters

Conversation

@muralx

@muralx muralx commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Added

  • @authplane/hono — new Hono adapter: authplaneHonoAuth(), bearerAuth middleware (Bearer + DPoP, RFC 9449 §7.1), requireScope guard, and an RFC 9728 PRM handler.
  • @authplane/nestjs — new NestJS adapter: AuthplaneModule.forRoot() / forRootAsync(), AuthplaneAuthGuard, @SkipAuth() / @RequireScopes() decorators, AuthplaneExceptionFilter (RFC 6750 §3), and a PRM controller (RFC 9728). Supports Express and Fastify.
  • @authplane/sdkTokenCache is now bounded by a configurable maxEntries cap (default 10_000) with LRU eviction, via AuthplaneClient.create({ cacheMaxEntries }).
  • @authplane/sdk — new @authplane/sdk/core helpers: extractBearerToken, buildRequestUrl, pathAndQueryOf, extractDpopProof, oauthProtectedResourceMetadataPath.

Changed

  • @authplane/sdkoauthProtectedResourceMetadataDocumentUrl(resource) now normalises trailing slashes (RFC 9728 §3.1) and throws a typed TypeError on invalid URLs. Migration: drop any deliberate trailing slash from resource before upgrading — the canonical form is no-trailing-slash.
  • @authplane/mcp — now accepts a DPoP-bound token presented under the DPoP scheme (RFC 9449 §7.1) instead of rejecting it with 401.
  • @authplane/fastmcp — stricter RFC 6750 §2.1 Authorization parsing, consistent with the other adapters.

Fixed

  • @authplane/mcp — a non-URL aud claim now returns 401 invalid_token (RFC 8707) instead of a 500.

- @authplane/hono and @authplane/nestjs: new framework adapters (Bearer +
  DPoP per RFC 9449 §7.1, RFC 9728 PRM, RFC 6750 §3 challenges).
- @authplane/sdk: bounded TokenCache (configurable maxEntries, LRU) and new
  @authplane/sdk/core helpers; PRM document URL normalises trailing slashes
  (RFC 9728 §3.1).
- @authplane/mcp / @authplane/fastmcp: accept DPoP-scheme Authorization
  headers; mcp returns 401 (not 500) on a non-URL aud claim (RFC 8707).
@muralx
muralx requested a review from a team as a code owner June 10, 2026 19:15

@RobertoIskandarani RobertoIskandarani left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@muralx
muralx merged commit 32d4579 into main Jun 12, 2026
5 checks passed
@muralx
muralx deleted the feat/hono-nestjs-adapters branch June 12, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants