fix(graph): fix PatchMe method to prevent password change - #3526
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 87.50% diff coverage · +0.05% coverage variation
Metric Results Coverage variation ✅ +0.05% coverage variation (-1.00%) Diff coverage ✅ 87.50% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (a6f8777) 88625 21132 23.84% Head commit (ff58aa6) 88630 (+5) 21175 (+43) 23.89% (+0.05%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3526) 8 7 87.50% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
rhafer
left a comment
There was a problem hiding this comment.
While this fixes the /me issue
|
|
||
| if changes.HasPasswordProfile() { | ||
| logger.Info().Interface("user", changes).Msg("could not update user: user is not allowed to change own password profile") | ||
| errorcode.InvalidRequest.Render(w, r, http.StatusBadRequest, "user is not allowed to change own password profile") |
There was a problem hiding this comment.
I think this should rather be an errorcode.AccessDenied with http.StatusForbidden, right?
There was a problem hiding this comment.
Forbidden make sense. Should we then change the statuses and error codes for other checks as well? because they follow the same logic of non permitting some operation
|
@maki5 I think this needs a rebase for the changed minio image. |
8f51fbe to
f741f51
Compare
Prevent updating user password using
PATCH /graph/v1.0/memethod