Repository navigation
id-store: versioned namespace registry state + authorization seam (#10257) - #12867
Merged
Merged
Conversation
…0257) Slice A9116-registry-state: RegistryState wraps the record layer LocalRegistry with a generation counter and an audit log. Mutations (create/update/revoke) authorize through the injected RegistryAuthorizer + MutationContext seam first, then check the expected generation (concurrent-writer conflict), then apply through the record layer; success increments exactly one generation and appends an audit entry. Updates cannot change a namespace core. State persists as canonical CBOR (versioned, strict fields) and round-trips byte-for-byte. Model test generates operation sequences against an independent reference model and compares every resulting state and error.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Implements slice A9116-registry-state for #10257 (parent #9116; design
part-a-addressing/versioned-design.mdA-9116.1, S4.2–S4.10, S4.18). Native blockers verified closed before implementation: #9083, #10160 (9110-02), #10243 (A9116-registry-record).What
pkgs/id/crates/id-store/src/namespace_registry.rs(new) —RegistryState: aLocalRegistry(record layer, id-core) plus a generation counter and an audit log.MutationContext(principal + tenant/authorization scopes, the port envelope's scopes under the design(pm-stack): tenancy architecture — per-user Turso databases + central tenancy DB, served by Workers and Durable Objects #9083 contract) judged by aRegistryAuthorizer; shipped judge isAdminScopeAuthorizer. This slice defines no tenancy.GenerationConflict, never a silent overwrite.CoreChange) — handlers cannot change core identity.pkgs/id/crates/id-store/tests/namespace_registry_model.rs(new) — the recorded model oracle: generated operation sequences (3 seeds × 300 ops mixing authorized/unauthorized contexts, stale/future generations, duplicate creates, unknown-name updates/revokes, core-changing updates) run against an independent reference model; every resulting state and error compared. Plus targeted tests: exactly-one-generation increments, unauthorized-changes-nothing (authorization precedes the generation check), conflict-changes-nothing, core-change refusal, byte-exact persistence round-trip, decode rejection of unknown fields/other versions, two-registry coexistence, authorizer substitutability.pkgs/id/crates/id-store/src/lib.rs— one line:pub mod namespace_registry;(the crate-root export the manifest assigned to 9110-02, which closed as the port-contracts slice before this module existed).Verification
cargo test -p id-store --test namespace_registry_model(nix develop, pkgs/id, laptop worktree off origin/main):cargo fmt -p id-store -- --checkclean. No production rollout — library state machine + tests only, per the packet.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.