-
Notifications
You must be signed in to change notification settings - Fork 464
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
Fix op signin
for v2
#1961
Fix op signin
for v2
#1961
Conversation
88a907f
to
9f6b0e2
Compare
The release of op 2.0.0 introduced a breaking change to `op signin` so that the previous version invocation `op signin account` no longer works. Now, it is required to use the option `--account`, as in `op signin --account account`. Note that there is likely another issue hidden by this when not using biometric authentication for `op`, because the session environment variable is no longer `OP_SESSION_<account>` but `OP_SESSION_<accountUUID>`. If the account is specified as the account UUID, everything will probably work. I’m using biometric authentication, so I cannot easily verify this. Also note that in `op` v1, you could specify `--vault ''`; this is no longer legal. https://1password.community/discussion/128083/problems-with-op-v2-when-integrating-with-chezmoi#latest
Adjust the 1Password CLI 2.0 documentation to cover changes made to the protocols used by chezmoi (preferring the account UUID over the account name because of the change in `OP_SESSION_*` variables and not specifying an empty vault because of errors). https://1password.community/discussion/128083/problems-with-op-v2-when-integrating-with-chezmoi#latest
9f6b0e2
to
06d52f2
Compare
Note that I am trying to fix failures with test scripts on Windows, but I think that the better option would be to modify the logic in if len(userArgs) > 1 && userArgs[1] != "" {
a.vault = userArgs[1]
a.args = append(a.args, "--vault", a.vault)
}
if len(userArgs) > 2 && userArgs[2] != "" {
a.account = userArgs[2]
a.args = append(a.args, "--account", a.account)
} This would prevent adding |
Thank you for such a high quality pull request - including tests and documentation, thank you!
This indeed does sound like the better option. Please do implement this. |
For Windows, I'll happily still accept this PR even if you don't get the tests passing on Windows. Windows is quite a peculiar beast, and it can be extremely tiresome debugging through GitHub Action failure round-trips. I've got a local Windows machine for chezmoi development and will happily implement the Windows fixes if you don't have access to a Windows box. |
@twpayne You’re going to have more documentation to review, because I decided to really finalize the the documentation for 1Password CLI v2 as well as implementing the changes discussed above. fix: Finalize 1Password CLI 2.x support
Hopefully, the tests will entirely pass now. |
- Ensure that `--vault ''` and `--account ''` will not be passed when given empty strings. This did not cause problems for 1Password 1.x, but errors out on 1Password 2.x. - Finalize documentation, emphasizing 1Password 2.x formatting first. - Changed some announcement box types to reflect the changes that are caused by using 1Password 2.x.
5659a28
to
9ecc8d4
Compare
Thanks very much for this, I made a couple of minor tweaks in #1966. |
The release of op 2.0.0 introduced a breaking change to
op signin
so that the previous version invocationop signin account
no longer works. Now, it is required to use the option--account
, as inop signin --account account
.Note that there is likely another issue hidden by this when not using biometric authentication for
op
, because the session environment variable is no longerOP_SESSION_<account>
butOP_SESSION_<accountUUID>
. If the account is specified as the account UUID, everything will probably work. I’m using biometric authentication, so I cannot easily verify this.Also note that in
op
v1, you could specify--vault ''
; this is no longer legal.https://1password.community/discussion/128083/problems-with-op-v2-when-integrating-with-chezmoi#latest