Bring trace, watch, heal and logs back to user console UI (#491)
This commit is contained in:
@@ -387,29 +387,6 @@ func newS3BucketClient(claims *models.Principal, bucketName string, prefix strin
|
||||
return s3Client, nil
|
||||
}
|
||||
|
||||
// newTenantS3BucketClient creates a new mc S3Client for an specific tenant on a namespace to talk to the server based on a bucket
|
||||
func newTenantS3BucketClient(claims *models.Principal, tenantEndpoint, bucketName string) (*mc.S3Client, error) {
|
||||
if strings.TrimSpace(bucketName) != "" {
|
||||
tenantEndpoint += fmt.Sprintf("/%s", bucketName)
|
||||
}
|
||||
|
||||
if claims == nil {
|
||||
return nil, fmt.Errorf("the provided credentials are invalid")
|
||||
}
|
||||
|
||||
s3Config := newS3Config(tenantEndpoint, claims.STSAccessKeyID, claims.STSSecretAccessKey, claims.STSSessionToken, false)
|
||||
client, pErr := mc.S3New(s3Config)
|
||||
if pErr != nil {
|
||||
return nil, pErr.Cause
|
||||
}
|
||||
s3Client, ok := client.(*mc.S3Client)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("the provided url doesn't point to a S3 server")
|
||||
}
|
||||
|
||||
return s3Client, nil
|
||||
}
|
||||
|
||||
// newS3Config simply creates a new Config struct using the passed
|
||||
// parameters.
|
||||
func newS3Config(endpoint, accessKey, secretKey, sessionToken string, insecure bool) *mc.Config {
|
||||
|
||||
Reference in New Issue
Block a user