Skip to content

Conversation

@jason810496
Copy link
Member

@jason810496 jason810496 commented Mar 4, 2025

related: #42360

What

Fix #47194, #47129

  • airflow/api_fastapi/core_api/security.py
    • Fix typo in requires_access_connection function ( should call is_authorized_connection instead of is_authorized_pool )
    • Use lamda instead of adding new callback definition in each requires_access_<entity>
    • Add type hint for requires_access_<entity> ( except for requires_access_dag, the AIP-84 | Add Auth for Dags #47062 PR will add type hint for the dag one )
  • tests/api_fastapi/conftest.py
    • Retrieve auth_manger from app.state instead of creating a new one

- requires_access_connection: is_authorized_pool -> is_authorized_connection
- use lambda instead of new callback function
- add type hint for requires_access_<entity>
- user type hint should be BaseUser instead of optional BaseUser
- retrieve auth_manger from app.state instead of creating a new one
@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Mar 4, 2025
@pierrejeambrun
Copy link
Member

Thanks

@pierrejeambrun pierrejeambrun changed the title AIP-84 | Fix Merged Permission for Variables and Pools AIP-84 | Fix Merged Permission for Connections and Pools Mar 4, 2025
@jason810496
Copy link
Member Author

jason810496 commented Mar 4, 2025

Thanks

All CI are green 🎉

@pierrejeambrun pierrejeambrun merged commit dfeeeb4 into apache:main Mar 4, 2025
44 checks passed
@rawwar
Copy link
Contributor

rawwar commented Mar 5, 2025

@jason810496 , Thank you!

shahar1 pushed a commit to shahar1/airflow that referenced this pull request Mar 5, 2025
* Fix security
- requires_access_connection: is_authorized_pool -> is_authorized_connection
- use lambda instead of new callback function
- add type hint for requires_access_<entity>
- user type hint should be BaseUser instead of optional BaseUser

* Fix conftest of api_fastapi
- retrieve auth_manger from app.state instead of creating a new one
nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Apr 4, 2025
* Fix security
- requires_access_connection: is_authorized_pool -> is_authorized_connection
- use lambda instead of new callback function
- add type hint for requires_access_<entity>
- user type hint should be BaseUser instead of optional BaseUser

* Fix conftest of api_fastapi
- retrieve auth_manger from app.state instead of creating a new one
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants