From a82d1fa99cbe2c823e87c978d4a1b1e64b8af686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hermann?= Date: Wed, 29 Nov 2023 14:10:12 +0100 Subject: [PATCH 1/2] ISSUE-14165: Fix Python SDK auth in 1.2.x doc --- .../content/v1.2.x/sdk/python/index.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/openmetadata-docs/content/v1.2.x/sdk/python/index.md b/openmetadata-docs/content/v1.2.x/sdk/python/index.md index 91c5d3e0f778..77dc579ff21e 100644 --- a/openmetadata-docs/content/v1.2.x/sdk/python/index.md +++ b/openmetadata-docs/content/v1.2.x/sdk/python/index.md @@ -164,14 +164,21 @@ OpenMetadata is the class holding the connection to the API and handling the req ```python from metadata.ingestion.ometa.ometa_api import OpenMetadata from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import ( - OpenMetadataConnection, + OpenMetadataConnection, AuthProvider, ) +from metadata.generated.schema.security.client.openMetadataJWTClientConfig import OpenMetadataJWTClientConfig -server_config = OpenMetadataConnection(hostPort="http://localhost:8585/api") +server_config = OpenMetadataConnection( + hostPort="http://localhost:8585/api", + authProvider=AuthProvider.openmetadata, + securityConfig=OpenMetadataJWTClientConfig( + jwtToken="", + ), +) metadata = OpenMetadata(server_config) ``` -As this is just using a local development, the `OpenMetadataConnection` is rather simple. However, in there we would prepare settings such as `authProvider` or `securityConfig`. +Make sure to get a JWT token for the ingestion bot as described [here](/deployment/security/enable-jwt-tokens#generate-token) and use that when you specify `jwtToken`. {% note %} From 9b9dae45f56220d2c8de57233437d0089dadbf8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hermann?= Date: Wed, 29 Nov 2023 20:37:02 +0100 Subject: [PATCH 2/2] ISSUE-14165: Fix Python SDK auth in 1.0.x, 1.1.x doc --- .../content/v1.0.x/sdk/python/index.md | 13 ++++++++++--- .../content/v1.1.x/sdk/python/index.md | 13 ++++++++++--- .../content/v1.2.x/sdk/python/index.md | 2 +- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/openmetadata-docs/content/v1.0.x/sdk/python/index.md b/openmetadata-docs/content/v1.0.x/sdk/python/index.md index 77462b35de68..909f7137183a 100644 --- a/openmetadata-docs/content/v1.0.x/sdk/python/index.md +++ b/openmetadata-docs/content/v1.0.x/sdk/python/index.md @@ -164,14 +164,21 @@ OpenMetadata is the class holding the connection to the API and handling the req ```python from metadata.ingestion.ometa.ometa_api import OpenMetadata from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import ( - OpenMetadataConnection, + OpenMetadataConnection, AuthProvider, ) +from metadata.generated.schema.security.client.openMetadataJWTClientConfig import OpenMetadataJWTClientConfig -server_config = OpenMetadataConnection(hostPort="http://localhost:8585/api") +server_config = OpenMetadataConnection( + hostPort="http://localhost:8585/api", + authProvider=AuthProvider.openmetadata, + securityConfig=OpenMetadataJWTClientConfig( + jwtToken="", + ), +) metadata = OpenMetadata(server_config) ``` -As this is just using a local development, the `OpenMetadataConnection` is rather simple. However, in there we would prepare settings such as `authProvider` or `securityConfig`. +For local development, we can get a JWT token for the ingestion bot as described [here](/deployment/security/enable-jwt-tokens#generate-token) and use that when we specify the `jwtToken`. For a real-world deployment, we can also use [different authentication methods](/deployment/security) and specify other settings of the connection (such as `sslConfig`). {% note %} diff --git a/openmetadata-docs/content/v1.1.x/sdk/python/index.md b/openmetadata-docs/content/v1.1.x/sdk/python/index.md index 3ae1fb96a8f1..5593dd4b33ff 100644 --- a/openmetadata-docs/content/v1.1.x/sdk/python/index.md +++ b/openmetadata-docs/content/v1.1.x/sdk/python/index.md @@ -164,14 +164,21 @@ OpenMetadata is the class holding the connection to the API and handling the req ```python from metadata.ingestion.ometa.ometa_api import OpenMetadata from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import ( - OpenMetadataConnection, + OpenMetadataConnection, AuthProvider, ) +from metadata.generated.schema.security.client.openMetadataJWTClientConfig import OpenMetadataJWTClientConfig -server_config = OpenMetadataConnection(hostPort="http://localhost:8585/api") +server_config = OpenMetadataConnection( + hostPort="http://localhost:8585/api", + authProvider=AuthProvider.openmetadata, + securityConfig=OpenMetadataJWTClientConfig( + jwtToken="", + ), +) metadata = OpenMetadata(server_config) ``` -As this is just using a local development, the `OpenMetadataConnection` is rather simple. However, in there we would prepare settings such as `authProvider` or `securityConfig`. +For local development, we can get a JWT token for the ingestion bot as described [here](/deployment/security/enable-jwt-tokens#generate-token) and use that when we specify the `jwtToken`. For a real-world deployment, we can also use [different authentication methods](/deployment/security) and specify other settings of the connection (such as `sslConfig`). {% note %} diff --git a/openmetadata-docs/content/v1.2.x/sdk/python/index.md b/openmetadata-docs/content/v1.2.x/sdk/python/index.md index 77dc579ff21e..169d4fbdcb75 100644 --- a/openmetadata-docs/content/v1.2.x/sdk/python/index.md +++ b/openmetadata-docs/content/v1.2.x/sdk/python/index.md @@ -178,7 +178,7 @@ server_config = OpenMetadataConnection( metadata = OpenMetadata(server_config) ``` -Make sure to get a JWT token for the ingestion bot as described [here](/deployment/security/enable-jwt-tokens#generate-token) and use that when you specify `jwtToken`. +For local development, we can get a JWT token for the ingestion bot as described [here](/deployment/security/enable-jwt-tokens#generate-token) and use that when we specify the `jwtToken`. For a real-world deployment, we can also use [different authentication methods](/deployment/security) and specify other settings of the connection (such as `sslConfig`). {% note %}