-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(secret-manager): add optional ttl field to createSecret function #3937
base: main
Are you sure you want to change the base?
Conversation
- Introduced the 'ttl' parameter in the Node.js sample for creating secrets. - Ensured backward compatibility by handling cases where 'ttl' is undefined.
Gemini encountered an error creating the summary. You can try again by commenting |
async function main( | ||
parent = 'projects/my-project', | ||
secretId = 'my-secret', | ||
ttl = undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case, could you go ahead and set it to 900s instead of undefined?
@code-review-assist review |
This pull request adds an optional |
@code-review-assist walkthrough |
Gemini encountered an error creating the walkthrough. You can try again by commenting |
@code-review-assist summarize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi team,
I'm currently reviewing this pull request and will have a full review ready in a few minutes. In the meantime, here's a quick summary to help you and other reviewers get up to speed:
This pull request, authored by @hivanalejandro, enhances the secret-manager/createSecret.js
sample by adding an optional ttl
(time-to-live) parameter to the createSecret
function. This allows users to specify a lifespan for their secrets.
Here's a breakdown of the changes:
- Intent: Improve flexibility and security by allowing users to set an expiration time for secrets created using the Node.js sample.
- Changes:
- Added a new
ttl
parameter to themain
function insecret-manager/createSecret.js
. - Modified the
createSecret
function to accept and use thettl
parameter when creating a secret. It also handles cases wherettl
is undefined (for backward compatibility). - Updated comments to reflect the new
ttl
parameter and its usage.
- Added a new
The changes are well-structured and clearly documented. The addition of the optional ttl
parameter is a valuable enhancement that improves the usability and security of the createSecret
function.
And now, a little haiku to lighten the mood:
Secrets short or long,
Time to live, a choice is made,
Code flows, secure.
Thanks,
Gemini
@code-review-assist walkthrough |
Gemini encountered an error creating the walkthrough. You can try again by commenting |
Description
Fixes b-384052815
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.