Skip to content

Commit

Permalink
Update documentation to enable test connection (#34905)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: Pankaj Koti <pankajkoti699@gmail.com>
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
  • Loading branch information
3 people committed Oct 16, 2023
1 parent 6bb6ae8 commit ad15af5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
9 changes: 9 additions & 0 deletions airflow/api_connexion/openapi/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions airflow/www/static/js/types/api-generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down Expand Up @@ -2568,6 +2577,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: {
Expand Down
20 changes: 19 additions & 1 deletion docs/apache-airflow/howto/connection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`.

Expand Down

0 comments on commit ad15af5

Please sign in to comment.