Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --reveal to cli for v2.30.0 and later #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

csteinle
Copy link

@csteinle csteinle commented Sep 6, 2024

Copy link
Collaborator

@dtpryce dtpryce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in a comment I would actually go with making 2.30.0 the minimum supported version which would also need:

  • README updated to reflect this
  • cli_version = "2.19.0"
    updated to reflect this
  • testing to make sure all methods work with new client (follow basic steps in README is enough for me)

Happy to discuss, thanks for the great contribution. Pretty much there!

@@ -277,6 +277,8 @@ class OnePassword:
:param account: 1Password account name (Optional, default=None)
:param password: password of 1Password account (Optional, default=None)
"""
cli_version = tuple(map(int, read_bash_return("op --version").split(".")))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually try not to do this and just fix the version in the install.py it gave us a lot more headaches trying to be fully backwards compatible and so we try to maintain and bump when we can. I know we suggest you can have any version over 2.0.0 in the README but if this new flag is a break change, let's update that suggestion :D

@@ -431,9 +433,10 @@ def get_item(uuid: str | bytes, fields: str | bytes | list | None = None):
(Optional, default=None which means all fields returned)
:return: Dictionary of the item with requested fields
"""
reveal = "--reveal" if cls.cli_version >= (2, 30, 0) else ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go with my suggestions you won't need this and can just add --reveal to every op call that requires it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Cannot obtain secret fields with op 2.30.0 or later
2 participants