Dev-iL commented on code in PR #73414: URL: https://github.com/apache/airflow/pull/73414#discussion_r4308098734
########## airflow-core/docs/security/secrets/secrets-backend/index.rst: ########## @@ -161,6 +161,62 @@ section of ``airflow.cfg``. Additional arguments to your SecretsBackend can be configured in ``airflow.cfg`` by supplying a JSON string to ``backend_kwargs``, which will be passed to the ``__init__`` of your SecretsBackend. See :ref:`Configuration <secrets_backend_configuration>` for more details, and :ref:`SSM Parameter Store <ssm_parameter_store_secrets>` for an example. +Async server-side reads +^^^^^^^^^^^^^^^^^^^^^^^ + +When the Execution API serves a Variable or Connection, it resolves the value with +``airflow.secrets.resolver.resolve_variable`` or ``airflow.secrets.resolver.resolve_connection``. +Both functions search the configured backends in the same order as synchronous reads. There is no +separate async configuration. + +A backend can implement either or both of these optional methods: + +.. code-block:: python + + async def aget_variable(self, key: str, team_name: str | None = None) -> str | None: ... + + + async def aget_connection(self, conn_id: str, team_name: str | None = None) -> Connection | None: ... + +They take the same arguments and return the same values as ``get_variable`` and ``get_connection``. +``aget_connection`` returns the core :py:class:`airflow.models.connection.Connection` or ``None``. + +The resolver calls these methods as follows: + +* **Precedence:** the resolver uses the async method when it is defined in the same class as its Review Comment: Scoped the contract explicitly to backends configured on the Execution API server. The page now also describes local worker lookups: environment/worker backends precede ExecutionAPISecretsBackend, the SDK prefers an available async method even over a subclass's sync override, and those local calls do not receive team_name. The SDK behavior is unchanged. --- Drafted-by: Codex (GPT-6) (reviewed by @Dev-iL) -- 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]
