Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for checkAdminRequestAuth (0.22 sec)

  1. cmd/admin-handlers.go

    // ----------
    // Enable server profiling
    func (a adminAPIHandlers) StartProfilingHandler(w http.ResponseWriter, r *http.Request) {
    	ctx := r.Context()
    
    	// Validate request signature.
    	_, adminAPIErr := checkAdminRequestAuth(ctx, r, policy.ProfilingAdminAction, "")
    	if adminAPIErr != ErrNone {
    		writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(adminAPIErr), r.URL)
    		return
    	}
    
    	if globalNotificationSys == nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 21 11:43:18 GMT 2024
    - 97.3K bytes
    - Viewed (2)
  2. cmd/admin-handler-utils.go

    		writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrServerNotInitialized), r.URL)
    		return nil, auth.Credentials{}
    	}
    
    	for _, action := range actions {
    		// Validate request signature.
    		cred, adminAPIErr := checkAdminRequestAuth(ctx, r, action, "")
    		switch adminAPIErr {
    		case ErrNone:
    			return objectAPI, cred
    		case ErrAccessDenied:
    			// Try another
    			continue
    		default:
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Mar 01 21:09:42 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  3. cmd/auth-handler.go

    	logger.GetReqInfo(ctx).Region = globalSite.Region
    
    	return cred, owner, ErrNone
    }
    
    // checkAdminRequestAuth checks for authentication and authorization for the incoming
    // request. It only accepts V2 and V4 requests. Presigned, JWT and anonymous requests
    // are automatically rejected.
    func checkAdminRequestAuth(ctx context.Context, r *http.Request, action policy.AdminAction, region string) (auth.Credentials, APIErrorCode) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26K bytes
    - Viewed (0)
  4. cmd/auth-handler_test.go

    		{Request: mustNewPresignedRequest(http.MethodGet, "http://127.0.0.1:9000", 0, nil, t), ErrCode: ErrAccessDenied},
    	}
    	for i, testCase := range testCases {
    		if _, s3Error := checkAdminRequestAuth(ctx, testCase.Request, policy.AllAdminActions, globalSite.Region); s3Error != testCase.ErrCode {
    			t.Errorf("Test %d: Unexpected s3error returned wanted %d, got %d", i, testCase.ErrCode, s3Error)
    		}
    	}
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 15.4K bytes
    - Viewed (0)
Back to top