pierrejeambrun commented on code in PR #47062:
URL: https://github.com/apache/airflow/pull/47062#discussion_r1971338292


##########
airflow/auth/managers/base_auth_manager.py:
##########
@@ -61,7 +61,7 @@
 
 # This cannot be in the TYPE_CHECKING block since some providers import it 
globally.
 # TODO: Move this inside once all providers drop Airflow 2.x support.
-ResourceMethod = Literal["GET", "POST", "PUT", "DELETE", "MENU"]
+ResourceMethod = Literal["GET", "POST", "PUT", "PATCH", "DELETE", "MENU"]

Review Comment:
   cc: @vincbeck If I'm not mistaken this is not enough to support "PATCH". 
    I think we can edit `_MAP_METHOD_NAME_TO_FAB_ACTION_NAME`, maybe just add 
an entry "PATCH": `ACTION_CAN_EDIT` is enough. (PATH AND PUT basically will 
require the same stuff and will be supported)
    
    I assume that aws `VerifiedPermissionsClient` and FAB both support `PATCH` 
? (Even if up to now we did not use it)



##########
tests/api_fastapi/conftest.py:
##########
@@ -34,6 +36,23 @@
 
 @pytest.fixture
 def test_client():
+    with conf_vars(
+        {
+            (
+                "core",
+                "auth_manager",
+            ): 
"airflow.auth.managers.simple.simple_auth_manager.SimpleAuthManager",
+        }
+    ):
+        auth_manager = SimpleAuthManager()
+        token = auth_manager._get_token_signer().generate_signed_token(
+            auth_manager.serialize_user(SimpleAuthManagerUser(username="test", 
role="admin"))
+        )
+        yield TestClient(create_app(), headers={"Authorization": f"Bearer 
{token}"})
+
+
[email protected]
+def unauthenticated_test_client():

Review Comment:
   Looks good to me.



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