fix: throw exception instead of returning plaintext when encryption fails (Closes #165) #178

Merged
shahondin1624 merged 1 commits from feature/issue-165-encryption-no-plaintext-fallback into main 2026-04-10 16:15:31 +02:00
Owner

Summary

  • EncryptionService::encrypt() now throws RuntimeException when ICrypto::encrypt() fails, instead of silently returning plaintext
  • Prevents sensitive data (IBAN, Kontoinhaber, Allergien) from being stored unencrypted
  • Updated test to verify the new exception behavior

Test plan

  • All existing unit tests pass with updated expectation
  • Encryption failure now throws RuntimeException
  • Error message is user-friendly in German

Closes #165

## Summary - `EncryptionService::encrypt()` now throws `RuntimeException` when `ICrypto::encrypt()` fails, instead of silently returning plaintext - Prevents sensitive data (IBAN, Kontoinhaber, Allergien) from being stored unencrypted - Updated test to verify the new exception behavior ## Test plan - [x] All existing unit tests pass with updated expectation - [x] Encryption failure now throws RuntimeException - [x] Error message is user-friendly in German Closes #165
shahondin1624 added 1 commit 2026-04-10 16:15:27 +02:00
EncryptionService.encrypt() now throws RuntimeException when ICrypto
fails instead of silently returning plaintext. This prevents sensitive
data (IBAN, medical info) from being stored unencrypted in the database.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shahondin1624 merged commit 7d3be60adb into main 2026-04-10 16:15:31 +02:00
shahondin1624 deleted branch feature/issue-165-encryption-no-plaintext-fallback 2026-04-10 16:15:31 +02:00
Sign in to join this conversation.