-
Notifications
You must be signed in to change notification settings - Fork 486
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
Newline is not removed with value coming from 1password #2498
Comments
This looks like a bug in The whitespace removal features $ chezmoi execute-template ':{{- "\n" }}:'
:
:⏎ You can work around this with $ chezmoi execute-template ':{{- "\n" | trim }}:'
::⏎ So for you, that would be: $ chezmoi execute-template --verbose '{{- onepasswordRead "op://Personal/Postgres/username" | trim -}}:{{- onepasswordRead "op://Personal/Postgres/password" | trim -}}'
test_user:test_password We should still fix $ echo .$(op read op://Personal/item/username --format json).
.halostatue. |
I don't think this will work in the case where the data being read from 1Password is a complete file (personal example retrieving SSH private key from 1Password). In these cases, whitespace might be significant or the file's contents might already be in JSON format. chezmoi returns the output of |
@twpayne is correct. |
Indirectly, the lack of setting `onepasswordArgs.account` in `onepasswordReadTemplateFunc` was causing 1Password to prompt me for an account, even though it's provided. The selection is prompted by the `withSessionToken` handling, which depends on `onepasswordAccount.account`. Discovered while investigating twpayne#2498.
Indirectly, the lack of setting `onepasswordArgs.account` in `onepasswordReadTemplateFunc` was causing 1Password to prompt me for an account, even though it's provided. The selection is prompted by the `withSessionToken` handling, which depends on `onepasswordAccount.account`. Discovered while investigating #2498.
Indirectly, the lack of setting `onepasswordArgs.account` in `onepasswordReadTemplateFunc` was causing 1Password to prompt me for an account, even though it's provided. The selection is prompted by the `withSessionToken` handling, which depends on `onepasswordAccount.account`. Discovered while investigating #2498.
Thank you for all the fixes @halostatue, both the suggestion to use Hopefully this is now resolved. Please re-open if needed, |
I was just looking over some additional details and found this for
Wondering if we should look at adding that to our call of |
Yes, I think that should be the default. Can you check which version of |
Fixes twpayne#2498 and documents the changed behaviour.
From 2.0, when |
Fixes twpayne#2498 and documents the changed behaviour.
Great! So we can use |
Fixes twpayne#2498 and documents the changed behaviour. Moved `onepasswordRead` tests from `onepassword.txtar` to `onepassord2.txtar`, as 1Password CLI v1 does not have `op read`. Testing now for error conditions.
Fixes #2498 and documents the changed behaviour. Moved `onepasswordRead` tests from `onepassword.txtar` to `onepassord2.txtar`, as 1Password CLI v1 does not have `op read`. Testing now for error conditions.
Describe the bug
When value is rendered from 1password newline is not removed. It is important if you try to construct url based on
username
,password
etcTo reproduce
Expected behavior
Newline is removed since
{{-
and-}}
are used.Output of command with the
--verbose
flagOutput of
chezmoi doctor
Additional context
The text was updated successfully, but these errors were encountered: