Repository navigation
fix(store): enforce hub approval access groups - #16
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.
Why
The store accepted hub approvals for missing access groups. Group deletion could leave an approval that failed later during hub sync. Closes #3.
What changes
flowchart LR subgraph Before A[Write approval] --> B[Accept missing group] C[Delete group] --> D[Keep approval] end subgraph After E[Write approval] --> F{Group exists?} F -->|Yes| G[Keep approval] F -->|No| H[Return error with group name] I[Delete group] --> J[Delete its approvals] endON DELETE CASCADE. The owner approved this rule. An index onaccess_groupsupports group deletion.A separate commit corrects the MCP server version from
0.3.0to the package version0.1.0, as required by the existing negotiation test.Look at:
crates/aether-store/migrations/node/019_hub_approval_access_group.sql, especially the rule for existing invalid rows.Evidence
cargo fmt --all -- --check: passed.cargo clippy --all-targets --all-features -- -D warnings: passed.cargo doc -p aether-store --no-deps: passed with two existing private-link warnings.cargo test -p aether-store: 79 passed.cargo test -p aether-core: 8 passed.cargo test --workspacepassed: 564 tests and 98 feature scenarios (553 steps). Two live Codex tests and 18 documentation examples were skipped by the existing test settings. The final Clippy check also passed.Three new tests cover invalid writes and replacement rollback, group deletion, and upgrade from schema 18 with valid and invalid rows. The upgrade test also checks data after reopening and the automatic backup. Added runtime is estimated at less than one second. Hub server and container checks were not run; the change is in the node store.
Merge danger
Door: one-way
Blast radius: node
Each node applies the migration when it first opens its database with the new binary. The store makes a backup before upgrade. Invalid approvals are discarded. Group deletion cancels all approvals for that group, including stored signed bundles. A source revert cannot restore deleted rows. An older binary refuses the new schema.
The wire formats, hub protocol, and signing keys do not change. Owners must restart the node with the new binary to apply this change.
After merge
aether node serve.