Repository navigation
Conversation
TELESRV_CHECK_NUMBER_FORMAT selects the login identity format gate. The default lenient policy keeps the structural country-code gate and adds a fallback for numbers the numbering plan cannot describe, so short and unassigned international ranges such as "+7 123" or "+1488" are usable login identities. A national number that omits its country calling code (a leading trunk zero) stays refused, and the stored identity is canonical on every later normalization pass. The strict policy additionally requires the number to sit in an assigned range of a real country calling code, so short and unassigned ranges are rejected. The reserved service number +42777 stays resolvable under both policies so auth recognizes it as a system account; SendCode, SignIn and SignUp refuse it before any code is issued. The policy is installed in both the server and the admin process before stores and RPC services are constructed, so a number written from the panel is judged by the same rules.
Owner
Author
|
Closing: this repository takes changes directly on main; the pull-request flow is only used for the td schema work upstream (iamxvbaba/td#3). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TELESRV_CHECK_NUMBER_FORMAT selects the login identity format gate.
Lenient (default, false): a calling code with a plausible length is enough; a number the numbering plan cannot describe is accepted when it is 4-32 digits and carries no leading trunk zero, so short and unassigned ranges such as +7 123 or +1488 stay usable. Strict (true): the number must sit in an assigned range of a real country calling code.
A national number without its calling code stays refused in both modes, and the reserved service number +42777 never becomes a login identity.
Policy is installed in the server and the admin process before stores and RPC services are constructed.
Tests: internal/domain/phone_format_policy_test.go, internal/app/auth/phone_format_test.go. go test ./... -count=1 passes (96 packages).
Docs: .env.example, docs/configuration.en.md, docs/configuration.zh-CN.md.