cloudfoundry / credhub-cli

CredHub CLI provides a command line interface to interact with CredHub servers
Apache License 2.0
39 stars 44 forks source link

Feature request: global `credhub-namespace` flag #79

Closed joshzarrabi closed 4 years ago

joshzarrabi commented 5 years ago

The credhub cli should respect a credhub-namespace global flag and environment variable which is a credhub path that will prepend all variables that the credhub cli consumes.

All concourse variables must start with the path /concourse/main/ and while manipulating them with the credhub cli I often forgot to add this path at the beginning and end up with credentials stored at the wrong path.

What did you expect to happen?

I would like to set an environment variable CREDHUB_NAMESPACE which specifies the starting path of all credhub variables set in my environment.

For example:

$ export CREDHUB_NAMESPACE=/concourse/main
$ credhub set --name some_concourse_var --type value --value some-concourse-secret
id: some-id
name: /concourse/main/some_concourse_var
type: value
value: <redacted>
version_created_at: "2019-07-23T15:47:19Z"

If you have interest in this/another use case, please comment on this so that we can gather if there's interest in this feature.

cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/167461106

The labels on this github issue will be updated when the story is started.

elenorebastian commented 4 years ago

We think creating an environment variable would create unnecessary confusion. Abstracting the namespace might create more overhead in this case rather than simplifying the problem.