You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/01 12:24:14 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #9436: Add check for SSL certificate and add form validators

dpgaspar commented on a change in pull request #9436: Add check for SSL certificate and add form validators
URL: https://github.com/apache/incubator-superset/pull/9436#discussion_r401573436
 
 

 ##########
 File path: superset/views/database/validators.py
 ##########
 @@ -53,3 +55,21 @@ def schema_allows_csv_upload(database, schema):
         security_manager.database_access(database)
         or security_manager.all_datasource_access()
     )
+
+
+def certificate_validator(
+    certificate: Optional[str], exception: Type[ValidationError] = ValidationError
+) -> None:
+    if certificate:
+        try:
+            parse_ssl_cert(certificate)
+        except CertificateException:
 
 Review comment:
   I think we could change the `CertificateException` class and add the message property with this, then here just let `parse_ssl_cert` fail

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org