Repository navigation
Release rootcap 1.1.0: Node 26, widget fixes and trusted publishing #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kirasync2748
merged 4 commits into
main
from
coderabbit/upgrade-rootcap-node26-release/167396d6
Nov 1, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
46bf034
feat: prepare rootcap 1.1.0 for Node 26 and trusted publishing
kirasync2748 c94d167
fix: address HTTP and accessibility review findings
kirasync2748 7e4295d
fix: hide demo result when widget resets
kirasync2748 3347d69
fix: harden challenge limits and demo reset handling
kirasync2748 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Publish | ||
| on: | ||
| push: | ||
| tags: ["v*.*.*"] | ||
| permissions: | ||
| contents: read | ||
| concurrency: | ||
| group: publish-${{ github.ref }} | ||
| cancel-in-progress: false | ||
| jobs: | ||
| validate: | ||
| uses: ./.github/workflows/ci.yml | ||
| publish: | ||
| needs: validate | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v7.0.1 | ||
| - uses: actions/setup-node@v7.1.0 | ||
| with: | ||
| node-version: 26.13.0 | ||
| registry-url: https://registry.npmjs.org | ||
| - run: npm ci | ||
| - name: Verify release tag | ||
| run: node --input-type=module -e 'import fs from "node:fs"; const p = JSON.parse(fs.readFileSync("package.json")); if (process.env.GITHUB_REF_NAME !== `v${p.version}`) throw new Error("Tag must match package version");' | ||
| - run: npm publish --access public --provenance |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 24 | ||
| 26.13.0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <!-- coderabbit-ai-generated:v1 --> | ||
|
|
||
| # Changelog | ||
|
|
||
| ## 1.1.0 | ||
|
|
||
| - Develop, build and release on Node.js 26.13.0 LTS; retain Node 24 support. | ||
| - Upgrade development dependencies and patch minimatch via an override. TypeScript stays on 5.9.3 to satisfy typescript-eslint's peer range. | ||
| - Update the npm allowScripts list to match installed lifecycle scripts. | ||
| - Validate JWT structure, challenge parameters, expiration claims and integer nonces; add scoped redeem-token verification. | ||
| - Require a configured secret outside development and bound production JSON request bodies. | ||
| - Make the widget form-associated, accessible, cancellable and resettable with automatic token expiry. | ||
| - Refresh website styling, install-command copying, keyboard focus, reduced motion and mobile presentation. | ||
| - Add tag-triggered npm trusted publishing after CI gates, with provenance and no long-lived npm token. |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,19 @@ | ||
| import type { IncomingMessage, ServerResponse } from "node:http"; | ||
| import { handleChallenge } from "../lib/api/handlers.js"; | ||
|
|
||
| export default async function handler(_req: IncomingMessage, res: ServerResponse) { | ||
| export default async function handler(req: IncomingMessage, res: ServerResponse) { | ||
| res.setHeader("Content-Type", "application/json"); | ||
| res.end(JSON.stringify(handleChallenge("demo"))); | ||
| res.setHeader("Cache-Control", "no-store"); | ||
| if (req.method !== "GET" && req.method !== "HEAD") { | ||
| res.statusCode = 405; | ||
| res.setHeader("Allow", "GET, HEAD"); | ||
| res.end(JSON.stringify({ error: "method_not_allowed" })); | ||
| return; | ||
| } | ||
| try { | ||
| res.end(JSON.stringify(handleChallenge("demo"))); | ||
| } catch { | ||
| res.statusCode = 503; | ||
| res.end(JSON.stringify({ error: "service_unavailable" })); | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,14 @@ | ||
| import type { IncomingMessage, ServerResponse } from "node:http"; | ||
| import { getStats } from "../lib/core/stats.js"; | ||
|
|
||
| export default async function handler(_req: IncomingMessage, res: ServerResponse) { | ||
| export default async function handler(req: IncomingMessage, res: ServerResponse) { | ||
| res.setHeader("Content-Type", "application/json"); | ||
| res.setHeader("Cache-Control", "no-store"); | ||
| if (req.method !== "GET" && req.method !== "HEAD") { | ||
| res.statusCode = 405; | ||
| res.setHeader("Allow", "GET, HEAD"); | ||
| res.end(JSON.stringify({ error: "method_not_allowed" })); | ||
| return; | ||
| } | ||
| res.end(JSON.stringify(getStats())); | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,28 @@ | ||
| import type { IncomingMessage, ServerResponse } from "node:http"; | ||
| import { handleVerify } from "../lib/api/handlers.js"; | ||
| import { readJson } from "../lib/api/http.js"; | ||
|
|
||
| export default async function handler(req: IncomingMessage, res: ServerResponse) { | ||
| const body = await readJson(req); | ||
| res.setHeader("Content-Type", "application/json"); | ||
| res.end(JSON.stringify(handleVerify(body, "demo"))); | ||
| } | ||
|
|
||
| function readJson(req: IncomingMessage): Promise<unknown> { | ||
| return new Promise((resolve) => { | ||
| let data = ""; | ||
| req.on("data", (chunk) => (data += chunk)); | ||
| req.on("end", () => { | ||
| try { | ||
| resolve(data ? JSON.parse(data) : {}); | ||
| } catch { | ||
| resolve({}); | ||
| } | ||
| }); | ||
| }); | ||
| res.setHeader("Cache-Control", "no-store"); | ||
| if (req.method !== "POST") { | ||
| res.statusCode = 405; | ||
| res.setHeader("Allow", "POST"); | ||
| res.end(JSON.stringify({ error: "method_not_allowed" })); | ||
| return; | ||
| } | ||
| let body: unknown; | ||
| try { | ||
| body = await readJson(req); | ||
| } catch { | ||
| res.statusCode = 400; | ||
| res.end(JSON.stringify({ success: false, reason: "invalid_body" })); | ||
| return; | ||
| } | ||
| try { | ||
| res.end(JSON.stringify(handleVerify(body, "demo"))); | ||
| } catch { | ||
| res.statusCode = 503; | ||
| res.end(JSON.stringify({ error: "service_unavailable" })); | ||
| } | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.