craig-rueda commented on a change in pull request #9396: feat: add SSL
certificate validation for Druid
URL:
https://github.com/apache/incubator-superset/pull/9396#discussion_r398626993
##########
File path: superset/utils/core.py
##########
@@ -1163,6 +1166,26 @@ def get_username() -> Optional[str]:
return None
+def create_temporary_ssl_cert_file(certificate: str) -> str:
+ """
+ This creates a temporary certificate file that can be used to validate
HTTPS
+ sessions. A certificate is only written to disk once; on subsequent calls,
+ only the path of the existing certificate is returned.
+
+ :param certificate: The contents of the certificate
+ :return: The path to the certificate file
+ """
+ filename = hashlib.md5(certificate.encode("utf-8")).hexdigest()
+ path = os.path.join(tempfile.gettempdir(), filename)
Review comment:
Can we make this dir configurable? Placing it in temp works, but users might
want to be able to tune this. Maybe default to temp?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]