Skip to content

test: hold end user talk links to an https host allow-list - #1406

Merged
mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:quality/fold-talks-link-safety
Oct 13, 2026
Merged

mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:quality/fold-talks-link-safety

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Test Improvement

Consolidates #1375 into the integrity test #1383 landed, so data/kubecon-na-2026-end-user-talks.json has one contract file instead of two. Supersedes #1375.

Appended to tests/end-user-talks-data.test.mjs:

  • sourceUrl and every talk.url must be https, carry no userinfo, resolve to events.linuxfoundation.org, and stay on the schedule page's pathname; apiUrl must resolve to sessionize.com.
  • A non-vacuity test that each hostile form (http, javascript:, userinfo, look-alike suffix host, unrelated host, relative path) is rejected.

Uses checkUrl() from scripts/lib/validate-utils.mjs (#1381) rather than the local publishableUrl() copy in #1375, so this does not add a seventh instance of the pattern #1388 tracks. The assertions #1375 also carried for generatedAt validity and day.id slug/uniqueness were already covered by #1383 and are not duplicated.

Verification

  • Mutating one committed talk.url to https://events.linuxfoundation.org@evil.example/... fails the suite (1 fail); restored file passes 16/16.
  • npm run test:unit:coverage:check: 2565 pass, coverage gate green.

Closes #1374

Fold the URL gate proposed in cncf#1375 into tests/end-user-talks-data.test.mjs
so the snapshot has one integrity contract rather than two files. Reuse
checkUrl() from scripts/lib/validate-utils.mjs (landed in cncf#1381) instead of
adding another copy of the scheme/userinfo/host check; sourceUrl and every
talk.url must resolve to events.linuxfoundation.org and stay on the
schedule page's pathname, apiUrl to sessionize.com.

Closes cncf#1374

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot 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.

Verified against the tree and ran the test file on this head (node --test tests/end-user-talks-data.test.mjs): all pass.

  • checkUrl() in scripts/lib/validate-utils.mjs does what these assertions rely on: protocol allow-list defaults to https (line 79), userinfo rejection at line 118, and the host-suffix check (lines 127-131) uses host === domain || host.endsWith('.' + domain), so the look-alike case events.linuxfoundation.org.evil.example in the non-vacuity test is genuinely rejected, not coincidentally.
  • The pathname pin (new URL(talk.url).pathname === new URL(schedule.sourceUrl).pathname) closes the "elsewhere on the real host" gap the comment names, which host checking alone would miss.
  • The non-vacuity test is the right guard here: without it, an empty talks array or a silently-permissive checkUrl option change would leave the loops green while asserting nothing.
  • Body matches the diff: this is exactly the #1375 scope reimplemented on the shared checkUrl() rather than a local copy, appended to the file #1383 created.

One note for the maintainer: the body says this supersedes #1375 — if that PR is still open, it should be closed in favour of this one when this merges. Looks correct to me.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Independently verified at pull/1406/head (fork — comment only, no push access).

  • node --test tests/end-user-talks-data.test.mjs → 16 pass, 0 fail, matching the body's claim.
  • Non-vacuity checked by mutation rather than by reading: re-pointing the first talk.url to https://events.linuxfoundation.org@evil.example/kubecon-cloudnativecon-north-america/program/schedule/ turns the suite red (15 pass, 1 fail) on every talk link is a deep link into the official schedule page. The userinfo-disguised host is genuinely caught, not merely asserted.

Reusing checkUrl() from scripts/lib/validate-utils.mjs rather than re-copying publishableUrl() is the right call — it keeps this consistent with the validate-metrics / validate-case-studies / validate-radar-reports feeds and avoids adding another instance of the pattern #1388 tracks.

One adjacent note, filed separately as #1412 and not a change request on this PR: the e2e-coverage job is the only place 32 of the suite's 309 e2e tests run, and it uploads no Playwright traces, so a flake in that set leaves no evidence. Unrelated to this diff — flagging only so it is not mistaken for something this PR should have covered.

No concerns with the change as it stands.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: 1e37cdc

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 13, 2026
@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 13, 2026
Merged via the queue into cncf:main with commit a7de824 Oct 13, 2026
8 checks passed
@mrbobbytables
mrbobbytables deleted the quality/fold-talks-link-safety branch October 16, 2026 00:58
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.

[sec-check] data/kubecon-na-2026-end-user-talks.json renders 85 hrefs with no host allow-list, unlike every sibling data feed

1 participant