Bring trace, watch, heal and logs back to user console UI (#491)

This commit is contained in:
Cesar N
2020-12-09 17:10:39 -06:00
committed by GitHub
parent 2d6f949359
commit a4ad341a18
39 changed files with 585 additions and 1305 deletions

View File

@@ -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 {