mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
Vendorize with bug fixes from minio browser. (#3341)
This patch brings in changes from miniobrowser repo. - Bucket policy UI and functionality fixes by @krishnasrinivas - Bucket policy implementation by @balamurugana - UI changes and new functionality changing password etc. @rushenn - UI and new functionality for sharing URLs, deleting files @rushenn and @krishnasrinivas. - Other misc fixes by @vadmeste @brendanashworth
This commit is contained in:
parent
e2ef95af7d
commit
12c1abed98
@ -549,7 +549,7 @@ var errorCodeResponse = map[APIErrorCode]APIError{
|
|||||||
},
|
},
|
||||||
ErrPolicyNesting: {
|
ErrPolicyNesting: {
|
||||||
Code: "XMinioPolicyNesting",
|
Code: "XMinioPolicyNesting",
|
||||||
Description: "Policy nesting conflict has occurred.",
|
Description: "New bucket policy conflicts with an existing policy. Please try again with new prefix.",
|
||||||
HTTPStatusCode: http.StatusConflict,
|
HTTPStatusCode: http.StatusConflict,
|
||||||
},
|
},
|
||||||
ErrInvalidObjectName: {
|
ErrInvalidObjectName: {
|
||||||
|
@ -325,6 +325,13 @@ func (e NotImplemented) Error() string {
|
|||||||
return "Not Implemented"
|
return "Not Implemented"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PolicyNesting - policy nesting conflict.
|
||||||
|
type PolicyNesting struct{}
|
||||||
|
|
||||||
|
func (e PolicyNesting) Error() string {
|
||||||
|
return "New bucket policy conflicts with an existing policy. Please try again with new prefix."
|
||||||
|
}
|
||||||
|
|
||||||
// Check if error type is IncompleteBody.
|
// Check if error type is IncompleteBody.
|
||||||
func isErrIncompleteBody(err error) bool {
|
func isErrIncompleteBody(err error) bool {
|
||||||
err = errorCause(err)
|
err = errorCause(err)
|
||||||
|
@ -696,13 +696,19 @@ func (web *webAPIHandlers) SetBucketPolicy(r *http.Request, args *SetBucketPolic
|
|||||||
err = parseBucketPolicy(bytes.NewReader(data), policy)
|
err = parseBucketPolicy(bytes.NewReader(data), policy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorIf(err, "Unable to parse bucket policy.")
|
errorIf(err, "Unable to parse bucket policy.")
|
||||||
return toJSONError(err)
|
return toJSONError(err, args.BucketName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse check bucket policy.
|
// Parse check bucket policy.
|
||||||
if s3Error := checkBucketPolicyResources(args.BucketName, policy); s3Error != ErrNone {
|
if s3Error := checkBucketPolicyResources(args.BucketName, policy); s3Error != ErrNone {
|
||||||
apiErr := getAPIError(s3Error)
|
apiErr := getAPIError(s3Error)
|
||||||
return toJSONError(errors.New(apiErr.Description), args.BucketName)
|
var err error
|
||||||
|
if apiErr.Code == "XMinioPolicyNesting" {
|
||||||
|
err = PolicyNesting{}
|
||||||
|
} else {
|
||||||
|
err = errors.New(apiErr.Description)
|
||||||
|
}
|
||||||
|
return toJSONError(err, args.BucketName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: update policy statements according to bucket name,
|
// TODO: update policy statements according to bucket name,
|
||||||
@ -850,6 +856,8 @@ func toWebAPIError(err error) APIError {
|
|||||||
apiErrCode = ErrStorageFull
|
apiErrCode = ErrStorageFull
|
||||||
case BucketNotFound:
|
case BucketNotFound:
|
||||||
apiErrCode = ErrNoSuchBucket
|
apiErrCode = ErrNoSuchBucket
|
||||||
|
case BucketExists:
|
||||||
|
apiErrCode = ErrBucketAlreadyOwnedByYou
|
||||||
case BucketNameInvalid:
|
case BucketNameInvalid:
|
||||||
apiErrCode = ErrInvalidBucketName
|
apiErrCode = ErrInvalidBucketName
|
||||||
case BadDigest:
|
case BadDigest:
|
||||||
@ -866,7 +874,11 @@ func toWebAPIError(err error) APIError {
|
|||||||
apiErrCode = ErrWriteQuorum
|
apiErrCode = ErrWriteQuorum
|
||||||
case InsufficientReadQuorum:
|
case InsufficientReadQuorum:
|
||||||
apiErrCode = ErrReadQuorum
|
apiErrCode = ErrReadQuorum
|
||||||
|
case PolicyNesting:
|
||||||
|
apiErrCode = ErrPolicyNesting
|
||||||
default:
|
default:
|
||||||
|
// Log unexpected and unhandled errors.
|
||||||
|
errorIf(err, errUnexpected.Error())
|
||||||
apiErrCode = ErrInternalError
|
apiErrCode = ErrInternalError
|
||||||
}
|
}
|
||||||
apiErr := getAPIError(apiErrCode)
|
apiErr := getAPIError(apiErrCode)
|
||||||
|
107
vendor/github.com/minio/miniobrowser/ui-assets.go
generated
vendored
107
vendor/github.com/minio/miniobrowser/ui-assets.go
generated
vendored
File diff suppressed because one or more lines are too long
6
vendor/vendor.json
vendored
6
vendor/vendor.json
vendored
@ -139,10 +139,10 @@
|
|||||||
"revisionTime": "2016-08-18T00:31:20Z"
|
"revisionTime": "2016-08-18T00:31:20Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "Gok4D2jDvlfXeygOMO+7G9isas0=",
|
"checksumSHA1": "Npl9R1pdTKB5LDiGh/hls8nMNQc=",
|
||||||
"path": "github.com/minio/miniobrowser",
|
"path": "github.com/minio/miniobrowser",
|
||||||
"revision": "9d4da540a5d8fd8762c53cdc8b11d3f543eac73a",
|
"revision": "d9214007ee7c5404358031c3e5af7df69300f874",
|
||||||
"revisionTime": "2016-10-15T15:17:03Z"
|
"revisionTime": "2016-11-24T00:39:49Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "GOSe2XEQI4AYwrMoLZu8vtmzkJM=",
|
"checksumSHA1": "GOSe2XEQI4AYwrMoLZu8vtmzkJM=",
|
||||||
|
Loading…
Reference in New Issue
Block a user