bugraoz93 commented on code in PR #48855:
URL: https://github.com/apache/airflow/pull/48855#discussion_r2031516227
##########
airflow-ctl/src/airflowctl/api/client.py:
##########
@@ -147,9 +150,19 @@ def auth_flow(self, request: httpx.Request):
class Client(httpx.Client):
"""Client for the Airflow REST API."""
- def __init__(self, *, base_url: str, token: str, **kwargs: Any):
+ def __init__(
+ self,
+ *,
+ base_url: str,
+ token: str,
+ kind: str = "cli",
+ **kwargs: Any,
+ ) -> None:
auth = BearerAuth(token)
- kwargs["base_url"] = f"{base_url}/public"
+ if kind == "auth":
+ kwargs["base_url"] = f"{base_url}/auth"
+ else:
+ kwargs["base_url"] = f"{base_url}/api/v2"
Review Comment:
Made it `Enum` and limited the Client creation with `Literal` :)
--
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]