Closed blahspam closed 2 years ago
Some 1Password items have fields whose label contains a space but also contain a snake_cased id that would make a better key when decoding.
label
id
One example is ssh key (edited for brevity):
{ "id": "blahblahblah", "category": "SSH_KEY", "fields": [ { "id": "private_key", "type": "UNKNOWN", "label": "private key", "value": "......" }] }
Using label makes templating a bit cumbersome:
{{ (index (onepasswordDetailsFields "someidvalue") "private key").value }}
It would be great if onepasswordDetailsFields preferred id over label when decoding fields: https://github.com/twpayne/chezmoi/blob/cb3db977ae221e028b38a3aa10f0ff1e7dc47982/pkg/cmd/onepasswordtemplatefuncs.go#L123
onepasswordDetailsFields
Thanks, this makes sense.
Is your feature request related to a problem? Please describe.
Some 1Password items have fields whose
label
contains a space but also contain a snake_casedid
that would make a better key when decoding.One example is ssh key (edited for brevity):
Using
label
makes templating a bit cumbersome:It would be great if
onepasswordDetailsFields
preferredid
overlabel
when decoding fields: https://github.com/twpayne/chezmoi/blob/cb3db977ae221e028b38a3aa10f0ff1e7dc47982/pkg/cmd/onepasswordtemplatefuncs.go#L123