@@ -139,6 +139,7 @@ func (h *SCIMHandler) BearerTokenMiddleware(next http.Handler) http.Handler {
|
||||
|
||||
h.logger.ErrorCtx(r.Context(), "SCIM token validation error", log.Error(err))
|
||||
httpserver.RenderError(w, http.StatusInternalServerError, errors.New("internal server error"))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -157,13 +158,17 @@ func (rc *scimRequestContext) logAndWrapError(err error, logMsg string) error {
|
||||
if scimErr.Status == http.StatusNotFound {
|
||||
userName = ""
|
||||
}
|
||||
|
||||
rc.handler.handler.iam.SCIMService.LogEvent(rc.ctx, rc.config, rc.method, rc.path, userName, rc.ipAddress, scimErr.Status, &errMsg)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
rc.handler.handler.logger.ErrorCtx(rc.ctx, logMsg, log.Error(err))
|
||||
|
||||
errMsg := "internal server error"
|
||||
rc.handler.handler.iam.SCIMService.LogEvent(rc.ctx, rc.config, rc.method, rc.path, rc.userName, rc.ipAddress, 500, &errMsg)
|
||||
|
||||
return scimerrors.ScimErrorInternal
|
||||
}
|
||||
|
||||
@@ -236,6 +241,7 @@ func (h *scimResourceHandler) GetAll(r *http.Request, params scim.ListRequestPar
|
||||
}
|
||||
|
||||
var filterExpr scimfilter.Expression
|
||||
|
||||
if params.FilterValidator != nil {
|
||||
if err := params.FilterValidator.Validate(); err != nil {
|
||||
return scim.Page{}, rc.logAndWrapError(scimerrors.ScimErrorBadRequest(err.Error()), "invalid filter")
|
||||
@@ -250,6 +256,7 @@ func (h *scimResourceHandler) GetAll(r *http.Request, params scim.ListRequestPar
|
||||
}
|
||||
|
||||
rc.logSuccess(200)
|
||||
|
||||
return scim.Page{
|
||||
TotalResults: totalCount,
|
||||
Resources: resources,
|
||||
|
||||
Reference in New Issue
Block a user