pierrejeambrun opened a new pull request, #42019:
URL: https://github.com/apache/airflow/pull/42019

   ## What does this PR do
   
   Add support for `basic_auth` backend to the new UI Rest API. Add relevant 
permissions helper and tests. The goal for this is first to show how 
permissions and auth can be handled in FastAPI and also have a small working 
POC for us to be able to then work on the front end. (And be able to migrate 
existing endpoints **with** appropriate permission decorators and write test 
against that as well).
   
   Goal:
   - Allow the endpoint migrations to be ported with the appropriate 
permissions and tested, to not loose them in transit
   - Use this PR as a preliminary work to discuss and see how FastAPI can 
integrate our permission/auth code, make a POC with the `basic_auth` backend.
   
   
   ## What this PR does not do
   After some digging in the last two days, I find that our `auth_backends` 
implementations, `auth_manager` init code, `BaseAuthManager` and more 
importantly `FabAuthManager` etc. is tightly coupled to flask. For instance the 
way we read webserver config file from python with `from_pyfile`, check app 
config with `app.config`, access global flask object from within an app context 
`g`, `request`, `get_current_user`, `flask_login`, `current_app` etc...
   
   So this PR does not rewrite all that code to be `Flask` independant and 
usable with FastAPI because the effort is too high at the moment and this is 
not what I am trying to demonstrate with this PR.
   
   We basically use the `flask_app` init code to initialize correctly all the 
different helper classes, and I added a few checks here and there to make the 
basic auth work outside of a Flask app context.
   
   
   ![Screenshot 2024-09-05 at 10 25 
18](https://github.com/user-attachments/assets/983c5007-1382-47fa-83c9-0122ce7d4886)
   ![Screenshot 2024-09-05 at 10 25 
52](https://github.com/user-attachments/assets/6d6e4dab-bad9-4ad3-904c-3c49ea6554eb)
   ![Screenshot 2024-09-05 at 10 28 
26](https://github.com/user-attachments/assets/27143305-d028-49b1-b2d5-93108914ec16)
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to