(encryptedValue: string)
| 28 | * rethrows on malformed input or tampered ciphertext. |
| 29 | */ |
| 30 | export async function decryptSecret(encryptedValue: string): Promise<{ decrypted: string }> { |
| 31 | try { |
| 32 | return await decrypt(encryptedValue, getEncryptionKey()) |
| 33 | } catch (error) { |
| 34 | logger.error('Decryption error:', { error: toError(error).message }) |
| 35 | throw error |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Generates a secure random password |
no test coverage detected