1Password / terraform-provider-onepassword

Use the 1Password Terraform Provider to reference, create, or update items in your 1Password Vaults.
https://developer.1password.com/docs/terraform/
MIT License
324 stars 48 forks source link

fix: fix op cli always generating passwords #127

Closed josh-burton closed 10 months ago

josh-burton commented 11 months ago

When invoking the op cli, if the onepassword item had no password recipe, generate-password would always be appended to the cli args and any password value would be overwritten by a generated password.

Note I am very new to Go so please point me in the right direction if needed :)

As part of this fix I have extracted the logic which constructs the generate-password cli arg into a function in utils, and implemented a test around it.

Fixes #128

josh-burton commented 10 months ago

@edif2008 thanks for the review :) I've updated the PR description and applied your suggestion.