Skip to content
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

credhub: set using contents of file, export to file in json format #220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions credhub
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
syntax: bash
tags: [ credhub ]
---
# To set a CredHub credential, of type 'value', using the contents of a file:
credhub set -n <credential-path> -t value -v "$(cat <file-path>)"
Comment on lines +5 to +6
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# To set a CredHub credential, of type 'value', using the contents of a file:
credhub set -n <credential-path> -t value -v "$(cat <file-path>)"
# To set a CredHub credential, of type `value`, using the contents of a specific file:
credhub set -name <credential-path> -type <password|user|certificate|ssh|rsa> -value "$(cat <in-file>)"

Optional fix: specific may sound better.
Optional fix: long options can be used for readability.
Optional fix: -type values can be inlined.
Optional fix: path placeholders can be standardized according to this PR.


# To export descendant CredHub credentials to a file in JSON format:
credhub export -p <credential-path> -f <file-name>.json -j
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# To export descendant CredHub credentials to a file in JSON format:
credhub export -p <credential-path> -f <file-name>.json -j
# To export descendant CredHub credentials to a file in JSON format:
credhub export -private <credential-path> -fail <out-file.json> -output-json

The same issue as above.