This is an automated email from the ASF dual-hosted git repository. ephraimanierobi pushed a commit to branch v2-7-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 0b48f3be62d0fab78b4e47d149249dbd35f18e1a Author: vatsrahul1001 <43964496+vatsrahul1...@users.noreply.github.com> AuthorDate: Mon Oct 16 21:44:42 2023 +0530 Update documentation to enable test connection (#34905) --------- Co-authored-by: Pankaj Koti <pankajkoti...@gmail.com> Co-authored-by: Tzu-ping Chung <uranu...@gmail.com> (cherry picked from commit ad15af5cab6fc7aebb10d194fd5ca28a5e185492) --- airflow/api_connexion/openapi/v1.yaml | 9 +++++++++ airflow/www/static/js/types/api-generated.ts | 18 ++++++++++++++++++ docs/apache-airflow/howto/connection.rst | 20 +++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/airflow/api_connexion/openapi/v1.yaml b/airflow/api_connexion/openapi/v1.yaml index a696e586fa..ce038a3aaf 100644 --- a/airflow/api_connexion/openapi/v1.yaml +++ b/airflow/api_connexion/openapi/v1.yaml @@ -369,6 +369,15 @@ paths: description: | Test a connection. + For security reasons, the test connection functionality is disabled by default across Airflow UI, API and CLI. + For more information on capabilities of users, see the documentation: + https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html#capabilities-of-authenticated-ui-users. + It is strongly advised to not enable the feature until you make sure that only + highly trusted UI/API users have "edit connection" permissions. + + Set the "test_connection" flag to "Enabled" in the "core" section of Airflow configuration (airflow.cfg) to enable testing of collections. + It can also be controlled by the environment variable `AIRFLOW__CORE__TEST_CONNECTION`. + *New in version 2.2.0* x-openapi-router-controller: airflow.api_connexion.endpoints.connection_endpoint operationId: test_connection diff --git a/airflow/www/static/js/types/api-generated.ts b/airflow/www/static/js/types/api-generated.ts index 01f45ecd8b..87feec6897 100644 --- a/airflow/www/static/js/types/api-generated.ts +++ b/airflow/www/static/js/types/api-generated.ts @@ -44,6 +44,15 @@ export interface paths { /** * Test a connection. * + * For security reasons, the test connection functionality is disabled by default across Airflow UI, API and CLI. + * For more information on capabilities of users, see the documentation: + * https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html#capabilities-of-authenticated-ui-users. + * It is strongly advised to not enable the feature until you make sure that only + * highly trusted UI/API users have "edit connection" permissions. + * + * Set the "test_connection" flag to "Enabled" in the "core" section of Airflow configuration (airflow.cfg) to enable testing of collections. + * It can also be controlled by the environment variable `AIRFLOW__CORE__TEST_CONNECTION`. + * * *New in version 2.2.0* */ post: operations["test_connection"]; @@ -2556,6 +2565,15 @@ export interface operations { /** * Test a connection. * + * For security reasons, the test connection functionality is disabled by default across Airflow UI, API and CLI. + * For more information on capabilities of users, see the documentation: + * https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html#capabilities-of-authenticated-ui-users. + * It is strongly advised to not enable the feature until you make sure that only + * highly trusted UI/API users have "edit connection" permissions. + * + * Set the "test_connection" flag to "Enabled" in the "core" section of Airflow configuration (airflow.cfg) to enable testing of collections. + * It can also be controlled by the environment variable `AIRFLOW__CORE__TEST_CONNECTION`. + * * *New in version 2.2.0* */ test_connection: { diff --git a/docs/apache-airflow/howto/connection.rst b/docs/apache-airflow/howto/connection.rst index 0db100fd29..2c07b03b6d 100644 --- a/docs/apache-airflow/howto/connection.rst +++ b/docs/apache-airflow/howto/connection.rst @@ -190,8 +190,26 @@ Passwords cannot be manipulated or read without the key. For information on conf Testing Connections ^^^^^^^^^^^^^^^^^^^ +For security reasons, the test connection functionality is disabled by default across Airflow UI, API and CLI. -Airflow Web UI, REST API, and CLI allow you to test connections. The test connection feature can be used from +For more information on capabilities of users, see the documentation: +https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html#capabilities-of-authenticated-ui-users. +It is strongly advised to not enable the feature until you make sure that only +highly trusted UI/API users have "edit connection" permissions. + +The availability of the +functionality can be controlled by the test_connection flag in +the core section of the Airflow configuration (airflow.cfg). +It can also be controlled by the environment variable +``AIRFLOW__CORE__TEST_CONNECTION``. + +The following values are accepted for this config param: + +* Disabled: Disables the test connection functionality and disables the Test Connection button in the UI. This is also the default value set in the Airflow configuration. +* Enabled: Enables the test connection functionality and activates the Test Connection button in the UI. +* Hidden: Disables the test connection functionality and hides the Test Connection button in UI. + +After enabling Test Connection, it can be used from the :ref:`create <creating_connection_ui>` or :ref:`edit <editing_connection_ui>` connection page in the UI, through calling :doc:`Connections REST API </stable-rest-api-ref/>`, or running the ``airflow connections test`` :ref:`CLI command <cli>`.