Skip to content

Centralize canonical route authorization for OIDC - #1479

Merged
lovasoa merged 2 commits into
mainfrom
codex/canonical-route-authorization
Sep 24, 2026
Merged

lovasoa merged 2 commits into
mainfrom
codex/canonical-route-authorization

Conversation

@lovasoa

@lovasoa lovasoa commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

What changes

OIDC now derives its path decision and the router's filesystem candidate from one percent-decoded request path. For URLs that appear public, it authorizes the resolved SQL or static resource and passes that same route to the HTTP handler. A clean URL such as /private/report cannot execute a protected /private/report.sql without login. Clearly protected unauthenticated URLs still redirect before a file-store lookup. OIDC policy prefixes are compiled once at startup.

Built-in /sqlpage/ assets remain explicitly classified outside application-file routing. Invalid or ambiguous URL identities fail closed for public authorization, while existing filesystem access checks remain in force.

Stack and integration

Base: #1478 (OIDC security fixes). This PR should be reviewed and merged after it. The separate SQL source-disclosure PR #1476 remains independent. I tested a temporary merge of both branches; its only conflicts were the changelog and one routing match arm, resolved by retaining resolve_route and applying #1476's case-insensitive SQL-extension check there.

Validation

The fast path avoids an added file-store lookup by inspection. Latency and allocation benchmarks were not run.

Comment thread src/webserver/routing.rs Outdated
normalized_url,
relative_file_path,
trailing_slash: raw_path.ends_with(FORWARD_SLASH),
builtin_static: relative.is_some_and(|path| path.starts_with("sqlpage/")),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what about top level assets? (ie :: *.js, *.css, *.svg) those are at / not /sqlpage/

Base automatically changed from codex/oidc-security-fixes to main September 23, 2026 14:48
@lovasoa
lovasoa force-pushed the codex/canonical-route-authorization branch from 16cf15a to 65d090a Compare September 23, 2026 22:07
@lovasoa
lovasoa force-pushed the codex/canonical-route-authorization branch from 6a02b6d to 35fe27e Compare September 24, 2026 06:15
@lovasoa
lovasoa merged commit acab5c1 into main Sep 24, 2026
52 checks passed
@lovasoa
lovasoa deleted the codex/canonical-route-authorization branch September 24, 2026 09:09
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