Skip to content

KNOX-2097: Proxy support for Airflow WebUI - #182

Closed
baiykmax wants to merge 1 commit into
apache:masterfrom
baiykmax:KNOX-2097
Closed

baiykmax wants to merge 1 commit into
apache:masterfrom
baiykmax:KNOX-2097

Conversation

@baiykmax

@baiykmax baiykmax commented Nov 9, 2019 •

Copy link
Copy Markdown

What changes were proposed in this pull request?

Add new gateway service definition(rewrite.xml and service.xml) for accessing Apache Airflow's WebUI. I added comments to explain pattern rules to non-airflow developer.

How was this patch tested?

I tested this manually on our ECS with a Knox gateway, then i browsed every page and every links in the Airflow's webUI and verified its correct behavior.

222
111

@risdenk

risdenk commented Nov 9, 2019

Copy link
Copy Markdown
Contributor

@baiykmax can you share some details on what the testing topology looks like? What you put in there for the <url>?

@risdenk risdenk self-assigned this Nov 11, 2019

@risdenk risdenk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good on the surface. Would be good to get an understanding of what the topology looks like for this to be able to do some testing for it.

Something like:

...
<service>
    <role>AIRFLOWUI</role>
    <url>...</url>
</service>
...

@mackong

mackong commented Nov 13, 2019

Copy link
Copy Markdown
Contributor

I have tested this PR, and some issues exist:

  1. For some urls with params like execution_date=2019-11-11+16%3A00%3A00%2B00%3A00, it will be rewrited to execution_date=2019-11-11%2B16%253A00%253A00%252B00%253A00, and this is 404.
  2. In new or edit page, the href of cancel button is error.
  3. Click on the refresh button in index page with be a bad request with "The CSRF token is missing.".
  4. Some "svg buttons" like "dagruns" are totally broken.
  5. Edit "dagmodel" is broken.

@baiykmax

Copy link
Copy Markdown
Author

Topology config looks like this:

    <service>
        <role>AIRFLOWUI</role>
        <url>http://localhost:8080</url>
    </service>

@baiykmax

baiykmax commented Nov 13, 2019 •

Copy link
Copy Markdown
Author

Some "svg buttons" like "dagruns" are totally broken

Is there any good way to properly handle dynamically generated urls? @risdenk

@risdenk

risdenk commented Nov 22, 2019

Copy link
Copy Markdown
Contributor

@baiykmax sorry missed your question. Not sure what you mean dynamically generated urls. Can you share an example of what the source is and what you expect the output to look like? Then might be able to help figure out rewrite rules.

@risdenk

risdenk commented Nov 22, 2019

Copy link
Copy Markdown
Contributor

For some urls with params like execution_date=2019-11-11+16%3A00%3A00%2B00%3A00, it will be rewrited to execution_date=2019-11-11%2B16%253A00%253A00%252B00%253A00, and this is 404.

This specifically looks like url encoding. Not sure why url encoded twice? not sure what is going on there.

@risdenk risdenk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking as request changes based on feedback so far.

@risdenk risdenk removed their assignment Nov 22, 2019
@risdenk

risdenk commented Feb 25, 2020

Copy link
Copy Markdown
Contributor

@baiykmax any update here?

@mik-laj

mik-laj commented Nov 12, 2020

Copy link
Copy Markdown
Member

Should we also add docs to apache airflow project?

@mik-laj

mik-laj commented Nov 12, 2020

Copy link
Copy Markdown
Member

Airflow 1.10 has two types of interfaces:

  • RBAC
  • non-RBAC

The non-RBAC interface is deprecated and not recommended for new installations. We have not added any new functions there for over half a year and only fix bugs (especially security bugs)

Airflow 2.0 (first beta released yesterday) will only support RBAC UI. In my opinion, we should add support for RBAC UI otherwise this integration will become unusable very soon.

I am a member of the PMC of Apache Airflow so I will be happy to help if you need more help.

See: apache/airflow#11305

@mik-laj

mik-laj commented Nov 12, 2020

Copy link
Copy Markdown
Member

very links in the Airflow's webUI

Have you also tested the API?

@baiykmax
baiykmax requested a review from risdenk November 16, 2020 05:48
@baiykmax baiykmax closed this Nov 16, 2020
@baiykmax
baiykmax deleted the KNOX-2097 branch November 16, 2020 05:51
@baiykmax

Copy link
Copy Markdown
Author

@risdenk sorry missed your message.
I may not have time to continue dealing with this issue, please close this issue or assign to others.

@baiykmax

Copy link
Copy Markdown
Author

@mik-laj thank you for your support. We use [airflow.contrib.auth.backends.ldap_auth] to manage user permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants