StackStorm / StackStorm/st2

Include url_hosts_whitelist with my user and password parameter when I use core action core.http

Open
#6,083 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

SUMMARY

I've been suffering with a bug into my workflow, when I use a core.http task I've noticed that a url_hosts_whitelist and password are filled automaticaly, even withdrawing these line on code, when I save, theses line back into my code.

STACKSTORM VERSION

Paste the output of st2 --version:
st2 3.8.0, on Python 3.8.10

OS, environment, install method

Post what OS you are running this on, along with any other relevant information/
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal

Installed manually

Steps to reproduce the problem

Show how to reproduce the problem, using a minimal test-case. Make sure to include any content
(pack content - workflows, actions, etc.) which are needed to reproduce the problem.

  • create a workflow > insert name , include a http.core action, fill the url like google.com , set a method get > set header - execute the workflow / close the file, check the result in history > open the workflow and it will apper these parameters filled automaticaly
    version: 1.0
    tasks:

    [510, 272]

    task1:
    action: core.http
    input:
    url: "https://www.google.com.br/"
    method: GET
    headers:
    TEST: TEST
    url_hosts_whitelist:
    - myuserstackstorm
    password: cannot shwo the password
    next:
    - do:
    - task2

    [528, 384]

    task2:
    action: core.echo
    input:
    message: TEST

Expected Results

http google page

What did you expect to happen when running the steps above?

    "traceback": "  File \"/opt/stackstorm/st2/lib/python3.8/site-packages/st2actions/container/base.py\", line 132, in _do_run
(status, result, context) = runner.run(action_params)

File "/opt/stackstorm/st2/lib/python3.8/site-packages/http_runner/http_runner.py", line 116, in run
result = client.run()
File "/opt/stackstorm/st2/lib/python3.8/site-packages/http_runner/http_runner.py", line 262, in run
raise ValueError('URL "%s" is not whitelisted' % (self.url))
"

Actual Results

What happened? What output did you get?
an error , if I delete theses lines and save for a many times I can be able to run the workflow and obtain the expected result

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the workflow with the core.http action and compare the saved workflow with the inputs before execution. Start with http_runner/http_runner.py, especially run() and the URL whitelist error, then trace the workflow save and reload behavior described in the issue. Done means the unwanted url_hosts_whitelist and password parameters no longer reappear and the request succeeds without manually deleting them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.