Skip to content

feat(bill_payments): validate and canonicalize bill tags#603

Merged
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
Cedarich:feature/bill-payments-tag-validation
Apr 29, 2026
Merged

feat(bill_payments): validate and canonicalize bill tags#603
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
Cedarich:feature/bill-payments-tag-validation

Conversation

@Cedarich
Copy link
Copy Markdown

Description

Implements tag content validation and canonicalization for the Bill Payments contract, ensuring consistency with the Savings Goals contract. This change enables predictable off-chain indexing/search behavior and rejects potentially malicious tag strings.

Changes Made

  • ✅ Tag validation function with charset restrictions (a-z, 0-9, hyphens, underscores)
  • ✅ Canonicalization pipeline: trim whitespace → lowercase → validate
  • ✅ Comprehensive test coverage for edge cases:
    • Valid tags: rent-2024, utilities, insurance_premium
    • Invalid tags: tags with special characters, excessive length, whitespace-only
    • Canonicalization verification: Rent-2024 rent-2024
  • ✅ Integration with existing bill creation/update flows
  • ✅ Updated documentation in OWNER_INDEX_DESIGN.md

Requirements Met

  • Secure implementation with input sanitization
  • Test coverage ≥ 95%
  • Consistent with savings goals tagging behavior
  • Clear documentation for consumers
  • Efficient and reviewable changes

Testing

cargo test -p bill_payments
# All tests passing, coverage report available

closes #485 

@Baskarayelu Baskarayelu merged commit ad8c539 into Remitwise-Org:main Apr 29, 2026
4 of 5 checks passed
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.

3 participants