Centralize canonical route authorization for OIDC - #1479
Merged
Merged
Conversation
81reap
reviewed
Sep 23, 2026
| normalized_url, | ||
| relative_file_path, | ||
| trailing_slash: raw_path.ends_with(FORWARD_SLASH), | ||
| builtin_static: relative.is_some_and(|path| path.starts_with("sqlpage/")), |
Collaborator
There was a problem hiding this comment.
what about top level assets? (ie :: *.js, *.css, *.svg) those are at / not /sqlpage/
lovasoa
force-pushed
the
codex/canonical-route-authorization
branch
from
September 23, 2026 22:07
16cf15a to
65d090a
Compare
lovasoa
force-pushed
the
codex/canonical-route-authorization
branch
from
September 24, 2026 06:15
6a02b6d to
35fe27e
Compare
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.
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/reportcannot execute a protected/private/report.sqlwithout 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_routeand applying #1476's case-insensitive SQL-extension check there.Validation
cargo fmt --allcargo clippy --all-targets --all-features -- -D warningscargo test(226 unit tests, 85 integration tests)cargo test(229 unit tests, 85 integration tests)The fast path avoids an added file-store lookup by inspection. Latency and allocation benchmarks were not run.