Skip to content

[stable-4.0] fix(graph): hide private user attributes from other users - #4061

Merged
rhafer merged 2 commits into
opencloud-eu:stable-4.0from
rhafer:backport/4014-stable-4.0
Nov 24, 2026
Merged

rhafer merged 2 commits into
opencloud-eu:stable-4.0from
rhafer:backport/4014-stable-4.0

Conversation

@rhafer

@rhafer rhafer commented Nov 18, 2026

Copy link
Copy Markdown
Member

Assisted-by: Claude Code:claude-opus-5-5
(cherry picked from commit dc89168)

Assisted-by: Claude Code:claude-opus-5-5
(cherry picked from commit dc89168)
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 19 complexity

Metric Results
Complexity 19

View in Codacy

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
rhafer requested review from asaah262 and micbar November 18, 2026 13:59
Comment thread services/graph/pkg/service/v0/users.go Resolved

@asaah262 asaah262 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the backport! One difference from the other branches: stable-4.0 doesn't have #2104, so non-admin search results here still have an empty onPremisesSamAccountName. With filterOutPrivateUserAttrs they'd now include the user name, which is why apiTenancy/mutltiTenancy.feature:18 fails (onPremisesSamAccountName: Const failed, it expects ""). It fails in pipelines 5545 and 5559 and passed on #4023.
Do we want to bring the #2104 behaviour to 4.0 as well (and adjust the test to "alice"), or keep 4.0 as it is and drop the user name from the public attributes on this branch?

@rhafer

rhafer commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Do we want to bring the #2104 behaviour to 4.0 as well (and adjust the test to "alice"), or keep 4.0 as it is and drop the user name from the public attributes on this branch?

I think we should backport #2104, unless it doesn't cleanly backport.

* fix: Show username in unprivileged search results

`onPremisesSamAccountName` is a mandatory attribute according to the
spec. There's no harm in returning it in the search results also for
unprivileged users.

Fixes: opencloud-eu#144

* adapt tests

* adapt tests

* adapt tests

---------

Co-authored-by: Viktor Scharf <[email protected]>
(cherry picked from commit 6082e0c)
@rhafer
rhafer requested a review from asaah262 November 23, 2026 15:04
@asaah262

Copy link
Copy Markdown
Contributor

@rhafer Thanks for adding #2104! I checked the cherry-pick against the original: the users.go part is rightly dropped, because filterOutPrivateUserAttrs already returns onPremisesSamAccountName, and the test changes match. The graph unit tests pass locally (also with -race) and CI is green now, including mutltiTenancy.feature.

@rhafer
rhafer merged commit da1246e into opencloud-eu:stable-4.0 Nov 24, 2026
61 checks passed
@openclouders openclouders mentioned this pull request Nov 24, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants