[PLT-8186] add support for ec2 instance profile authentication (#8243)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
d2b70b8671
Коммит
6e024c45b5
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user