Skip to content

feat!: replace the jwt verifier and expand framework integrations - #13

Open
botdrino wants to merge 1 commit into
sandrinodm:masterfrom
botdrino:feat/portable-verifier-v1
Open

botdrino wants to merge 1 commit into
sandrinodm:masterfrom
botdrino:feat/portable-verifier-v1

Conversation

@botdrino

Copy link
Copy Markdown

Summary

Replace the 0.2.1 verifier with a portable access-token verifier and 13 framework and platform integrations. Each adapter extracts credentials from its native request, verifies them through the shared core, and passes signed claims and mapped identity to the handler.

- new JwtVerifier(options).verifyAccessToken(token)
+ const verifier = createJwtVerifier(options)
+ const auth = await verifier.verify(token)

The core enforces issuer, audience, expiration and algorithm policy, bounds key discovery and verification work, and gives callers separate responses for rejected credentials and issuer outages. The pnpm workspace adds conformance tests, packed-consumer checks and release workflows. The guides cover the current API and host-specific limits.

Evidence

  • Before — The upstream tree contains four public packages at 0.2.1. After — All 14 public packages passed isolated tarball consumer checks during preparation.
  • pnpm ready passed 786 tests across 86 files, including all 61 verifier and adapter regression scenarios.
  • The standalone example verified valid, missing, invalid, insufficient-scope and duplicate credentials. Generated documentation and offline links passed their final checks.

Merge Danger

Two-way before publication. A revert can restore the previous source tree. Publishing 1.0 is a separate release action.

Blast radius — all consumers. The verifier API, claim mapping and error hooks change, and Node consumers need Node 24 or later. The hosted nightly matrix, including Floci200, still requires CI verification.

Use one portable verification core so serverless, edge and Node applications enforce consistent issuer, audience and scope checks. Provide framework-specific request handling, conformance tests and exact-package release checks for the new public APIs.
@netlify

netlify Bot commented Nov 21, 2026

Copy link
Copy Markdown

👷 Deploy request for gatsby-auth0-netlify-functions pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit f31d140

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

assert.equal(statement._type, 'https://in-toto.io/Statement/v1');
assert.equal(statement.predicateType, 'https://slsa.dev/provenance/v1');
assert.deepEqual(statement.subject, [
{ name: `pkg:npm/${name.replace('@', '%40')}@${version}`, digest: { sha512 } },
return { ok: false, reason: 'multiple_credentials' };
}

const trimmed = header.replace(/^ +| +$/g, '');
};
app.decorate('authenticate', authenticate);
if (options.global === true) {
app.addHook('onRequest', authenticate);
audience: 'api',
mapClaims: () => ({ subject: 'one' }),
});
app.use('/api', middleware);
Comment on lines +180 to +187
app.use(async (request, response, next) => {
await observe(request, response);
try {
await middleware(request, response, next);
} finally {
settled(request, response);
}
});
Comment on lines +32 to +34
referenceMiddleware(options, handler, (request) =>
signals.get(request.get('x-test-request-id') ?? ''),
),
Comment on lines +155 to +157
referenceMiddleware(options, (auth) =>
Response.json({ sub: auth?.claims.sub, scopes: auth?.scopes }),
),
Comment on lines +18 to +22
jwt({
issuer: process.env.ISSUER ?? 'https://issuer.example',
audience: 'https://resource.example',
...(process.env.JWKS_URI ? { jwksUri: process.env.JWKS_URI } : {}),
}),
for (const stream of ['stdout', 'stderr']) {
test('real logging child rejects unknown JWT split across ' + stream + ' chunks', async () => {
const result = await evidence(
`process.${stream}.write(${JSON.stringify(synthetic.slice(0, 23))}); setTimeout(() => process.${stream}.write(${JSON.stringify(synthetic.slice(23))}), 10)`,
const directory = mkdtempSync(join(tmpdir(), 'jwt-private-descendant-'));
const path = join(directory, 'child.log');
const ready = join(directory, 'ready');
const descendant = `process.on('SIGTERM',()=>{}); require('node:fs').writeFileSync(${JSON.stringify(ready)},'ready'); setInterval(()=>{},1000)`;
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