Authorization boundaries - #1814
Open
harryjupiter148 wants to merge 4 commits into
Open
Conversation
… flow - Align SavingsGoalsInterface.add_to_goal with cross-contract epoch guard pattern - Fix argument mismatch between orchestrator interface and savings_goals implementation - Reconcile RemittanceSplitInterface calculate_split to amount-only signature - Add kill switch guard to all write entry points across 7 contracts - Implement Role Lifecycle Security tests in family_wallet (Issue Remitwise-Org#1715) - Add KillSwitchError, activate/deactivate helpers, and 6 unit tests in remitwise-common - Fix insurance symbol_short overflow, duplicate discriminants, and Vec::new usage - Fix data_migration clippy lints and reporting no_std placement - Fix remittance_split dead_code allow for STORAGE_OWNER_SCHED_IDS - Add Type-Safe Percent Conversion (BPS_PER_PERCENT, Percent newtype, Rate helpers) - Generate Cargo.lock via cargo generate-lockfile Co-authored-by: Antigravity <antigravity@google.com>
savings_goals/src/lib.rs: - Add add_to_goal_xc: orchestrator/epoch-guarded entry point for remittance fan-out (mirrors bill_payments::pay_bill pattern). Validates trusted orchestrator + epoch before crediting the goal. - Remove duplicate remove_from_goal from main contractimpl block. orchestrator/src/lib.rs: - SavingsGoalsInterface: rename add_to_goal -> add_to_goal_xc, declare return type i128. - SavingsGoalsCompInterface: fix remove_from_goal return bool. - Both run_remittance_fan_out call sites updated to try_add_to_goal_xc. - Test mock aligned with updated interface types. Root cause: orchestrator passed 5 args to a 3-arg WASM function; positional extraction mapped epoch(u64) into goal_id:u32, failing with GoalNotFound=1 -> Error(Contract, Remitwise-Org#1).
…n types with downstream contracts - Set InsuranceInterface::pay_premium to return bool matching insurance::pay_premium signature - Update run_remittance_fan_out to check Ok(Ok(true)) avoiding false failure detection and unintended rollback - Update execute_flow_fanout to match Ok(Ok(true)) - Set BillPaymentsCompInterface::reverse_payment and InsuranceCompInterface::reverse_premium to return bool - Update orchestrator test mock methods to return bool - Remove unused import in savings_goals Fixes test_orchestrated_multisig_flow in integration_tests.
…late_split - Enforce total_amount <= i128::MAX / 100 in calculate_split_internal and calculate_split_amounts - Return RemittanceSplitError::Overflow on totals exceeding safe bound - Guard fee_math::split_amounts against exceeding MAX_SAFE_TOTAL - Restore checked_mul overflow expectations in tests_safe_math Ensures safe_math_cross_contract integration tests and remittance_split unit tests pass.
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.
Summary
Hardened the authentication flows in
meridian-api/src/auth/to provide deterministic authorization behavior across token expiry, refresh, verification, logout, recovery, retries, concurrent requests, multiple tabs, and device changes.The implementation ensures that protected operations are authorized from trusted server/contract state rather than stale or client-controlled identity information, with explicit rejection of missing, expired, forged, and cross-tenant identities before any mutation occurs.
Related Issue(s)
Closes #1643
Type of Change
Description
This change strengthens authentication and authorization boundaries across the existing auth flows.
What changed
Security / correctness invariants
The implementation now guarantees that:
Testing
Added focused regression coverage at the integration boundary covering both successful and failure paths.
Covered cases
Each denied, forged, stale, repeated, and failed operation verifies that protected state remains unchanged.
Required Validation
The following validation was performed: