Forum Discussion

Former Member's avatar
Former Member
4 years ago

[2,3,4,6] Spaces in secrets references

Hi,

Currently https://developer.1password.com/docs/cli/secrets-reference-syntax that space characters are not allowed in the op://* secrets references. Are there any plans to add support for it (with e.g. quoting or escaping)? We have many Vaults and probably most Items with spaces in the names...

Cheers,
- Teemu


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided

5 Replies

  • Former Member's avatar
    Former Member

    Yes, a copy button would be excellent!

    Another feature that might be useful was to search by the item ID. I had an op item get command with just item ID but without the vault, so it turned out hard to find which vault it was, and what's the name of the item. :)

  • 1P_Simon's avatar
    1P_Simon
    Icon for 1Password Team rank1Password Team

    Hi, and thank you again!

    We're thinking about creating a Copy Reference button in the desktop clients so you can easily copy references to the secrets you want to use. Would that cover your use case or would you need access to the ID for other purposes as well where you need just the ID without it being in a complete reference including vault, item and field (op://<vault>/<item>[/<section>]/<field>)?

    Thank you for providing feedback on using items with spaces. I'll make sure we take that into account when looking into this.

    Happy Monday!
    Cheers,
    Simon

  • Former Member's avatar
    Former Member

    Hi,

    Thanks for the answers!

    Mixing IDs and names is a great advice! Please add that to the documents, too. :)

    Using ID to reference an item can in some cases be even better, as I think it's more common to change the name than the ID (i.e. recreate). But IDs are cryptic. It would also help if the 1Password desktop clients would offer an easy way to see the item ID. Seems that with reduced permissions to a vault, you can't even see the "share/copy" link. And searching with CLI is clumsier than with the Desktop app. After having the item ID, CLI is fine for looking at the details.

    About the escaping/quoting it's a bit early for me to tell. For op read just quoting the whole URI argument (in shell) would be the most natural, but not sure if that works well with e.g. inject. Replacing spaces with - or _ doesn't sound tempting, especially if you later support other "weird" characters.

    I guess it would be best if all possible way are supported. Meaning quoting, escaping spaces and / characters in the names, etc. Easy to ask, I know. :)

  • 1P_Simon's avatar
    1P_Simon
    Icon for 1Password Team rank1Password Team

    Hi @r00t, currently the secret references support only alphanumeric characters to be used in the labels. We're looking into options for dealing with items that have characters that are not in that supported set, with spaces definitely being the most common use case we've heard of.

    Would you prefer to be able to escape/quote or be able to use - and/or _ in the place of spaces when referring to a secret where the vault-, item-, section-, or field label contains spaces?

  • Former Member's avatar
    Former Member

    Hi @r00t,
    Thank you for trying out our beta, and for your feedback.
    We are currently still working on the secret referencing. Your feedback is really valuable to us, so I'll make sure to raise the issue of the limited character set for secret references with my teammates.
    In the meantime, a possible workaround for this issue could be to use vault/item ID's, as these are supported by op run/op inject as well.
    That is, secret references of type op://<vault-id>/<item-id>/<field-name> or op://<vault-id>/<item-id>/<field-id> work the same as op://<vault-name>/<item-name>/<field-name>. This is assuming you authenticate with the CLI using your 1Password account, and not Connect.
    Let me know if this helps you.
    Once again, thank you for trying out our product, and keep the feedback coming! We love to hear your input.

    Horia