Repository navigation
feat(acl): additive atomic whole-library ACL batch API and shared rule-cache reuse - #52
Merged
Merged
Conversation
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.
Motivation
Etech permission publication currently sends per-rule GET→PUT→GET plus per-directory existence checks. This causes redundant remote calls, small transactions and cache invalidations. Do not disturb existing Etech installations that still use
directory-rules/.Additive API (old API unchanged)
/api/v2.1/cloudfile/authorization/v1/library-acl-batch/GET ?repo_id: complete provider ACL rules + deterministic fingerprint (including revisions).POST {repo_id,paths}: one read-only resource preview + complete snapshot + missing_paths, replacing N per-directory GETs.PUT {repo_id,expected_fingerprint,managed,desired}: one per-library transfer fence and Branch(master) lock, a current provider snapshot, optimistic fingerprint check, difference-only INSERT/UPDATE/DELETE and one transaction / one post-commit cache generation invalidation.managedexplicitly declares Etech publisher's old+new natural keys: only these keys can be removed or changed; rules outside them and other providers are preserved. Fail-closed on invalid inputs, 409 stale snapshot, 403 unauthorized, 503 SQL/storage errors. Limit 4096 keys/rows.directory-rulesendpoint remains available for non-upgraded Etech. There is no table migration or new redis namespace/cache.Read/write behavior
Both
can_readandcan_writestill use one existing Authority per call and the same existing Redis library ACL snapshot (default TTL 180s). Request-local ancestor-path buckets reduce O(rules × directory children) scans; no new persistent cache. Native C/Go final publication fences and SQL lock semantics remain intact.Validation
New Django/DRF tests: batch authentication, request validation, preview results, fingerprint, 409 conflict; optional disposable MariaDB test verifies atomic diff, preservation of unmanaged/provider rows and exactly one cache invalidation; quick CI runs dependency-light contract tests, no full builds.
Real Hub/EAP interoperability, MariaDB locking/rollback and native C/Go should be verified before merge/deployment. Deploy Hub before upgraded EAP. Related Server fixes #27 and #28 need independent acceptance.
No DEV/PROD was contacted or modified.