From fd72d2684cb669a5d59490859f9dd4e4eac2970f Mon Sep 17 00:00:00 2001 From: Beck Date: Tue, 20 Feb 2024 15:44:27 -0500 Subject: [PATCH 1/2] Update action names in AWS auth manager --- .../amazon/aws/auth_manager/avp/entities.py | 4 +- .../amazon/aws/auth_manager/cli/schema.json | 38 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/airflow/providers/amazon/aws/auth_manager/avp/entities.py b/airflow/providers/amazon/aws/auth_manager/avp/entities.py index 213a89fc03194..666ebf8fe3dd2 100644 --- a/airflow/providers/amazon/aws/auth_manager/avp/entities.py +++ b/airflow/providers/amazon/aws/auth_manager/avp/entities.py @@ -57,9 +57,9 @@ def get_action_id(resource_type: AvpEntities, method: ResourceMethod): """ Return action id. - Convention for action ID is ::. Example: Variable::GET. + Convention for action ID is .. Example: Variable.GET. :param resource_type: Resource type. :param method: Resource method. """ - return f"{resource_type.value}::{method}" + return f"{resource_type.value}.{method}" diff --git a/airflow/providers/amazon/aws/auth_manager/cli/schema.json b/airflow/providers/amazon/aws/auth_manager/cli/schema.json index e7d9b81d16446..caf0698799a80 100644 --- a/airflow/providers/amazon/aws/auth_manager/cli/schema.json +++ b/airflow/providers/amazon/aws/auth_manager/cli/schema.json @@ -1,37 +1,37 @@ { "Airflow": { "actions": { - "Connection::DELETE": { + "Connection.DELETE": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Connection"] } }, - "Connection::GET": { + "Connection.GET": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Connection"] } }, - "Connection::POST": { + "Connection.POST": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Connection"] } }, - "Connection::PUT": { + "Connection.PUT": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Connection"] } }, - "Configuration::GET": { + "Configuration.GET": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Configuration"] } }, - "Dag::DELETE": { + "Dag.DELETE": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Dag"], @@ -46,7 +46,7 @@ } } }, - "Dag::GET": { + "Dag.GET": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Dag"], @@ -61,7 +61,7 @@ } } }, - "Dag::POST": { + "Dag.POST": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Dag"], @@ -76,7 +76,7 @@ } } }, - "Dag::PUT": { + "Dag.PUT": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Dag"], @@ -91,61 +91,61 @@ } } }, - "Dataset::GET": { + "Dataset.GET": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Dataset"] } }, - "Pool::DELETE": { + "Pool.DELETE": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Pool"] } }, - "Pool::GET": { + "Pool.GET": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Pool"] } }, - "Pool::POST": { + "Pool.POST": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Pool"] } }, - "Pool::PUT": { + "Pool.PUT": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Pool"] } }, - "Variable::DELETE": { + "Variable.DELETE": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Variable"] } }, - "Variable::GET": { + "Variable.GET": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Variable"] } }, - "Variable::POST": { + "Variable.POST": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Variable"] } }, - "Variable::PUT": { + "Variable.PUT": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["Variable"] } }, - "View::GET": { + "View.GET": { "appliesTo": { "principalTypes": ["User"], "resourceTypes": ["View"] From 2140eba8d1a7f4954cb1c7d25334d7dcae75624a Mon Sep 17 00:00:00 2001 From: vincbeck Date: Tue, 20 Feb 2024 16:41:34 -0500 Subject: [PATCH 2/2] Fix test --- tests/providers/amazon/aws/auth_manager/avp/test_entities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/providers/amazon/aws/auth_manager/avp/test_entities.py b/tests/providers/amazon/aws/auth_manager/avp/test_entities.py index c5b512f22c86d..72142532bdcf7 100644 --- a/tests/providers/amazon/aws/auth_manager/avp/test_entities.py +++ b/tests/providers/amazon/aws/auth_manager/avp/test_entities.py @@ -24,4 +24,4 @@ def test_get_entity_type(): def test_get_action_id(): - assert get_action_id(AvpEntities.VARIABLE, "GET") == "Variable::GET" + assert get_action_id(AvpEntities.VARIABLE, "GET") == "Variable.GET"