auth: enforce scoped personal-library access - #9
Open
mulatta wants to merge 8 commits into
Open
Conversation
Pass configuration, PostgreSQL, and object storage explicitly through AppState. This removes process-wide dependency singletons so authorization and library contexts can be tested and resolved per application instance.
Pass a positive LibraryId through every PostgreSQL operation. This makes missing library context a compile-time error before user and group route resolution begins.
Replace blanket denial for keys without note access with Zotero-compatible item filtering. Carry permissions through request scope so sync maps, batch reads, listings, keys, trash, and collection views hide note items while annotations and library metadata retain upstream behavior.
Upload replacement bytes to immutable candidate objects and switch the durable blob pointer only when registration commits. Compare the authorization-time MD5 under the library lock so stale registrations cannot overwrite newer files or bump versions, and consume upload capabilities after terminal outcomes.
Keep request diagnostics limited to method, redacted route, protocol headers, body size, and status. Capability tokens, query strings, forms, attachment bytes, JSON content, API keys, and content fingerprints must not enter the service journal.
mulatta
force-pushed
the
auth-scoped-library-access
branch
from
August 26, 2026 13:25
0ef377a to
9b8a2c8
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.
Summary
Scope
This establishes the personal-library authorization boundary for later OIDC and group work. User/key provisioning remains an administrative database operation; durable OIDC login and group libraries are intentionally handled by follow-up branches.
Review focus
library_idpredicates and URL-user/principal matchinglibrary/notes/write/filespermission enforcementVerification
cargo test --manifest-path server/Cargo.toml(10 passed)nix flake check --no-build