Skip to content

fix(graph): fix PatchMe method to prevent password change - #3526

Merged
rhafer merged 3 commits into
opencloud-eu:mainfrom
maki5:fix/patch_me_password
Sep 16, 2026
Merged

rhafer merged 3 commits into
opencloud-eu:mainfrom
maki5:fix/patch_me_password

Conversation

@maki5

@maki5 maki5 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Prevent updating user password using PATCH /graph/v1.0/me method

@maki5
maki5 requested review from dragotin and rhafer September 14, 2026 11:12
@codacy-production

codacy-production Bot commented Sep 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

🟢 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

View coverage diff in Codacy

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.

@maki5 maki5 changed the title fix PatchMe method to prevent password change fix(graph): fix PatchMe method to prevent password change Sep 14, 2026

@rhafer rhafer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this fixes the /me issue

Comment thread services/graph/pkg/service/v0/users.go Outdated

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")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should rather be an errorcode.AccessDenied with http.StatusForbidden, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@rhafer

rhafer commented Sep 15, 2026

Copy link
Copy Markdown
Member

@maki5 I think this needs a rebase for the changed minio image.

@maki5
maki5 force-pushed the fix/patch_me_password branch from 8f51fbe to f741f51 Compare September 15, 2026 12:50
@rhafer
rhafer enabled auto-merge (rebase) September 15, 2026 12:51
@rhafer
rhafer merged commit b607231 into opencloud-eu:main Sep 16, 2026
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants