Skip to content

return context with secret material with getSecretAndContext#258

Open
kiran wants to merge 3 commits into
fugue:masterfrom
kiran:get-secret-and-version
Open

return context with secret material with getSecretAndContext#258
kiran wants to merge 3 commits into
fugue:masterfrom
kiran:get-secret-and-version

Conversation

@kiran

@kiran kiran commented Nov 1, 2019

Copy link
Copy Markdown

When getting a secret, it's sometimes helpful to retrieve extra context associated with it.

Note: I'm not tied to the shape of the return value.

@kiran kiran changed the title return extra context with getSecret return context with secret material with getSecretAndContext Nov 1, 2019
@mike-luminal mike-luminal self-assigned this Jan 25, 2020

@mike-luminal mike-luminal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea, but can you rename this to getSecretAndMetadata to reduce the chance of confusion with the KMS Encryption Context?

@kiran

kiran commented Jan 30, 2020

Copy link
Copy Markdown
Author

@mike-luminal ah, good point. The PR is updated with the new naming.

@mike-luminal

Copy link
Copy Markdown
Contributor

Hmm, it looks like this would change the default output of credstash get <secret>. Could you preserve the existing behavior and add an option such as --with-metadata to credstash get for the full output with metadata?

@kiran

kiran commented Feb 12, 2020

Copy link
Copy Markdown
Author

Yup, sorry!

$ credstash put -a --comment="testing comments" testsecret fake
testsecret has been stored
$ credstash get testsecret
fake
$ credstash get -m testsecret
('fake', {'version': '0000000000000000002', 'comment': 'testing comments'})
$ credstash get --include-metadata testsecret
('fake', {'version': '0000000000000000002', 'comment': 'testing comments'})

@kiran kiran requested a review from mike-luminal March 31, 2020 19:07
@jason-fugue

Copy link
Copy Markdown
Contributor

Thanks for the PR! And sorry for the delay on this after you made the requested changes. This all looks good to me. Could you please resolve the merge conflicts and I'll get this merged in?

@kiran kiran force-pushed the get-secret-and-version branch from 34136db to 7c2f4c3 Compare February 8, 2022 23:46
@kiran kiran force-pushed the get-secret-and-version branch from 7c2f4c3 to bfa727a Compare February 9, 2022 00:08
@kiran

kiran commented Feb 9, 2022

Copy link
Copy Markdown
Author

@jason-fugue thanks for the review!
I resolved the merge conflicts, and ran

$ credstash put -a --comment="testing comments" testsecret fake
testsecret has been stored
$ credstash get testsecret
fake
$ credstash get -m testsecret
('fake', {'version': '0000000000000000002', 'comment': 'testing comments'})
$ credstash get --include-metadata testsecret
('fake', {'version': '0000000000000000002', 'comment': 'testing comments'})

again, just to test, as well as rerunning the unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants