Skip to content

[WPB-23995] fix app access in search, fetch. - #5173

Merged
fisx merged 19 commits into
developfrom
WPB-23995-app-visibility-2
Apr 14, 2026
Merged

[WPB-23995] fix app access in search, fetch.#5173
fisx merged 19 commits into
developfrom
WPB-23995-app-visibility-2

Conversation

@fisx

@fisx fisx commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Apr 9, 2026
@fisx
fisx force-pushed the WPB-23995-app-visibility-2 branch 2 times, most recently from 6d3e959 to c3617cc Compare April 9, 2026 15:51
@fisx
fisx marked this pull request as ready for review April 9, 2026 19:51
@fisx
fisx requested review from a team as code owners April 9, 2026 19:51
@fisx
fisx requested a review from Copilot April 9, 2026 19:57

Copilot AI 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.

Pull request overview

This PR tightens app user visibility so that apps are only discoverable within their own team, affecting contact search as well as app/user fetch paths in Brig and the UserSubsystem.

Changes:

  • Introduces team-aware app filtering via new UserProfileFilter variants and applies it across local profile fetch paths.
  • Updates contact search (ElasticSearch query) to exclude app users from other teams (or all apps when the searcher has no team).
  • Adjusts public and federation endpoints plus integration/unit tests and adds a changelog entry.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
services/brig/src/Brig/API/Public.hs Enforces same-team access for getApp and filters getApps by team.
services/brig/src/Brig/API/Federation.hs Ensures federated fetch/search paths do not return apps by default (Nothing team).
libs/wire-subsystems/src/Wire/UserSubsystem.hs Reworks UserProfileFilter and makes local profile fetch APIs team-aware for app visibility.
libs/wire-subsystems/src/Wire/UserSubsystem/Interpreter.hs Selects profile filter based on requester’s team and re-filters after app-info injection.
libs/wire-subsystems/src/Wire/IndexedUserStore/ElasticSearch.hs Excludes apps from other teams in /search/contacts ES query.
libs/wire-subsystems/src/Wire/UserGroupSubsystem/Interpreter.hs Adapts to new getLocalUserProfiles signature with team context.
libs/wire-subsystems/src/Wire/StoredUser.hs Custom Arbitrary instance to avoid generating bots/service users in tests.
libs/wire-subsystems/test/unit/Wire/UserSubsystem/InterpreterSpec.hs Updates unit test call sites for new getLocalUserProfiles signature.
libs/wire-subsystems/test/unit/Wire/MockInterpreters/UserSubsystem.hs Extends mock interpreter to support the expanded UserProfileFilter.
integration/test/Test/Search.hs Simplifies federated search test expectations (but reduces type-filter coverage).
integration/test/Test/Apps.hs Updates app tests to assert cross-team/teardless access restrictions + search visibility.
changelog.d/3-bug-fixes/WPB-23995-app-visibility-2 Documents the behavior change for app visibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integration/test/Test/Apps.hs Outdated
Comment thread integration/test/Test/Search.hs Outdated
Comment thread integration/test/Test/Search.hs
@fisx
fisx force-pushed the WPB-23995-app-visibility-2 branch from 43cef82 to 1a247cf Compare April 11, 2026 14:07
fisx added 2 commits April 11, 2026 23:43
This is needed for clients in remote convs to see all conv
participants.
App profiles are now shown like regular profiles everywhere except in
end-points "get-app", "get-apps".
@fisx
fisx force-pushed the WPB-23995-app-visibility-2 branch from 2a05e7d to a4a1ac2 Compare April 13, 2026 09:05
@fisx
fisx force-pushed the WPB-23995-app-visibility-2 branch from a85fe63 to 60c5ee3 Compare April 13, 2026 10:19
@fisx
fisx force-pushed the WPB-23995-app-visibility-2 branch from 8b960f3 to d1580d1 Compare April 14, 2026 08:43
@fisx
fisx merged commit 04de704 into develop Apr 14, 2026
10 checks passed
@fisx
fisx deleted the WPB-23995-app-visibility-2 branch April 14, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants