π Description
The encrypted-payload helpers in data_migration/src/lib.rs use a hardcoded ENCRYPTED_PAYLOAD_PREFIX_V1 ("enc:v1:") for export_to_encrypted_payload / import_from_encrypted_payload. There is no version negotiation: a future enc:v2 payload would fail to parse with no clear path to coexist with enc:v1.
This issue adds prefix-based schema-version negotiation so importers can accept multiple encoded-payload versions and reject unknown ones cleanly.
Why this matters: encoding formats evolve. Hardcoding a single prefix forces a flag-day migration; versioned prefixes let enc:v1 and enc:v2 coexist during rollout and fail closed on unknown versions instead of silently misparsing.
π― Requirements & Context
Functional requirements
Context & constraints
π οΈ Suggested Execution
1. Fork & branch
git checkout -b feature/migration-enc-version-negotiation
2. Implement changes
- Add the versioned prefix dispatch in
data_migration/src/lib.rs.
- Add
/// doc comments on the version negotiation and the no-confidentiality caveat.
3. Test & commit
cargo test -p data_migration
- Cover edge cases:
enc:v1 round-trip unchanged, unknown prefix rejected, truncated prefix, and oversize payload per version.
Example commit message
feat(data-migration): add enc:v1βenc:v2 prefix version negotiation, fail closed on unknown
β
Acceptance Criteria & Guidelines
| Requirement |
Target |
| Versioned prefix dispatch, fail-closed on unknown |
Required |
enc:v1 backward compatibility preserved |
Required |
| Coverage of negotiation paths |
β₯ 95%, all branches |
| Doc comments + no-confidentiality caveat |
Required |
cargo test -p data_migration + cargo clippy clean |
Required |
| Timeframe |
96 hours from assignment |
π¬ Community & Support
Join the Remitwise contributor community on Discord: https://discord.gg/CtQuPZFMA β comment when you pick this up. π
π Description
The encrypted-payload helpers in
data_migration/src/lib.rsuse a hardcodedENCRYPTED_PAYLOAD_PREFIX_V1("enc:v1:") forexport_to_encrypted_payload/import_from_encrypted_payload. There is no version negotiation: a futureenc:v2payload would fail to parse with no clear path to coexist withenc:v1.This issue adds prefix-based schema-version negotiation so importers can accept multiple encoded-payload versions and reject unknown ones cleanly.
π― Requirements & Context
Functional requirements
enc:v1:,enc:v2:) with an enum mapping prefix β version.import_from_encrypted_payloadmust dispatch on the prefix and reject unknown prefixes withMigrationError::IncompatibleVersion(fail closed).enc:v1behavior exactly for backward compatibility.MAX_ENCRYPTED_PAYLOAD_BYTESsize guard, recomputed per version.Context & constraints
21.7.7; additive β do not break existingenc:v1round-trips.cargo test -p data_migration.π οΈ Suggested Execution
1. Fork & branch
2. Implement changes
data_migration/src/lib.rs.///doc comments on the version negotiation and the no-confidentiality caveat.3. Test & commit
cargo test -p data_migrationenc:v1round-trip unchanged, unknown prefix rejected, truncated prefix, and oversize payload per version.Example commit message
β Acceptance Criteria & Guidelines
enc:v1backward compatibility preservedcargo test -p data_migration+cargo clippyclean㪠Community & Support
Join the Remitwise contributor community on Discord: https://discord.gg/CtQuPZFMA β comment when you pick this up. π