wandera / 1password-client

Python wrapper for OnePassword CLI developed at Wandera.
MIT License
47 stars 25 forks source link

Cannot obtain secret fields with op 2.30.0 or later #64

Open csteinle opened 1 month ago

csteinle commented 1 month ago

Describe the bug Since 2.30.0 of the 1password CLI, the option --reveal is required to obtain passwords and other secret fields. See https://app-updates.agilebits.com/product_history/CLI2#v2300006

To Reproduce

from onepassword import OnePassword

op = OnePassword()

uuid = op.get_uuid("Item Name", vault="Vault Name")

token = op.get_item(uuid=uuid, fields="token")["token"]

print(token)
[use 'op item get <redacted> --reveal' to reveal]

Expected behavior Password or token retrieved

Screenshots N/A

Desktop (please complete the following information): op CLI version 2.30.0 or greater

Smartphone (please complete the following information): N/A

Additional context N/A

dtpryce commented 1 month ago

We should update the README to mention that we try to support a fixed version of the cli, but yeah this looks like a backward incompatiblity. Any chance you can create a PR for this otherwise we will try to fix as soon as we can (might be some time) or just suggest people to downgrade op cli for now.

csteinle commented 1 month ago

I've submitted a PR (with some unit tests specifically for this change)