feat(secret-manager): add optional ttl field to createSecret function#3950
feat(secret-manager): add optional ttl field to createSecret function#3950briandorsey merged 13 commits intomainfrom
Conversation
ghost
left a comment
There was a problem hiding this comment.
Hi team,
I'm currently reviewing this pull request and will provide my feedback shortly. In the meantime, here's a summary for you and other reviewers to quickly get up to speed:
This pull request, authored by @hivanalejandro, aims to add an optional ttl (time-to-live) field to the createSecret function in the secret-manager Node.js sample. The intent is to allow users to specify a lifespan for their secrets.
Here's a breakdown of the changes:
- File Changed:
secret-manager/createSecret.js- An optional
ttlparameter has been added to themainfunction, allowing users to specify the secret's time-to-live in seconds (e.g.,'900s'for 15 minutes). - The code now handles cases where
ttlis undefined, ensuring backward compatibility. - The
createSecretfunction is modified to include thettlin the secret configuration if provided.
- An optional
The changes are implemented cleanly and efficiently. The code is well-documented and easy to understand. Backward compatibility is maintained by handling the case where ttl is not provided. The addition of the ttl parameter enhances the functionality of the createSecret function, providing users with more control over their secrets.
I'll be providing a more detailed review soon.
And now, a little haiku to lighten the mood:
Secrets short or long,
Time to live, a new option,
Code flows smoothly on.
ghost
left a comment
There was a problem hiding this comment.
This pull request adds an optional TTL field to the createSecret function, which is a good improvement. The implementation looks correct and maintains backward compatibility. However, there are a few minor suggestions for improvement.
briandorsey
left a comment
There was a problem hiding this comment.
Overall looks good.
Could I ask you to also update the test (I think it's: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/4f660cdf6874bd4c3d5c2c9c1335caef2d20c8a3/secret-manager/test/secretmanager.test.js#L248C7-L248C23) to pass the new TTL parameter as well?
|
Hi @briandorsey. The test has been updated to pass the new TTL parameter (741ca18) |
briandorsey
left a comment
There was a problem hiding this comment.
LGTM, thanks for the detailed iteration work!
Description
Fixes:
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
npm test(see Testing)npm run lint(see Style)GoogleCloudPlatform/nodejs-docs-samples. Not a fork.