summaryrefslogtreecommitdiffstats
path: root/model/client4.go
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-03-01 00:12:11 +0100
committerJoram Wilander <jwawilander@gmail.com>2018-02-28 23:12:11 +0000
commit6e024c45b50d31c20eb0d509263d3e0f888847de (patch)
treed5f2832be27e721b3669c4fc536e96c4187345bb /model/client4.go
parentd2b70b8671bd267e4b955e3da2ee0670daba5f2c (diff)
downloadchat-6e024c45b50d31c20eb0d509263d3e0f888847de.tar.gz
chat-6e024c45b50d31c20eb0d509263d3e0f888847de.tar.bz2
chat-6e024c45b50d31c20eb0d509263d3e0f888847de.zip
[PLT-8186] add support for ec2 instance profile authentication (#8243)
Diffstat (limited to 'model/client4.go')
-rw-r--r--model/client4.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index 4772d38b3..c1587f882 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -198,6 +198,10 @@ func (c *Client4) GetTestEmailRoute() string {
return fmt.Sprintf("/email/test")
}
+func (c *Client4) GetTestS3Route() string {
+ return fmt.Sprintf("/file/s3_test")
+}
+
func (c *Client4) GetDatabaseRoute() string {
return fmt.Sprintf("/database")
}
@@ -2092,6 +2096,16 @@ func (c *Client4) TestEmail() (bool, *Response) {
}
}
+// TestS3Connection will attempt to connect to the AWS S3.
+func (c *Client4) TestS3Connection(config *Config) (bool, *Response) {
+ if r, err := c.DoApiPost(c.GetTestS3Route(), config.ToJson()); err != nil {
+ return false, BuildErrorResponse(r, err)
+ } else {
+ defer closeBody(r)
+ return CheckStatusOK(r), BuildResponse(r)
+ }
+}
+
// GetConfig will retrieve the server config with some sanitized items.
func (c *Client4) GetConfig() (*Config, *Response) {
if r, err := c.DoApiGet(c.GetConfigRoute(), ""); err != nil {