jscheffl commented on code in PR #68175:
URL: https://github.com/apache/airflow/pull/68175#discussion_r3369701205


##########
airflow-core/src/airflow/cli/api_client.py:
##########
@@ -0,0 +1,123 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""
+Provide the :mod:`airflowctl` HTTP API client to the local Airflow CLI.
+
+The local CLI talks to the API server through the same typed client that 
``airflowctl``
+uses, but without the keyring-backed credential store. For each invocation it 
mints a
+short-lived JWT **in memory** (via the active auth manager) and builds a 
client with it;
+nothing is persisted. Set the ``AIRFLOW_CLI_TOKEN`` environment variable to 
supply a token
+explicitly (required for auth managers whose tokens cannot be minted locally, 
such as
+Keycloak, or when targeting a remote API server).
+"""
+
+from __future__ import annotations
+
+import atexit
+import os
+from collections.abc import Callable
+from functools import wraps
+from typing import TYPE_CHECKING, TypeVar
+
+import httpx
+
+# Re-exported so command modules import the client surface from a single place.
+from airflowctl.api.client import NEW_API_CLIENT, Client, ClientKind

Review Comment:
   The term "NEW" is mostly outdated/not new once you have code on main. Took a 
moment that I realized it is not about "The new client" but same like session 
to "Please create a _new_ session" as signal.
   
   How about renaming to "CREATE_NEW_API_CLIENT" or "CREATE_API_CLIENT"?
   ```suggestion
   from airflowctl.api.client import CREATE_API_CLIENT, Client, ClientKind
   ```



-- 
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]

Reply via email to