feat(ingest): support self-signed certs in Tableau (#6172)

This commit is contained in:
Harshal Sheth 2022-10-13 19:48:51 +00:00 committed by GitHub
parent 8030ac83bc
commit 82d480dfad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,6 +144,11 @@ class TableauConnectionConfig(ConfigModel):
description="Tableau Site. Always required for Tableau Online. Use emptystring to connect with Default site on Tableau Server.",
)
ssl_verify: Union[bool, str] = Field(
default=True,
description="Whether to verify SSL certificates. If using self-signed certificates, set to false or provide the path to the .pem certificate bundle.",
)
@validator("connect_uri")
def remove_trailing_slash(cls, v):
return config_clean.remove_trailing_slashes(v)
@ -168,6 +173,11 @@ class TableauConnectionConfig(ConfigModel):
try:
server = Server(self.connect_uri, use_server_version=True)
# From https://stackoverflow.com/a/50159273/5004662.
server._session.verify = self.ssl_verify
server._session.trust_env = False
server.auth.sign_in(authentication)
return server
except ServerResponseError as e: