-
Notifications
You must be signed in to change notification settings - Fork 141
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
fix secrets stored in JSON format #473
Conversation
3e33a89
to
a24b038
Compare
7b2ddb7
to
788264d
Compare
src/secrets.js
Outdated
if (isJSONString(d)) { | ||
// If we already have a JSON string we will not "stringify" it yet so | ||
// that we don't end up calling JSON.parse. This would break the | ||
// secrets that are stored as pure JSON. See: https://github.com/hashicorp/vault-action/issues/194 |
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.
I feel like you mentioned this before so apologies if this is a repeated q:
Are we avoiding calling JSON.stringify
here because under the hood it calls JSON.parse
? In that case, a follow up — Hasn't the try-catch block on L139-L143 ensured that JSON.parse
does not break things?
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.
No, JSON.parse does not call JSON.stringify --if I am understanding you correctly. I see how this comment might convey that though. I will see if I can improve the wording a bit.
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.
LGTM
- name: Verify Vault Action Outputs | ||
run: npm run test:integration:e2e | ||
env: | ||
OTHER_SECRET_OUTPUT: ${{ steps.kv-secrets.outputs.otherSecret }} | ||
|
||
|
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.
Looks like an accidental second newline added?
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.
Whoops submitted this too late 😓
We broke support for secrets in JSON format in #173. This adds that support back and also adds more tests to ensure we can catch any regressions moving forward.
Closes #194