Repository navigation
Conversation
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.
👷 Deploy request for gatsby-auth0-netlify-functions pending review.Visit the deploys page to approve it
|
|
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:
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)`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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
pnpm readypassed 786 tests across 86 files, including all 61 verifier and adapter regression scenarios.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.