-
Notifications
You must be signed in to change notification settings - Fork 27
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
1password-client/install_op.py
Line 8 in 2331849
cli_version = "2.19.0" - 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("."))) |
There was a problem hiding this comment.
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 "" |
There was a problem hiding this comment.
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
--reveal
when getting items if CLI is version v2.30.0 or later