fix(station): base AllowListed on independently listed addresses - #653
Draft
MRmarioruci wants to merge 1 commit into
Draft
fix(station): base AllowListed on independently listed addresses#653MRmarioruci wants to merge 1 commit into
MRmarioruci wants to merge 1 commit into
Conversation
AllowListed approves a transfer outright when its destination is present in the address book. Address book writes default to the operator rule while an account's transfer policy is typically admin-tier, so a single operator could list their own address, self-approve that entry at operator quorum, and then spend to it with no further approval. Record the user that last created or edited an entry, and stop AllowListed treating an entry as evidence of trust when the same user submitted the transfer. Listing and spending now require two different people. Entries stored before this field existed decode with no author and are still honoured, so existing allow-lists keep working across the upgrade. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Change
RequestPolicyRule::AllowListedtreats a destination's presence in the address book as approval for a transfer to it. Address book writes and an account's transfer policy are configured independently and commonly sit at different approval tiers, so presence on its own is not necessarily an independent signal about the destination.AddressBookEntrygainslast_modified_by: Option<UUID>, set on create and on edit. Edits are covered as well as creation, since changing an existing entry reaches the same state.AllowListedlooks the entry up rather than only testing existence, and does not treat it as independent whenlast_modified_bymatches the transfer'srequested_by. Listing an address and spending to it therefore involve two different people.request.requested_byin the add/edit request executors.Backwards compatibility
Entries stored before the field existed decode with
last_modified_by: Noneand are still honoured, so existing allow-lists keep working across the upgrade.This is asserted rather than assumed:
decodes_entries_stored_before_last_modified_by_existedencodes a struct with the pre-change shape using the same CBOR serializer#[storable]uses, decodes it as the currentAddressBookEntry, and checks the field defaults toNonewith every other field intact.Tests
rejects_an_address_the_requester_listed_themselvesapproves_an_address_listed_by_someone_else— the feature still worksapproves_entries_that_predate_authorship_tracking— no regression for existing allow-listsdecodes_entries_stored_before_last_modified_by_existed— the compatibility proof abovecargo test -p station --libpasses (398). Clippy warning count unchanged from baseline;cargo fmtclean.Unrelated observation
migration_tests::make_repository_snapshotsonly writes the.binsnapshots; nothing reads them back or asserts against them. They are regenerated artifacts rather than a compatibility check, which is why they show dirty after any test run, and why the compatibility test above stands alone. Theaddress_book_repository_v3.binchange here is just the regenerated artifact reflecting the new field.