Open
Description
I had a little SNAFU today when registering an action with the following YAML:
---
description: "None (yet)"
enabled: true
runner_type: "python-script"
entry_point: lib/run_operation.py
name: "login"
parameters:
server:
type: string
description: "Optional override of the Men&Mice server in <connection> (required if <connection> is not specified)."
required: false
username:
type: string
description: "Optional override of the Men&Mice username in <connection> (example: [email protected]) (required if <connection> is not specified)."
required: false
password:
type: string
description: "Optional override of the Men&Mice password in <connection>. (required if <connection> is not specified)"
required: false
secret: true
server:
type: string
required: true
login_name:
type: string
required: true
password:
type: string
required: true
Note the password
and server
parameters are duplicated.
This caused a small issue where the second password
definition did not have secret: true
specified. The result was that when i executed the action the password was displayed on the command line:
$ st2 run menandmice.login server=server.domain.tld username=user password=xxx login_name=login
id: 59551a75a814c0698925a78f
status: succeeded
parameters:
password: xxx
server: server.domain.tld
username: user
result:
exit_code: 0
result:
session: xyz123
stderr: ''
stdout: ''
Feature Request
It might be a good idea to validate and notify with a warning/error if a duplicate parameter is specified in the action's YAML.
Also, are there other places it makes sense to check for duplicates?