Skip to content

Commit 865a49e

Browse files
authored
Merge pull request #11 from smartcontractkit/feat/max-secrets-expiration
2 parents cabb3f3 + c94dbc0 commit 865a49e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.changeset/shaggy-ghosts-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@chainlink/functions-toolkit': patch
3+
---
4+
5+
Added maximum expiration for DON hosted secrets

src/SecretsManager.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,14 @@ export class SecretsManager {
205205
throw Error('slotId must be a integer of at least 0')
206206
}
207207

208-
if (!Number.isInteger(minutesUntilExpiration) || minutesUntilExpiration < 5) {
209-
throw Error('minutesUntilExpiration must be an integer of at least 5')
208+
if (
209+
!Number.isInteger(minutesUntilExpiration) ||
210+
minutesUntilExpiration < 5 ||
211+
minutesUntilExpiration > 2880
212+
) {
213+
throw Error(
214+
'minutesUntilExpiration must be an integer of at least 5 and less than 2880 (48 hours)',
215+
)
210216
}
211217

212218
const encryptedSecretsBase64 = Buffer.from(encryptedSecretsHexstring.slice(2), 'hex').toString(

0 commit comments

Comments
 (0)