Credential Encryption Handler
Component Detail
Description
Utility that encrypts and decrypts OAuth client secrets using a server-managed symmetric key before they are written to or read from the database. Ensures credentials are never stored or returned in plaintext, satisfying the security review requirement stated in the implementation notes.
credential-encryption-handler
Sources & reasoning
The implementation notes explicitly require OAuth credentials to be encrypted at rest and never returned in plaintext to client responses. Extracting this into a dedicated handler enforces the constraint consistently across save, update, and read paths without duplicating crypto logic in the service layer.
No source references — this artifact was included based on reasoning alone (see above).
Responsibilities
- Encrypt client secret value before database write using AES-256-GCM or equivalent
- Decrypt client secret in-process only when needed for test-connection or outbound handshake
- Provide a redact helper that replaces secret values with masked placeholder strings for API responses
Interfaces
encrypt(plaintext)
decrypt(ciphertext)
redact(value)
Related Data Entities (1)
Data entities managed by this component