Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add option to disable searching in the user dir #4895

Merged
merged 6 commits into from
Mar 20, 2019

Conversation

erikjohnston
Copy link
Member

We still populate it, as it can still be accessed via the admin API.

We still populate it, as it can still be accessed via the admin API.
@codecov
Copy link

codecov bot commented Mar 19, 2019

Codecov Report

Merging #4895 into develop will decrease coverage by <.01%.
The diff coverage is 75%.

@@             Coverage Diff             @@
##           develop    #4895      +/-   ##
===========================================
- Coverage    77.96%   77.95%   -0.01%     
===========================================
  Files          326      326              
  Lines        33958    33962       +4     
  Branches      5601     5602       +1     
===========================================
  Hits         26474    26474              
- Misses        5863     5867       +4     
  Partials      1621     1621

@erikjohnston erikjohnston requested a review from a team March 19, 2019 17:35
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

again:

  • should we disable the insertion code
  • can has tests please

synapse/config/user_directory.py Show resolved Hide resolved
synapse/config/user_directory.py Outdated Show resolved Hide resolved
synapse/config/user_directory.py Outdated Show resolved Hide resolved
richvdh and others added 3 commits March 20, 2019 14:33
@erikjohnston
Copy link
Member Author

should we disable the insertion code

Two things: 1) there's an admin API that uses user dir that isn't disabled, and 2) we'd want to have some way of correctly restarting the insertions if we flipped it off and on, which I'd like to avoid for now.

@erikjohnston erikjohnston requested a review from richvdh March 20, 2019 15:28
@@ -59,6 +59,12 @@ def on_POST(self, request):
requester = yield self.auth.get_user_by_req(request, allow_guest=False)
user_id = requester.user.to_string()

if not self.hs.config.user_directory_search_enabled:
Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't moved that into __init__ as there's no way of getting at servlets after they're set up afaik. We could do various contortions in the test to make it work, but I don't know whether that is better or worse.

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm

@erikjohnston erikjohnston merged commit 263f2c9 into develop Mar 20, 2019
@erikjohnston erikjohnston deleted the erikj/disable_user_search branch January 9, 2020 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants