bugraoz93 commented on code in PR #48855:
URL: https://github.com/apache/airflow/pull/48855#discussion_r2031296123
##########
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:
For now, it will be these two. In the future, we may need to act upon `kind`
in different use cases while creating the `Client`, but we can extend when it
is required and also the accepted values as well. I am okay with limiting via
enum. I will make the changes soon
Thanks for the review @jason810496!
--
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]