Skip to content
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

Allow for specifying command arguments as list in parameter/credential sets #311

Open
lbergnehr opened this issue Feb 6, 2025 · 0 comments

Comments

@lbergnehr
Copy link

It's possible to specify a value for a parameter/credential as a command using the command source. However, this command string will eventually be split on spaces, i.e. not allowing for any complex commands with shell split semantics (quoting etc), making it hard to do anything more advanced than simply a command with arguments.

Sometimes you might want to clean up the data coming from a specific command, e.g. piping to tr or sed. This is possible when using an external script file, but then the requirements becomes that all users using that parameter/credential set will have to have the script file available.

If supporting list as a type to the command source, it would become more flexible in which parts of the command are arguments and that they are not necessarily space-separated, e.g. sh -c "echo hello world" would be specified as [sh, -c, echo hello world], while today this is interpreted as (using the same semantics): [sh, -c, "echo, hello, world"].

The culprit end up being at https://github.com/cnabio/cnab-go/blob/main/secrets/host/host.go#L53-L53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant