Skip to content

refactor(transit): improve security, atomicity, and validation rules#89

Merged
allisson merged 1 commit intomainfrom
improve-transit
Mar 2, 2026
Merged

refactor(transit): improve security, atomicity, and validation rules#89
allisson merged 1 commit intomainfrom
improve-transit

Conversation

@allisson
Copy link
Owner

@allisson allisson commented Mar 2, 2026

Enhance transit key security by implementing secure memory clearing, ensure atomic transit key creation using transactions, and refactor the validation layer to remove unused rules and add base64 validation.

  • transit: Add Destroy() method to EncryptedBlob for secure zeroing of plaintext data and update DecryptHandler to use it.
  • transit: Add version validation to NewEncryptedBlob to ensure it is greater than 0.
  • transit: Wrap Create operation in TransitKeyUseCase within a database transaction for atomicity.
  • validation: Remove unused PasswordStrength, Email, and NoWhitespace rules to simplify the package.
  • validation: Add Base64 validation rule with corresponding unit tests.
  • validation: Update tests to reflect the removal of unused rules and add coverage for new functionality.

Enhance transit key security by implementing secure memory clearing, ensure
atomic transit key creation using transactions, and refactor the validation
layer to remove unused rules and add base64 validation.

- transit: Add `Destroy()` method to `EncryptedBlob` for secure zeroing of
  plaintext data and update `DecryptHandler` to use it.
- transit: Add version validation to `NewEncryptedBlob` to ensure it is
  greater than 0.
- transit: Wrap `Create` operation in `TransitKeyUseCase` within a database
  transaction for atomicity.
- validation: Remove unused `PasswordStrength`, `Email`, and `NoWhitespace`
  rules to simplify the package.
- validation: Add `Base64` validation rule with corresponding unit tests.
- validation: Update tests to reflect the removal of unused rules and add
  coverage for new functionality.
@allisson allisson merged commit 87aecb8 into main Mar 2, 2026
1 of 2 checks passed
@allisson allisson deleted the improve-transit branch March 2, 2026 23:50
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.

1 participant