Skip to content

Add a 401 HTML page#1073

Merged
jviotti merged 3 commits into
mainfrom
401-page
Jun 19, 2026
Merged

Add a 401 HTML page#1073
jviotti merged 3 commits into
mainfrom
401-page

Conversation

@jviotti

@jviotti jviotti commented Jun 19, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

5 issues found across 50 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread test/cli/index/common/snapshot-no-self-draft4-ignore-vocabulary.sh
Comment thread src/web/pages/unauthorized.cc Outdated
Comment thread src/router/artifact.cc Outdated
Comment thread src/actions/action_default_v1.h
Comment thread src/web/pages/unauthorized.cc
@augmentcode

augmentcode Bot commented Jun 19, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds a dedicated HTML 401 Unauthorized page for browser-facing navigation when an HTML request is denied by authentication.

Changes:

  • Updates the default router action to serve an index-time 401 HTML artifact instead of returning the JSON Problem Details envelope when Accept: text/html is negotiated and access is denied.
  • Adds a new web build generator (GENERATE_WEB_UNAUTHORIZED) that renders the unauthorized page into 401.metapack.
  • Extends RouterAction::artifact_serve with an optional flag to emit a WWW-Authenticate: Bearer realm="registry" challenge for the HTML 401 response.
  • Registers the new build handler and index rule so the 401 page is produced in full builds (root-only), mirroring the existing 404 page behavior.
  • Updates enterprise auth Hurl E2E scenarios to expect text/html; charset=utf-8 and validate key page text/headers for denied HTML requests.
  • Updates CLI index snapshot/manifest expectations to include ./explorer/%/401.metapack.

Technical Notes: The HTML 401 page is served with no-store cache discipline, browser security headers (e.g. Referrer-Policy, X-Frame-Options), and the same Bearer challenge used by the JSON 401 envelope.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 21 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread enterprise/e2e/auth/hurl/unauthorized.all.hurl
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@github-actions github-actions 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.

Benchmark Index (community)

Details
Benchmark suite Current: 1c8e8b6 Previous: df873c2 Ratio
Add one schema (0 existing) 391 ms 393 ms 0.99
Add one schema (100 existing) 28 ms 29 ms 0.97
Add one schema (1000 existing) 81 ms 82 ms 0.99
Add one schema (10000 existing) 640 ms 655 ms 0.98
Update one schema (1 existing) 21 ms 21 ms 1
Update one schema (101 existing) 28 ms 28 ms 1
Update one schema (1001 existing) 80 ms 86 ms 0.93
Update one schema (10001 existing) 653 ms 702 ms 0.93
Cached rebuild (1 existing) 6 ms 6 ms 1
Cached rebuild (101 existing) 8 ms 8 ms 1
Cached rebuild (1001 existing) 28 ms 28 ms 1
Cached rebuild (10001 existing) 238 ms 250 ms 0.95
Index 100 schemas 611 ms 675 ms 0.91
Index 1000 schemas 1528 ms 1521 ms 1.00
Index 10000 schemas 13474 ms 13701 ms 0.98
Index 10000 schemas (custom meta-schema) 16148 ms 16668 ms 0.97
Index 10000 schemas ($ref fan-out) 16593 ms 16929 ms 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions 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.

Benchmark Index (enterprise)

Details
Benchmark suite Current: 1c8e8b6 Previous: df873c2 Ratio
Add one schema (0 existing) 380 ms 376 ms 1.01
Add one schema (100 existing) 31 ms 33 ms 0.94
Add one schema (1000 existing) 82 ms 89 ms 0.92
Add one schema (10000 existing) 729 ms 691 ms 1.05
Update one schema (1 existing) 24 ms 25 ms 0.96
Update one schema (101 existing) 31 ms 33 ms 0.94
Update one schema (1001 existing) 84 ms 89 ms 0.94
Update one schema (10001 existing) 734 ms 702 ms 1.05
Cached rebuild (1 existing) 8 ms 8 ms 1
Cached rebuild (101 existing) 10 ms 11 ms 0.91
Cached rebuild (1001 existing) 30 ms 34 ms 0.88
Cached rebuild (10001 existing) 254 ms 279 ms 0.91
Index 100 schemas 639 ms 471 ms 1.36
Index 1000 schemas 1606 ms 1553 ms 1.03
Index 10000 schemas 13706 ms 13541 ms 1.01
Index 10000 schemas (custom meta-schema) 16653 ms 16337 ms 1.02
Index 10000 schemas ($ref fan-out) 16632 ms 16330 ms 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti merged commit 3021b77 into main Jun 19, 2026
5 checks passed
@jviotti jviotti deleted the 401-page branch June 19, 2026 16:33
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.

1 participant