Fix signing address and signatory for anon signers#849
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes privacy leakage issues when anonymous (bearer) bill holders perform bill actions. Previously, the signing_address and signatory.name fields were being populated even when the holder was anonymous, which could reveal identity information. The PR introduces a new LightBillSignatory type with an optional name field to replace the previous LightBillIdentParticipant usage for signatories, and adds logic to omit the signing address and signatory name when the holder is anonymous.
Changes:
- Changed
BillSignatoryBlockData.nameandBillSignatory.namefromNametoOption<Name>, propagating the type change through all layers (core, persistence DB, WASM) - Added
signatory_for_signer()helper and conditionalsigning_addresslogic in block construction to clear identity data for anonymous holders - Added a new integration test
endorse_bitcredit_bill_anon_company_and_backthat verifies both the signatory name and signing address areNonefor anonymous company signers
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Cargo.toml |
Version bump from 0.5.3 to 0.5.4 |
CHANGELOG.md |
Added changelog entry for 0.5.4 |
crates/bcr-ebill-core/src/protocol/blockchain/bill/block.rs |
Changed BillSignatoryBlockData.name to Option<Name> (breaking borsh change); updated all test fixtures |
crates/bcr-ebill-core/src/protocol/blockchain/bill/participant.rs |
Changed BillSignatory.name to Option<Name> with updated doc comment |
crates/bcr-ebill-core/src/application/contact/mod.rs |
Added new LightBillSignatory struct with Option<Name> |
crates/bcr-ebill-core/src/application/bill/mod.rs |
Changed LightSignedBy.signatory to use LightBillSignatory; removed ContactType import |
crates/bcr-ebill-core/src/application/identity/mod.rs |
Removed From<Identity> for BillSignatoryBlockData impl (no longer 1:1 due to Option<Name>) |
crates/bcr-ebill-api/src/service/bill_service/blocks.rs |
Added signatory_for_signer() helper; applied anon checks to signing_address and signatory across all anon-capable bill actions |
crates/bcr-ebill-api/src/service/bill_service/data_fetching.rs |
Replaced removed From impl with explicit BillSignatoryBlockData construction |
crates/bcr-ebill-api/src/service/bill_service/tests.rs |
Added endorse_bitcredit_bill_anon_company_and_back test; updated existing test fixture |
crates/bcr-ebill-persistence/src/db/bill.rs |
Added LightBillSignatoryDb struct; updated LightSignedByDb to use it |
crates/bcr-ebill-wasm/src/data/bill.rs |
Added LightBillSignatoryWeb struct; updated LightSignedByWeb to use it |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #849 +/- ##
==========================================
+ Coverage 70.46% 70.61% +0.15%
==========================================
Files 132 132
Lines 24802 24942 +140
==========================================
+ Hits 17477 17614 +137
- Misses 7325 7328 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
43b2e79 to
7a49e68
Compare
📝 Description
signing_addressneeds to not be setsignatoryshouldn't have anameset (breaking DB and bill block change)Relates to #840
✅ Checklist
Please ensure the following tasks are completed before requesting a review:
cargo fmt.cargo clippy.🚀 Changes Made
See above.
💡 How to Test
Please provide clear instructions on how reviewers can test your changes:
None, signing_address should beNone🤝 Related Issues
List any related issues, pull requests, or discussions:
📋 Review Guidelines
Please focus on the following while reviewing: