Skip to content

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

@lbergnehr

Description

@lbergnehr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions