Skip to content

Commit

Permalink
Add Docs around SSL under OpenMetadataConfig (#16774)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayush-shah committed Jun 24, 2024
1 parent 54ca82f commit c3d6872
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
25 changes: 25 additions & 0 deletions openmetadata-docs/content/v1.4.x/sdk/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,31 @@ metadata = OpenMetadata(server_config)

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`).

Below is an example of how the user can configure `sslConfig` using `Python SDK`.

```python
from metadata.generated.schema.security.ssl.validateSSLClientConfig import ValidateSslClientConfig
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
AuthProvider,
OpenMetadataConnection
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import OpenMetadataJWTClientConfig
from metadata.ingestion.ometa.ometa_api import OpenMetadata


server_config = OpenMetadataConnection(
hostPort="http://localhost:8585/api",
authProvider=AuthProvider.openmetadata,
securityConfig=OpenMetadataJWTClientConfig(
jwtToken="<YOUR-INGESTION-BOT-JWT-TOKEN>",
),
verifySSL="validate" # ignore, validate or no-ssl,
sslConfig=ValidateSslClientConfig(caCertificate="/path/to/rootCert",sslCertificate="/path/to/cert",sslKey="/path/to/key"),
)

metadata = OpenMetadata(server_config)
```

{% note %}

The OpenMetadataConnection is defined as a JSON Schema as well. You can check the definition [here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/metadata/openMetadataConnection.json)
Expand Down
26 changes: 26 additions & 0 deletions openmetadata-docs/content/v1.5.x-SNAPSHOT/sdk/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,32 @@ metadata = OpenMetadata(server_config)

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`).

Below is an example of how the user can configure `sslConfig` using `Python SDK`.

```python
from metadata.generated.schema.security.ssl.validateSSLClientConfig import ValidateSslClientConfig
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
AuthProvider,
OpenMetadataConnection
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import OpenMetadataJWTClientConfig
from metadata.ingestion.ometa.ometa_api import OpenMetadata


server_config = OpenMetadataConnection(
hostPort="http://localhost:8585/api",
authProvider=AuthProvider.openmetadata,
securityConfig=OpenMetadataJWTClientConfig(
jwtToken="<YOUR-INGESTION-BOT-JWT-TOKEN>",
),
verifySSL="validate" # ignore, validate or no-ssl,
sslConfig=ValidateSslClientConfig(caCertificate="/path/to/rootCert",sslCertificate="/path/to/cert",sslKey="/path/to/key"),
)

metadata = OpenMetadata(server_config)
```


{% note %}

The OpenMetadataConnection is defined as a JSON Schema as well. You can check the definition [here](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/metadata/openMetadataConnection.json)
Expand Down

0 comments on commit c3d6872

Please sign in to comment.