Repository navigation
feat(auth): bind document identity and issue direct owner grants - #262
Open
marcus-pousette wants to merge 10 commits into
Open
marcus-pousette wants to merge 10 commits into
marcus-pousette wants to merge 10 commits into
Conversation
marcus-pousette
marked this pull request as ready for review
September 23, 2026 09:58
Merged
This branch has not been deployed
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.
The auth umbrella (#38) aims to let a document be created locally, sync authenticated edits, and recover from a sealed authority backup plus retained history. This PR builds the document identity and direct owner grant used at the start of that flow. Recovery will reuse them: restore the same authority, create a fresh replica, and issue it a new grant for the same document.
Fixes #245. Implements direct grants from #255 and an in-memory key provider from #251.
Where this fits
flowchart TD subgraph current["This PR: document identity and direct grants"] A["Authority key"] -->|public key determines| D["Document ID"] A -->|signs| G["Direct owner grant<br/>Document + replica + expiry"] D -->|bound into| G R["Replica public key"] -->|authorized by| G end G -.-> P["Save keys and grant durably"] P -.-> S["Authenticate replica and sync signed edits"] S -.-> B["Recover from sealed authority backup<br/>and retained history"] B -.->|same authority, fresh replica, new grant| GDashed arrows show the remaining lifecycle work in #38. This PR can issue and verify grants in memory; it does not yet persist them, admit a sync connection, or export/restore a backup. The follow-ups are durable provisioning (#251, #249), authenticated sync (#244, the rest of #255, #243, #256, #89), and backup/recovery (#246, #249).
Contract
AuthorityKeyandReplicaKeyare role-specific aliases over one opaque key-handle shape. The in-memory provider keeps non-extractable Web Crypto keys behind role-checked handles and exposes purpose-specific grant issuance. Deleting an authority also prevents an in-flight grant from being returned.Delegation and revocation remain follow-ups too. The existing sync implementation stays buildable while #255 replaces the unreleased draft in slices. Keep the auth minor unreleased until that rewrite is complete.