jedcunningham commented on code in PR #34349:
URL: https://github.com/apache/airflow/pull/34349#discussion_r1326246236
##########
airflow/auth/managers/base_auth_manager.py:
##########
@@ -50,6 +50,10 @@ def get_cli_commands() -> list[CLICommand]:
"""
return []
+ def get_api_blueprint(self) -> None | Blueprint:
Review Comment:
I wonder if auth managers should just register themselves as a plugin,
instead of having a separate path to register a blueprint? Was that something
you considered and ruled out?
##########
airflow/auth/managers/fab/fab_auth_manager.py:
##########
@@ -62,6 +70,24 @@ def get_cli_commands() -> list[CLICommand]:
SYNC_PERM_COMMAND, # not in a command group
]
+ def get_api_blueprint(self) -> None | Blueprint:
+ """Return a blueprint of the API endpoints proposed by this auth
manager."""
+ folder = Path(__file__).parents[0].resolve() # this is
airflow/auth/managers/fab/
+ with folder.joinpath("openapi", "v1.yaml").open() as f:
+ specification = safe_load(f)
+ api = FlaskApi(
+ specification=specification,
+ resolver=_LazyResolver(),
+ base_path="/security/v1",
Review Comment:
Also, we don't need a common path either if other auth managers decided to
add similar endpoints. I like `/auth/fab/v1`.
##########
airflow/api_connexion/openapi/v1.yaml:
##########
@@ -2112,12 +2112,13 @@ paths:
/roles:
get:
+ deprecated: true
summary: List roles
description: |
Get a list of roles.
*New in version 2.1.0*
- x-openapi-router-controller:
airflow.api_connexion.endpoints.role_and_permission_endpoint
+ x-openapi-router-controller:
airflow.auth.managers.fab.api_endpoints.role_and_permission_endpoint
Review Comment:
Said another way, we want to make sure these fail gracefully in that
scenario, right?
--
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]