Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 83f9ff5

Browse files
committed
Add comments explaining duplicated env var checking
1 parent bd428b9 commit 83f9ff5

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

internals/secrethub/client_factory.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type clientFactory struct {
4040
}
4141

4242
// Register the flags for configuration on a cli application.
43+
// The environment variables of these flags are also checked on the client, but checking them here allows us to fail fast.
4344
func (f *clientFactory) Register(r FlagRegisterer) {
4445
r.Flag("api-remote", "The SecretHub API address, don't set this unless you know what you're doing.").Hidden().URLVar(&f.ServerURL)
4546
r.Flag("identity-provider", "Enable native authentication with a trusted identity provider. Options are `aws` (IAM + KMS), `gcp` (IAM + KMS) and `key`. When you run the CLI on one of the platforms, you can leverage their respective identity providers to do native keyless authentication. Defaults to key, which uses the default credential sourced from a file, command-line flag, or environment variable. ").Default("key").StringVar(&f.identityProvider)

internals/secrethub/credential_store.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func (store *credentialConfig) IsPassphraseSet() bool {
5151
}
5252

5353
// Register registers the flags for configuring the store on the provided Registerer.
54+
// The environment variables of these flags are also checked on the client, but checking them here allows us to fail fast.
5455
func (store *credentialConfig) Register(r FlagRegisterer) {
5556
r.Flag("config-dir", "The absolute path to a custom configuration directory. Defaults to $HOME/.secrethub").Default("").PlaceHolder("CONFIG-DIR").SetValue(&store.configDir)
5657
store.credentialFlag = r.Flag("credential", "Use a specific account credential to authenticate to the API. This overrides the credential stored in the configuration directory.")

0 commit comments

Comments
 (0)