(client: SecretsManagerClient, secretId: string)
| 55 | } |
| 56 | |
| 57 | async function fetchSecretString(client: SecretsManagerClient, secretId: string): Promise<string> { |
| 58 | const response = await sendWithRetry(client, secretId) |
| 59 | if (!response.SecretString) { |
| 60 | // Non-retriable: a binary secret will never become a string between attempts. |
| 61 | throw new Error('Secret has no SecretString (binary secrets are not supported)') |
| 62 | } |
| 63 | return response.SecretString |
| 64 | } |
| 65 | |
| 66 | async function sendWithRetry( |
| 67 | client: SecretsManagerClient, |
no test coverage detected