This is an automated email from the ASF dual-hosted git repository.
msumit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow-client-python.git
The following commit(s) were added to refs/heads/master by this push:
new f8d7f95 Update readme, add instructions on how to add auth during
generation (#33)
f8d7f95 is described below
commit f8d7f958578fd1c63cef41d6b3f5447dc45bdfe6
Author: HTErik <[email protected]>
AuthorDate: Mon Oct 25 09:03:06 2021 +0200
Update readme, add instructions on how to add auth during generation (#33)
Because openapi schema is not listing the supported authentication
schemas under security-section. The generated openapi client will not
pass on any authenticaion configuration at all.
Before generating the client, the relevant sections must be added.
For more background, see
https://github.com/apache/airflow/issues/17172 and
https://github.com/apache/airflow/pull/17174
---
README.md | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 13da734..31e7714 100644
--- a/README.md
+++ b/README.md
@@ -62,17 +62,11 @@ import airflow_client.client
from pprint import pprint
from airflow_client.client.api import config_api
-# The client must use the authentication and authorization parameters
-# in accordance with the API server security policy.
-# Examples for each auth method are provided below, use the example that
-# satisfies your auth use case.
#
-# In case of the basic authentication below, make sure that Airflow is
-# configured with the basic_auth as backend:
-#
-# auth_backend = airflow.api.auth.backend.basic_auth
-#
-# Make sure that your user/name are configured properly
+# In case of the basic authentication below. Make sure:
+# - Airflow is configured with the basic_auth as backend:
+# auth_backend = airflow.api.auth.backend.basic_auth
+# - Make sure that the client has been generated with securitySchema Basic.
# Configure HTTP basic authorization: Basic
configuration = airflow_client.client.Configuration(
@@ -108,6 +102,19 @@ git clone [email protected]:apache/airflow-client-python.git
# clone Airflow repo (if not already)
git clone [email protected]:apache/airflow.git
+```
+Edit the file `airflow/airflow/api_connexion/openapi/v1.yaml`
+Make sure it has the following `securitySchema`s listed under security
`section`
+```yaml
+security:
+ - Basic: []
+ - GoogleOpenId: []
+ - Kerberos: []
+```
+If your deployment of Airflow uses any different authentication mechanism than
the three listed above, you might need to make further changes to the `v1.yaml`
and generate your own client, see [OpenAPI Schema
specification](https://swagger.io/docs/specification/authentication/) for
details.
+(*These changes should not be commited to the upstream `v1.yaml` [as it will
generate misleading openapi
documentaion](https://github.com/apache/airflow/pull/17174)*)
+
+```bash
cd airflow
# bump up the version in python.sh & run the following command