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
master
Harshavardhana 8 years ago committed by GitHub
parent e2ef95af7d
commit 12c1abed98
  1. 2
      cmd/api-errors.go
  2. 7
      cmd/object-errors.go
  3. 16
      cmd/web-handlers.go
  4. 113
      vendor/github.com/minio/miniobrowser/ui-assets.go
  5. 6
      vendor/vendor.json

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

File diff suppressed because one or more lines are too long

@ -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…
Cancel
Save