Skip to content

Vault names can have . character when creating them, but they aren't valid paths for secrets commands #251

@CMCDragonkai

Description

@CMCDragonkai

Describe the bug

cmcdragonkai ➜ matrix-ml-1  ➜ ~/Projects/Polykey-CLI
 $ ./dist/polykey.js secrets edit 'polykey.com:/POLYKEY_COM_GITHUB_TOKEN'
error: command-argument value 'polykey.com:/POLYKEY_COM_GITHUB_TOKEN' is invalid for argument 'secretPath'. polykey.com:/POLYKEY_COM_GITHUB_TOKEN is not of the format <vaultName>:<directoryPath>

Notice that polykey.com is a valid vault name, but it cannot be referred to when editing a secret path.

The regex must be aligned between the 2. Also new fast check inputs need to be checked to ensure that all usages of "secret path" or "vault name" are consistent.

To Reproduce

  1. Create polykey.com vault
  2. Try to edit a file inside it like polykey.com:/somesecret

Expected behavior

Given that we expect that : to be the separation, pretty much any alphanum plus basic symbols.

The question is what symbols should be allowed for vault names. We should allow most characters on standard keyboards, and even utf-8 characters. Actually why not allow anything except :, since that's the distinguishing character.

Notify maintainers

@tegefaulkes @aryanjassal

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions