fix: 1. get object acl not found 2. distinguish primary url for bucket

This commit is contained in:
Qiu Jian
2019-08-08 18:16:52 +08:00
parent 04b2e39ba1
commit 3d11836ea7
11 changed files with 24 additions and 2 deletions
+10
View File
@@ -5,6 +5,11 @@ get:
responses:
200:
description: keystone v3 token信息
headers:
X-Subject-Token:
schema:
type: string
description: 验证成功的token
schema:
$ref: "../schemas/auth.yaml#/Auth3Response"
tags:
@@ -21,6 +26,11 @@ post:
responses:
200:
description: keystone v3 token信息
headers:
X-Subject-Token:
schema:
type: string
description: 认证成功的token
schema:
$ref: "../schemas/auth.yaml#/Auth3Response"
tags:
+1 -1
View File
@@ -441,7 +441,7 @@ paths:
$ref: "./bucket/makedir.yaml"
/buckets/{bucketName}/upload:
$ref: "./bucket/uploadobject.yaml"
/buckets/{bucketName}/tempurl:
/buckets/{bucketName}/temp-url:
$ref: "./bucket/tempurl.yaml"
/buckets/{bucketName}/acl:
$ref: "./bucket/acl.yaml"
+1
View File
@@ -53,6 +53,7 @@ func (s SBucketStats) Equals(s2 SBucketStats) bool {
type SBucketAccessUrl struct {
Url string
Description string
Primary bool
}
type SBaseCloudObject struct {
+1 -1
View File
@@ -841,7 +841,7 @@ func (bucket *SBucket) GetDetailsAcl(
if len(objKey) == 0 {
acl = iBucket.GetAcl()
} else {
objects, err := iBucket.GetIObjects(objKey, false)
objects, err := iBucket.GetIObjects(objKey, true)
if err != nil {
return nil, httperrors.NewInternalServerError("iBucket.GetIObjects error %s", err)
}
+1
View File
@@ -89,6 +89,7 @@ func (b *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl {
{
Url: fmt.Sprintf("%s.%s", b.Name, b.region.getOSSExternalDomain()),
Description: "ExtranetEndpoint",
Primary: true,
},
{
Url: fmt.Sprintf("%s.%s", b.Name, b.region.getOSSInternalDomain()),
+1
View File
@@ -135,6 +135,7 @@ func (b *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl {
{
Url: fmt.Sprintf("https://%s.%s", b.Name, b.region.getS3Endpoint()),
Description: "bucket domain",
Primary: true,
},
{
Url: fmt.Sprintf("https://%s/%s", b.region.getS3Endpoint(), b.Name),
+1
View File
@@ -766,6 +766,7 @@ func (ep SStorageEndpoints) getUrls(prefix string) []cloudprovider.SBucketAccess
ret = append(ret, cloudprovider.SBucketAccessUrl{
Url: ep.Blob,
Description: getDesc(prefix, "blob"),
Primary: true,
})
}
if len(ep.Queue) > 0 {
+1
View File
@@ -137,6 +137,7 @@ func (b *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl {
{
Url: fmt.Sprintf("https://%s.%s", b.Name, b.region.getOBSEndpoint()),
Description: "bucket url",
Primary: true,
},
{
Url: fmt.Sprintf("https://%s/%s", b.region.getOBSEndpoint(), b.Name),
+1
View File
@@ -105,6 +105,7 @@ func (bucket *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl {
{
Url: path.Join(bucket.client.endpoint, bucket.Name),
Description: fmt.Sprintf("%s", bucket.Location),
Primary: true,
},
}
}
+1
View File
@@ -142,6 +142,7 @@ func (b *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl {
{
Url: b.getBucketUrl(),
Description: "bucket domain",
Primary: true,
},
{
Url: fmt.Sprintf("https://%s/%s", b.region.getCosEndpoint(), b.getFullName()),
+5
View File
@@ -294,9 +294,14 @@ func (b *SBucket) getSrcUrl() string {
func (b *SBucket) GetAccessUrls() []cloudprovider.SBucketAccessUrl {
ret := make([]cloudprovider.SBucketAccessUrl, 0)
for i, u := range b.Domain.Src {
primary := false
if i == 0 {
primary = true
}
ret = append(ret, cloudprovider.SBucketAccessUrl{
Url: u,
Description: fmt.Sprintf("src%d", i),
Primary: primary,
})
}
for i, u := range b.Domain.CDN {