You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2025/04/07 07:56:07 UTC
Re: [PR] AIP-81 feat (airflowctl): login with username and password [airflow]
jason810496 commented on code in PR #48855:
URL: https://github.com/apache/airflow/pull/48855#discussion_r2030653204
##########
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:
It seems like `kind` will currently only be either `cli` or `auth`. Should we consider restricting the `kind` to just these values, or are there any other use cases where a more flexible `kind` argument would be needed?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org