mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-24 09:50:01 +00:00
Added enum for ssl and auth (#11016)
This commit is contained in:
parent
ae6683862f
commit
1b930fa6f7
@ -44,7 +44,7 @@ def get_connection_url(connection: HiveConnection) -> str:
|
||||
if (
|
||||
connection.username
|
||||
and connection.auth
|
||||
and connection.auth in ("LDAP", "CUSTOM")
|
||||
and connection.auth.value in ("LDAP", "CUSTOM")
|
||||
):
|
||||
url += quote_plus(connection.username)
|
||||
if not connection.password:
|
||||
@ -80,7 +80,7 @@ def get_connection(connection: HiveConnection) -> Engine:
|
||||
if connection.auth:
|
||||
if not connection.connectionArguments:
|
||||
connection.connectionArguments = init_empty_connection_arguments()
|
||||
connection.connectionArguments.__root__["auth"] = connection.auth
|
||||
connection.connectionArguments.__root__["auth"] = connection.auth.value
|
||||
|
||||
if connection.kerberosServiceName:
|
||||
if not connection.connectionArguments:
|
||||
|
@ -22,6 +22,7 @@ from metadata.generated.schema.entity.automations.workflow import (
|
||||
)
|
||||
from metadata.generated.schema.entity.services.connections.database.postgresConnection import (
|
||||
PostgresConnection,
|
||||
SslMode,
|
||||
)
|
||||
from metadata.ingestion.connections.builders import (
|
||||
create_generic_db_connection,
|
||||
@ -45,7 +46,11 @@ def get_connection(connection: PostgresConnection) -> Engine:
|
||||
if connection.sslMode:
|
||||
if not connection.connectionArguments:
|
||||
connection.connectionArguments = init_empty_connection_arguments()
|
||||
connection.connectionArguments.__root__["sslmode"] = connection.sslMode
|
||||
connection.connectionArguments.__root__["sslmode"] = connection.sslMode.value
|
||||
if connection.sslMode in (SslMode.verify_ca, SslMode.verify_full):
|
||||
connection.connectionArguments.__root__[
|
||||
"sslrootcert"
|
||||
] = connection.sslConfig.__root__.certificatePath
|
||||
return create_generic_db_connection(
|
||||
connection=connection,
|
||||
get_connection_url_fn=get_connection_url_common,
|
||||
|
@ -21,6 +21,7 @@ from metadata.generated.schema.entity.automations.workflow import (
|
||||
)
|
||||
from metadata.generated.schema.entity.services.connections.database.redshiftConnection import (
|
||||
RedshiftConnection,
|
||||
SslMode,
|
||||
)
|
||||
from metadata.ingestion.connections.builders import (
|
||||
create_generic_db_connection,
|
||||
@ -44,7 +45,11 @@ def get_connection(connection: RedshiftConnection) -> Engine:
|
||||
if connection.sslMode:
|
||||
if not connection.connectionArguments:
|
||||
connection.connectionArguments = init_empty_connection_arguments()
|
||||
connection.connectionArguments.__root__["sslmode"] = connection.sslMode
|
||||
connection.connectionArguments.__root__["sslmode"] = connection.sslMode.value
|
||||
if connection.sslMode in (SslMode.verify_ca, SslMode.verify_full):
|
||||
connection.connectionArguments.__root__[
|
||||
"sslrootcert"
|
||||
] = connection.sslConfig.__root__.certificatePath
|
||||
return create_generic_db_connection(
|
||||
connection=connection,
|
||||
get_connection_url_fn=get_connection_url_common,
|
||||
|
@ -50,8 +50,10 @@
|
||||
},
|
||||
"auth": {
|
||||
"title": "Authentication Mode",
|
||||
"description": "Authentication mode to connect to hive, E.g, LDAP, CUSTOM etc",
|
||||
"type": "string"
|
||||
"description": "Authentication mode to connect to hive.",
|
||||
"type": "string",
|
||||
"enum": ["NONE", "LDAP", "KERBEROS", "CUSTOM", "NOSASL", "BASIC"],
|
||||
"default": "NONE"
|
||||
},
|
||||
"kerberosServiceName": {
|
||||
"title": "Kerberos Service Name",
|
||||
|
@ -55,8 +55,12 @@
|
||||
},
|
||||
"sslMode": {
|
||||
"title": "SSL Mode",
|
||||
"description": "SSL Mode to connect to postgres database. E.g, prefer, verify-ca etc.",
|
||||
"type": "string"
|
||||
"description": "SSL Mode to connect to postgres database.",
|
||||
"enum": ["disable", "allow", "prefer", "require", "verify-ca", "verify-full"],
|
||||
"default": "disable"
|
||||
},
|
||||
"sslConfig": {
|
||||
"$ref": "../../../../security/ssl/verifySSLConfig.json#/definitions/sslConfig"
|
||||
},
|
||||
"classificationName": {
|
||||
"title": "Classification Name",
|
||||
|
@ -61,8 +61,12 @@
|
||||
},
|
||||
"sslMode": {
|
||||
"title": "SSL Mode",
|
||||
"description": "SSL Mode to connect to postgres database. E.g, prefer, verify-ca etc.",
|
||||
"type": "string"
|
||||
"description": "SSL Mode to connect to redshift database.",
|
||||
"enum": ["disable", "allow", "prefer", "require", "verify-ca", "verify-full"],
|
||||
"default": "disable"
|
||||
},
|
||||
"sslConfig": {
|
||||
"$ref": "../../../../security/ssl/verifySSLConfig.json#/definitions/sslConfig"
|
||||
},
|
||||
"connectionOptions": {
|
||||
"title": "Connection Options",
|
||||
|
@ -7,7 +7,7 @@
|
||||
"javaType": "org.openmetadata.schema.security.ssl.ValidateSSLClientConfig",
|
||||
"properties": {
|
||||
"certificatePath": {
|
||||
"description": "CA certificate path. E.g., /path/to/public.cert. Will be used if Verify SSL is set to `validate`.",
|
||||
"description": "CA certificate path. E.g., /path/to/public.cert. Will be used if Verify SSL is set to `validate` or `verify`.",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user