Page MenuHomePhabricator

[services] Move reserved_usernames to `shared`
ClosedPublic

Authored by tomek on Feb 13 2024, 6:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 5 2024, 3:23 AM
Unknown Object (File)
Apr 5 2024, 3:23 AM
Unknown Object (File)
Apr 5 2024, 3:22 AM
Unknown Object (File)
Apr 2 2024, 5:53 AM
Unknown Object (File)
Mar 17 2024, 2:13 PM
Unknown Object (File)
Mar 12 2024, 8:43 PM
Unknown Object (File)
Mar 12 2024, 6:25 PM
Unknown Object (File)
Mar 7 2024, 5:08 AM
Subscribers

Details

Summary

Move the file to shared and import it in two places.

This solution still requires the file to be duplicated. Solving this is more involved, as it would require storing this file in json format and importing it in lib, which currently isn't supported. Even if we use fs instead, we would still need to change the logic to be async.

https://linear.app/comm/issue/ENG-6780/share-reserved-usernames-between-services

Depends on D11015

Test Plan

Run both Identity and Blob services on local and Identity on Docker and check if in each case the file is accessible by console logging its content.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Feb 13 2024, 6:58 AM
bartek added inline comments.
services/identity/src/config.rs
72–73 ↗(On Diff #37030)

I'd remove this from this config and use RESERVED_USERNAME_SET directly in client_service.rs (two places: #1, #2)

104 ↗(On Diff #37030)

Same as above. Storing it twice is unnecessary. Since now it's static and Lazy, we can get rid of it here and use the static directly.

This revision is now accepted and ready to land.Feb 13 2024, 8:42 AM