feat:Harden archive and restore ownership checks for bills#441
Open
Abolax123 wants to merge 5 commits intoRemitwise-Org:mainfrom
Open
feat:Harden archive and restore ownership checks for bills#441Abolax123 wants to merge 5 commits intoRemitwise-Org:mainfrom
Abolax123 wants to merge 5 commits intoRemitwise-Org:mainfrom
Conversation
- Require owner auth for get_archived_bills; get_archived_bill(caller, id) returns Result - Enforce id/key consistency; add InconsistentBillData error; restore checks active collisions - bulk_cleanup validates archived id vs map key; archive_paid_bills skips non-owners with key check - Tests in src/test.rs (Issue Remitwise-Org#272), stress/integration fixes, README security + API docs - Proptest: ledger time setup for valid create_bill; multi-user archive stress uses per-owner archive Made-with: Cursor
Contributor
|
@Abolax123 Please resolve the conflicts |
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.
Closes #272
Summary
Strengthens authorization and storage consistency for bill archive, restore, cleanup, and archived bill reads to prevent cross-owner data access or manipulation.
Changes
get_archived_bills: requires authenticated owner (owner.require_auth()).get_archived_bill: now(caller, bill_id) -> Result<ArchivedBill, Error>; caller must be the archived row’s owner (breaking API for direct callers).archive_paid_bills/restore_bill/bulk_cleanup_bills: enforce owner affinity and map key vs embeddedidchecks; restore refuses active ID collisions.InconsistentBillData(15).cargo test -p bill_payments.bill_payments/src/test.rs; stress/integration updates; proptest ledger setup fixes.How to test
cargo test -p bill_payments