Add Docs around SSL under OpenMetadataConfig (#16774)

This commit is contained in:
Ayush Shah 2024-06-24 21:43:54 +05:30 committed by GitHub
parent 54ca82f64d
commit c3d68727ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 51 additions and 0 deletions

View File

@ -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)

View File

@ -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)