Skip to content

Commit

Permalink
Merge pull request #58 from intelops/service-cred-sync-credid-log
Browse files Browse the repository at this point in the history
log update for sync credential
  • Loading branch information
vramk23 authored Aug 19, 2023
2 parents 1ffe1b6 + b724496 commit 56e7f42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/job/vault-cred-sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,18 @@ func (v *VaultCredSync) storeServiceCredential(ctx context.Context, vc *client.V
return errors.WithMessagef(err, "credential attributes are emty for %s secret data", secretIdentifier)
}

cred := map[string]string{serviceCredentialUserNameKey: serviceCredData.CredIndentifier,
cred := map[string]string{serviceCredentialUserNameKey: serviceCredData.UserName,
serviceCredentialPasswordKey: serviceCredData.Password}
for key, val := range serviceCredData.AdditionalData {
cred[key] = val
}

secretPath := api.PrepareCredentialSecretPath(strings.ToLower(serviceCredSecretKeyPrefix), serviceCredData.EntityName, serviceCredData.UserName)
secretPath := api.PrepareCredentialSecretPath(strings.ToLower(serviceCredSecretKeyPrefix), serviceCredData.EntityName, serviceCredData.CredIndentifier)
err = vc.PutCredential(ctx, api.CredentialMountPath(), secretPath, cred)
if err != nil {
return errors.WithMessagef(err, "failed to write %s secret data to vault", secretIdentifier)
}
v.log.Infof("stored sync service credential for %s/%s", serviceCredData.EntityName, serviceCredData.UserName)
v.log.Infof("stored sync service credential for %s/%s", serviceCredData.EntityName, serviceCredData.CredIndentifier)
return nil
}

Expand Down

0 comments on commit 56e7f42

Please sign in to comment.