reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 45 forks source link

api: create_workflow allows illegal characters #584

Closed tiborsimko closed 2 years ago

tiborsimko commented 2 years ago

CLI does not allow users to enter illegal charaters:

$ reana-client create -w test.41
 ==> ERROR: Workflow name test.41 contains illegal character "."

API does:

>>> my_workflow_name = 'test.42'
...
>>> create_workflow_from_json(
...     workflow_json=my_workflow,
...     name=my_workflow_name,
...     access_token=my_reana_token,
...     parameters=my_inputs,
...     workflow_engine=my_workflow_type)
  -> SUCCESS: Valid REANA specification file.
 ...site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
    warnings.warn(
    {'message': 'Workflow workspace created', 'workflow_id': 'efa63d64-76e5-433d-a207-3cb303ec348a', 'workflow_name': 'test.42.1'}

Note test.42 was accepted and workflow name test.42.1 was created. This causes problems launching workflows, since dots are interpreted as restarts.

We should fix Python API in order not to allow illegal characters, similarly to CLI API.

matthewfeickert commented 2 years ago

Thanks for spotting this @tiborsimko. :+1: