summaryrefslogtreecommitdiffstats
path: root/model/client.go
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-07-20 17:01:10 -0400
committerCorey Hulen <corey@hulen.com>2016-07-20 13:01:10 -0800
commit86d496c9b72c97b905bfc23d26556032c6fa1d05 (patch)
tree5750d849c44f62d3269169e80fbb69e86e92867d /model/client.go
parentb0090214ef4e550b1e82c6f8cb5f717bfefe358b (diff)
downloadchat-86d496c9b72c97b905bfc23d26556032c6fa1d05.tar.gz
chat-86d496c9b72c97b905bfc23d26556032c6fa1d05.tar.bz2
chat-86d496c9b72c97b905bfc23d26556032c6fa1d05.zip
PLT-3629 fix uploading certificates if the files in the config do not exists (#3634)
Diffstat (limited to 'model/client.go')
-rw-r--r--model/client.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/model/client.go b/model/client.go
index b97a2f7ad..23648050f 100644
--- a/model/client.go
+++ b/model/client.go
@@ -1730,7 +1730,7 @@ func (c *Client) UploadCertificateFile(data []byte, contentType string) *AppErro
}
// Removes a x509 base64 Certificate or Private Key file used with SAML.
-// filename is required. Returns nil if succesful, otherwise returns an AppError
+// filename is required. Returns nil if successful, otherwise returns an AppError
func (c *Client) RemoveCertificateFile(filename string) *AppError {
if r, err := c.DoApiPost("/admin/remove_certificate", MapToJson(map[string]string{"filename": filename})); err != nil {
return err
@@ -1739,3 +1739,14 @@ func (c *Client) RemoveCertificateFile(filename string) *AppError {
return nil
}
}
+
+// Checks if the x509 base64 Certificates and Private Key files used with SAML exists on the file system.
+// Returns a map[string]interface{} if successful, otherwise returns an AppError. Must be System Admin authenticated.
+func (c *Client) SamlCertificateStatus(filename string) (map[string]interface{}, *AppError) {
+ if r, err := c.DoApiGet("/admin/remove_certificate", "", ""); err != nil {
+ return nil, err
+ } else {
+ defer closeBody(r)
+ return StringInterfaceFromJson(r.Body), nil
+ }
+}