You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/06 08:11:33 UTC

[GitHub] [airflow] fedeizzo opened a new issue #15225: Allowed hosts for rest api request

fedeizzo opened a new issue #15225:
URL: https://github.com/apache/airflow/issues/15225


   **Description**
   
   I would like to see a config in the api section in order to add allowed hosts for making http request and solve cross origin problem. Now, if a make an async request from browser a cross origin error occurs.
   
   **Use case / motivation**
   
   If I'm writing a dashboard for a end-user who want to see the current dag status I could create a dag with some graphical js library. The dag is created fetching webserver api in background. A possible implementation could be:
   
   ```
   [api]
   enable_experimental_api = False
   auth_backend = airflow.api.auth.backend.basic_auth
   allowed_hosts = ['myDomain1.com', 'myDomain2.org']
   ```
   
   **Are you willing to submit a PR?**
   
   No
   
   **Related Issues**
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] fedeizzo edited a comment on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
fedeizzo edited a comment on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814893153


   Currently, in a dev environment, from azure portal I opened the webserver port. I'm running scheduler and webserver as background processes.
   Now I'm working on a react webapp in which I want to display some informations about dag runs.
   Is the idea correct or I'm doing something in the wrong way?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj closed issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
mik-laj closed issue #15225:
URL: https://github.com/apache/airflow/issues/15225


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] fedeizzo commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
fedeizzo commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814893153


   Currently, in a dev environment, from azure portal I opened the port. I'm running scheduler and webserver as background processes.
   Now I'm working on a react webapp in which I want to display some informations about dag runs.
   Is the idea correct or I'm doing something in the wrong way?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] fedeizzo commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
fedeizzo commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814909814


   Yes, the webserver is exposed and the dashboard is available through http. But if I try to fetch the rest API from my local development environment (my pc running node with react) I receive the cross origin error. Obviously the domain is not the same: the airflow webserver on azure machine and react from my machine. The same situation could happen if I move my react app in another vps different from the one in which airflow is running


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-813922773


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] fedeizzo edited a comment on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
fedeizzo edited a comment on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814893153


   Currently, in a dev environment, from azure portal I opened the airflow webserver port. I'm running scheduler and webserver as background processes.
   Now I'm working on a react webapp in which I want to display some informations about dag runs.
   Is the idea correct or I'm doing something in the wrong way?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814931301


   Ah OK, so the problem is with indeed with CORS. The feature was added only recently and unreleased, so I was confusing your issue with `Location` header protection (which we don’t have a knob for).
   
   The implementation was added in #13620 and (I believe) will be in the next Airflow release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] fedeizzo commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
fedeizzo commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814943091


   Ok. Thanks for your help


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-817273017


   We added CORS support, so i think, we can close it. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj edited a comment on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-817273017


   We added CORS support, so we can close this ticket 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814903443


   > I'm running scheduler and webserver as background processes
   
   So you’re basically running `airflow webserver`? I believe that exposes the host as `0.0.0.0:8080` and should just work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #15225: Allowed hosts for rest api request

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #15225:
URL: https://github.com/apache/airflow/issues/15225#issuecomment-814881243


   How are you deploying Airflow? As far as I know, Airflow does not implement any logic to block host header attacks (I could be wrong), so there’s nothing to configure in Airflow. This needs to be configured in your proxy server instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org