Page MenuHomePhabricator

[identity] get reserved usernames from JSON
ClosedPublic

Authored by varun on Apr 19 2023, 12:46 PM.
Tags
None
Referenced Files
F3154028: D7532.id25396.diff
Tue, Nov 5, 7:07 AM
Unknown Object (File)
Sun, Oct 27, 12:50 AM
Unknown Object (File)
Oct 1 2024, 1:02 PM
Unknown Object (File)
Oct 1 2024, 1:02 PM
Unknown Object (File)
Oct 1 2024, 1:02 PM
Unknown Object (File)
Oct 1 2024, 1:02 PM
Unknown Object (File)
Oct 1 2024, 12:58 PM
Unknown Object (File)
Sep 18 2024, 3:57 AM
Subscribers

Details

Summary

copied over the list of reserved usernames from reserved-users.js in lib.
since the js file is hardly ever updated and we'll probably remove it soon, i figure it's fine to have two lists for now.

if anyone feels strongly, though, i can refactor reserved-users.js to use this JSON file

Depends on D7531

Test Plan

tested as part of register user workflow in later diff

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun requested review of this revision.Apr 19 2023, 1:03 PM

Can you add genesis to the reserved list? Context here

Resigning so either @jon and @bartek can approve the Rust part

jon added inline comments.
services/identity/src/utils/mod.rs
7 ↗(On Diff #25396)

can we make this lazy or once_cell?

Feel like it's not going to be updated once identity service is the source of truth.

9 ↗(On Diff #25396)

This has the implication that we require a reserved name list to be available when running the service. I would prefer adding an optional argument (e.g. --reserved-name-list $NAME_PATH).

If this is not meant to be configured separately, I would prefer to use [[ https://doc.rust-lang.org/std/macro.include_str.html | include_str! ]] macro, and just embed the information into the binary at build time. This should make deploying identity service a little easier as well, since it removes an implicit dependency on a file being located somewhere with a certain structure.

This revision now requires changes to proceed.Apr 20 2023, 10:39 AM
This revision is now accepted and ready to land.Apr 20 2023, 2:53 PM