Skip to content

fix(station): base AllowListed on independently listed addresses - #653

Draft
MRmarioruci wants to merge 1 commit into
mainfrom
fix/allowlisted-ignores-self-added-entries
Draft

fix(station): base AllowListed on independently listed addresses#653
MRmarioruci wants to merge 1 commit into
mainfrom
fix/allowlisted-ignores-self-added-entries

Conversation

@MRmarioruci

@MRmarioruci MRmarioruci commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Change

RequestPolicyRule::AllowListed treats 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.

  • AddressBookEntry gains last_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.
  • AllowListed looks the entry up rather than only testing existence, and does not treat it as independent when last_modified_by matches the transfer's requested_by. Listing an address and spending to it therefore involve two different people.
  • The requester flows in from request.requested_by in the add/edit request executors.

Backwards compatibility

Entries stored before the field existed decode with last_modified_by: None and 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_existed encodes a struct with the pre-change shape using the same CBOR serializer #[storable] uses, decodes it as the current AddressBookEntry, and checks the field defaults to None with every other field intact.

Tests

  • rejects_an_address_the_requester_listed_themselves
  • approves_an_address_listed_by_someone_else — the feature still works
  • approves_entries_that_predate_authorship_tracking — no regression for existing allow-lists
  • decodes_entries_stored_before_last_modified_by_existed — the compatibility proof above

cargo test -p station --lib passes (398). Clippy warning count unchanged from baseline; cargo fmt clean.

Unrelated observation

migration_tests::make_repository_snapshots only writes the .bin snapshots; 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. The address_book_repository_v3.bin change here is just the regenerated artifact reflecting the new field.

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>
@MRmarioruci MRmarioruci changed the title fix(station): AllowListed ignores addresses listed by the requester fix(station): base AllowListed on independently listed addresses Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant