Skip to content

Commit

Permalink
Merge pull request #1122 from 99designs/fix-cred-process
Browse files Browse the repository at this point in the history
Fix credential_process
  • Loading branch information
mtibben authored Feb 3, 2023
2 parents dd8de8e + 5c669e7 commit 0f1764c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,6 @@ func (t *tempCredsCreator) getSourceCreds(config *Config) (sourcecredsProvider a
log.Printf("profile %s: sourcing credentials from profile %s", config.ProfileName, config.SourceProfile.ProfileName)
return t.GetProviderForProfile(config.SourceProfile)
}
if config.HasCredentialProcess() {
log.Printf("profile %s: sourcing credentials from credential process", config.ProfileName)
return NewCredentialProcessProvider(t.keyring.Keyring, config)
}

hasStoredCredentials, err := t.keyring.Has(config.ProfileName)
if err != nil {
Expand All @@ -257,6 +253,11 @@ func (t *tempCredsCreator) GetProviderForProfile(config *Config) (aws.Credential
return NewAssumeRoleWithWebIdentityProvider(t.keyring.Keyring, config)
}

if config.HasCredentialProcess() {
log.Printf("profile %s: using credential process", config.ProfileName)
return NewCredentialProcessProvider(t.keyring.Keyring, config)
}

sourcecredsProvider, err := t.getSourceCreds(config)
if err != nil {
return nil, err
Expand Down

0 comments on commit 0f1764c

Please sign in to comment.