rundeck / rundeck

Enable Self-Service Operations: Give specific users access to your existing tools, services, and scripts
http://rundeck.org
Apache License 2.0
5.51k stars 915 forks source link

Using a carater present in json values as Multi-valued delimiter #6705

Closed maturbet closed 3 years ago

maturbet commented 3 years ago

Describe the bug Using a carater present in json values as Multi-valued delimiter faile the Enforced Restrictions on the option seen as empty cf. https://github.com/rundeck/rundeck/issues/5672

My Rundeck detail

To Reproduce Two differents way to reproduce :

<joblist> <job> <context> <options preserveOrder='true'> <option delimiter='.' enforcedvalues='true' multivalued='true' name='OPT' required='true' valuesUrl='http://ip.jsontest.com/' /> </options> </context> <defaultTab>nodes</defaultTab> <description></description> <executionEnabled>true</executionEnabled> <group>Test</group> <id>19fa0f9b-b0aa-44fb-af0a-0dbc33b59fba</id> <loglevel>INFO</loglevel> <name>jobA</name> <nodeFilterEditable>false</nodeFilterEditable> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='node-first'> <command> <description>ECHO</description> <exec>echo ${option.OPT}</exec> </command> </sequence> <uuid>19fa0f9b-b0aa-44fb-af0a-0dbc33b59fba</uuid> </job> </joblist>

Error returned :

Option OPT values: www.xxx.yyy.zzz were not all in the allowed values: []

with www.xxx.yyy.zzz my IP adresse

<joblist> <job> <context> <options preserveOrder='true'> <option delimiter=',' enforcedvalues='true' multivalued='true' name='OPT' required='true' valuesUrl='file:/tmp/list.json' /> </options> </context> <defaultTab>nodes</defaultTab> <description></description> <executionEnabled>true</executionEnabled> <group>Test</group> <id>dd1317e4-a279-4fe7-b0b6-1f4d687f1834</id> <loglevel>INFO</loglevel> <name>job1</name> <nodeFilterEditable>false</nodeFilterEditable> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='node-first'> <command> <description>ECHO</description> <exec>echo ${option.OPT}</exec> </command> </sequence> <uuid>dd1317e4-a279-4fe7-b0b6-1f4d687f1834</uuid> </job> </joblist>

<joblist> <job> <context> <options preserveOrder='true'> <option delimiter=',' enforcedvalues='true' multivalued='true' name='OPT' required='true' valuesUrl='file:/tmp/list.json' /> </options> </context> <defaultTab>nodes</defaultTab> <description></description> <executionEnabled>true</executionEnabled> <group>Test</group> <id>e1be472c-6778-4698-ba06-59298a83be17</id> <loglevel>INFO</loglevel> <name>job2</name> <nodeFilterEditable>false</nodeFilterEditable> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='node-first'> <command> <description>call</description> <jobref group='Test' name='job1' nodeStep='true'> <importOptions>true</importOptions> <uuid>dd1317e4-a279-4fe7-b0b6-1f4d687f1834</uuid> </jobref> </command> </sequence> <uuid>e1be472c-6778-4698-ba06-59298a83be17</uuid> </job> </joblist>

{ "A":"my,value,for,A", "B":"an,other,value,for,B" } Error returned :

Option input was not valid for [dd1317e4-a279-4fe7-b0b6-1f4d687f1834]: Some options values OPT : my,value,for,A,an,other,value,for,B was not in the otorized values: [] Failed: InvalidOptions: Invalid options: [OPT] Execution failed: 145523 in project OS_MGT: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [localhost: InvalidOptions: Invalid options: [OPT] + {dataContext=MultiDataContextImpl(map={}, base=null)} ]}, Node failures: {localhost=[InvalidOptions: Invalid options: [OPT] + {dataContext=MultiDataContextImpl(map={}, base=null)} ]}, status: failed]

Expected behavior It was OK in version : 3.0.22

maturbet commented 3 years ago

stale bot removed the wontfix:stale in https://github.com/rundeck/rundeck/issues/5672