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_r401577805
##########
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:
forget it just checked and the Exception must be a child of
`ValidationError`. We could make it a child of `ValidationError` and set the
message on a constructor override
----------------------------------------------------------------
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]