Skip to content

Conversation

@rokn
Copy link
Contributor

@rokn rokn commented Nov 3, 2024

inspired by adnandaut and my needs.

fixes #66 by adding support for the read CLI command

this can be tested like this:

>>> from onepassword import OnePassword
>>> OnePassword.read("<a secret reference>")

Signed-off-by: Antonio Mindov <amindov98@gmail.com>
@dtpryce
Copy link
Collaborator

dtpryce commented Nov 3, 2024

Nice PR! Any chance you can also add support for getting the secret reference in a new class method? Then everything in the user workflow can be done in python too?

@dtpryce
Copy link
Collaborator

dtpryce commented Nov 3, 2024

Also is this only support by a certain cli version?

@rokn
Copy link
Contributor Author

rokn commented Nov 3, 2024

Nice PR! Any chance you can also add support for getting the secret reference in a new class method? Then everything in the user workflow can be done in python too?

Thanks! I'm not sure if that's something users would want to do as I imagine that this will be used to fill in secrets which are already set from somewhere. But even so there is a way to get the reference with the current API:

OnePassword.get_item("Item")["fields"][0]['reference']

Also is this only support by a certain cli version?

The read command is available for 2.0 and up (ref: https://app-updates.agilebits.com/product_history/CLI2#2.0.0:~:text=Secfault%20Security.%20%7B2183%7D-,2.0.0,-(build%20%232000019)%20%E2%80%93%20released)

@dtpryce
Copy link
Collaborator

dtpryce commented Nov 4, 2024

Nice PR! Any chance you can also add support for getting the secret reference in a new class method? Then everything in the user workflow can be done in python too?

Thanks! I'm not sure if that's something users would want to do as I imagine that this will be used to fill in secrets which are already set from somewhere. But even so there is a way to get the reference with the current API:

OnePassword.get_item("Item")["fields"][0]['reference']

Also is this only support by a certain cli version?

The read command is available for 2.0 and up (ref: https://app-updates.agilebits.com/product_history/CLI2#2.0.0:~:text=Secfault%20Security.%20%7B2183%7D-,2.0.0,-(build%20%232000019)%20%E2%80%93%20released)

Ok great! So I would also suggest some clear example(s) in the README then to make sure users know how to use! Since it's v2+ then we are good, I do intend to update with a fixed version we support since we keep getting issues with backwards compatibility and users installing the cli as they wish.

@dtpryce dtpryce self-requested a review November 4, 2024 12:53
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 comments - please add some example(s) in README

@dtpryce
Copy link
Collaborator

dtpryce commented Nov 4, 2024

Would this also resolve the need for --reveal seen in #65 ?

Signed-off-by: Antonio Mindov <amindov98@gmail.com>
@rokn
Copy link
Contributor Author

rokn commented Nov 4, 2024

Added the README updates.

I'm not sure this has anything to do with the --reveal requirement.

@LPLabrys99
Copy link

This PR adds a capability which I couldn't find elsewhere in this module - reading file attachments from regular secrets. It seems the only way to do it currently is with the CLI command op read ...

@dtpryce dtpryce merged commit 170ebc3 into wandera:main Jan 6, 2025
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.

Add support for secret references with op read

3 participants