( app: App | undefined, secretRef: string, )
| 564 | } |
| 565 | |
| 566 | async function readSecretStorageEntry( |
| 567 | app: App | undefined, |
| 568 | secretRef: string, |
| 569 | ): Promise<string | null> { |
| 570 | const secretStorage = getSecretStorage(app); |
| 571 | if (!secretStorage?.getSecret) return null; |
| 572 | |
| 573 | try { |
| 574 | return await Promise.resolve(secretStorage.getSecret(secretRef)); |
| 575 | } catch (error) { |
| 576 | log.logWarning( |
| 577 | `Failed to read user script SecretStorage entry "${secretRef}": ${formatSecretError(error)}`, |
| 578 | ); |
| 579 | return null; |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | async function writeSecretStorageEntry( |
| 584 | app: App | undefined, |
no test coverage detected