Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 33 for APIErrorCode (0.08 sec)

  1. cmd/api-errors_test.go

    package cmd
    
    import (
    	"context"
    	"errors"
    	"testing"
    
    	"github.com/minio/minio/internal/crypto"
    	"github.com/minio/minio/internal/hash"
    )
    
    var toAPIErrorTests = []struct {
    	err     error
    	errCode APIErrorCode
    }{
    	{err: hash.BadDigest{}, errCode: ErrBadDigest},
    	{err: hash.SHA256Mismatch{}, errCode: ErrContentSHA256Mismatch},
    	{err: IncompleteBody{}, errCode: ErrIncompleteBody},
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 25 15:13:08 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  2. cmd/auth-handler_test.go

    	globalIAMSys.Init(ctx, objLayer, globalEtcdClient, 2*time.Second)
    
    	// List of test cases for validating http request authentication.
    	testCases := []struct {
    		req     *http.Request
    		s3Error APIErrorCode
    	}{
    		// When request is unsigned, access denied is returned.
    		{mustNewRequest(http.MethodGet, "http://127.0.0.1:9000", 0, nil, t), ErrAccessDenied},
    		// Empty Content-Md5 header.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  3. cmd/signature-v4-parser_test.go

    func TestParseCredentialHeader(t *testing.T) {
    	sampleTimeStr := UTCNow().Format(yyyymmdd)
    
    	testCases := []struct {
    		inputCredentialStr  string
    		expectedCredentials credentialHeader
    		expectedErrCode     APIErrorCode
    	}{
    		// Test Case - 1.
    		// Test case with no '=' in te inputCredentialStr.
    		{
    			inputCredentialStr:  "Credential",
    			expectedCredentials: credentialHeader{},
    			expectedErrCode:     ErrMissingFields,
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Feb 22 06:26:06 UTC 2024
    - 27.4K bytes
    - Viewed (0)
  4. cmd/signature-v4-utils.go

    }
    
    // check if the access key is valid and recognized, additionally
    // also returns if the access key is owner/admin.
    func checkKeyValid(r *http.Request, accessKey string) (auth.Credentials, bool, APIErrorCode) {
    	cred := globalActiveCred
    	if cred.AccessKey != accessKey {
    		if !globalIAMSys.Initialized() {
    			// Check if server has initialized, then only proceed
    			// to check for IAM users otherwise its okay for clients
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Jun 13 22:26:38 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  5. cmd/signature-v4_test.go

    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package cmd
    
    import (
    	"context"
    	"fmt"
    	"net/http"
    	"net/url"
    	"os"
    	"testing"
    	"time"
    )
    
    func niceError(code APIErrorCode) string {
    	// Special-handle ErrNone
    	if code == ErrNone {
    		return "ErrNone"
    	}
    
    	return fmt.Sprintf("%s (%s)", errorCodes[code].Code, errorCodes[code].Description)
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Jun 13 22:26:38 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  6. cmd/bucket-object-lock.go

    func checkPutObjectLockAllowed(ctx context.Context, rq *http.Request, bucket, object string, getObjectInfoFn GetObjectInfoFn, retentionPermErr, legalHoldPermErr APIErrorCode) (objectlock.RetMode, objectlock.RetentionDate, objectlock.ObjectLegalHold, APIErrorCode) {
    	var mode objectlock.RetMode
    	var retainDate objectlock.RetentionDate
    	var legalHold objectlock.ObjectLegalHold
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  7. cmd/streaming-v4-unsigned.go

    // out of HTTP "chunked" format before returning it.
    // The s3ChunkedReader returns io.EOF when the final 0-length chunk is read.
    func newUnsignedV4ChunkedReader(req *http.Request, trailer bool) (io.ReadCloser, APIErrorCode) {
    	if trailer {
    		// Discard anything unsigned.
    		req.Trailer = make(http.Header)
    		trailers := req.Header.Values(awsTrailerHeader)
    		for _, key := range trailers {
    			req.Trailer.Add(key, "")
    		}
    	} else {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat May 06 02:53:12 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  8. cmd/api-errors.go

    }
    
    // APIErrorCode type of error status.
    type APIErrorCode int
    
    //go:generate stringer -type=APIErrorCode -trimprefix=Err $GOFILE
    
    // Error codes, non exhaustive list - http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
    const (
    	ErrNone APIErrorCode = iota
    	ErrAccessDenied
    	ErrBadDigest
    	ErrEntityTooSmall
    	ErrEntityTooLarge
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Oct 01 22:13:18 UTC 2024
    - 92.1K bytes
    - Viewed (0)
  9. cmd/handler-utils_test.go

    		req.ContentLength = int64(createBucketConfigBuffer.Len())
    		return req
    	}
    
    	testCases := []struct {
    		request            *http.Request
    		serverConfigRegion string
    		expectedCode       APIErrorCode
    	}{
    		// Test case - 1.
    		{createExpectedRequest(&http.Request{}, "eu-central-1"), globalMinioDefaultRegion, ErrNone},
    		// Test case - 2.
    		// In case of empty request body ErrNone is returned.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Feb 22 06:26:06 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  10. cmd/streaming-signature-v4.go

    // error while parsing and validating.
    func calculateSeedSignature(r *http.Request, trailers bool) (cred auth.Credentials, signature string, region string, date time.Time, errCode APIErrorCode) {
    	// Copy request.
    	req := *r
    
    	// Save authorization header.
    	v4Auth := req.Header.Get(xhttp.Authorization)
    
    	// Parse signature version '4' header.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu May 16 23:13:47 UTC 2024
    - 18.2K bytes
    - Viewed (0)
Back to top