|
|
|
@ -461,8 +461,15 @@ func (a adminAPIHandlers) StartProfilingHandler(w http.ResponseWriter, r *http.R |
|
|
|
|
|
|
|
|
|
defer logger.AuditLog(w, r, "StartProfiling", mustGetClaimsFromToken(r)) |
|
|
|
|
|
|
|
|
|
objectAPI, _ := validateAdminReq(ctx, w, r, iampolicy.ProfilingAdminAction) |
|
|
|
|
if objectAPI == nil { |
|
|
|
|
// Validate request signature.
|
|
|
|
|
_, adminAPIErr := checkAdminRequestAuth(ctx, r, iampolicy.ProfilingAdminAction, "") |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(adminAPIErr), r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if globalNotificationSys == nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrServerNotInitialized), r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -559,8 +566,15 @@ func (a adminAPIHandlers) DownloadProfilingHandler(w http.ResponseWriter, r *htt |
|
|
|
|
|
|
|
|
|
defer logger.AuditLog(w, r, "DownloadProfiling", mustGetClaimsFromToken(r)) |
|
|
|
|
|
|
|
|
|
objectAPI, _ := validateAdminReq(ctx, w, r, iampolicy.ProfilingAdminAction) |
|
|
|
|
if objectAPI == nil { |
|
|
|
|
// Validate request signature.
|
|
|
|
|
_, adminAPIErr := checkAdminRequestAuth(ctx, r, iampolicy.ProfilingAdminAction, "") |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(adminAPIErr), r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if globalNotificationSys == nil { |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(ErrServerNotInitialized), r.URL) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -900,7 +914,7 @@ func validateAdminReq(ctx context.Context, w http.ResponseWriter, r *http.Reques |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Validate request signature.
|
|
|
|
|
cred, adminAPIErr = checkAdminRequestAuthType(ctx, r, action, "") |
|
|
|
|
cred, adminAPIErr = checkAdminRequestAuth(ctx, r, action, "") |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(adminAPIErr), r.URL) |
|
|
|
|
return nil, cred |
|
|
|
@ -1032,7 +1046,7 @@ func (a adminAPIHandlers) TraceHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
trcErr := r.URL.Query().Get("err") == "true" |
|
|
|
|
|
|
|
|
|
// Validate request signature.
|
|
|
|
|
_, adminAPIErr := checkAdminRequestAuthType(ctx, r, iampolicy.TraceAdminAction, "") |
|
|
|
|
_, adminAPIErr := checkAdminRequestAuth(ctx, r, iampolicy.TraceAdminAction, "") |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(adminAPIErr), r.URL) |
|
|
|
|
return |
|
|
|
@ -1431,7 +1445,7 @@ func (a adminAPIHandlers) BandwidthMonitorHandler(w http.ResponseWriter, r *http |
|
|
|
|
defer logger.AuditLog(w, r, "BandwidthMonitor", mustGetClaimsFromToken(r)) |
|
|
|
|
|
|
|
|
|
// Validate request signature.
|
|
|
|
|
_, adminAPIErr := checkAdminRequestAuthType(ctx, r, iampolicy.BandwidthMonitorAction, "") |
|
|
|
|
_, adminAPIErr := checkAdminRequestAuth(ctx, r, iampolicy.BandwidthMonitorAction, "") |
|
|
|
|
if adminAPIErr != ErrNone { |
|
|
|
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErr(adminAPIErr), r.URL) |
|
|
|
|
return |
|
|
|
|