8000 Convert hard coded tag prefixes into calls to authenticators and validators by or-else · Pull Request #490 · tinode/chat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Convert hard coded tag prefixes into calls to authenticators and validators #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 11, 2020

Conversation

or-else
Copy link
Contributor
@or-else or-else commented Jul 10, 2020

rewriteTag method was refactored to call validators and authenticators to get tags instead of using hardcoded prefixes tel, email and basic. It required some refactoring in other places.

@or-else or-else changed the title Convert hard coded tag prefixes to calls to authenticators and validators Convert hard coded tag prefixes to calls into authenticators and validators Jul 10, 2020
@or-else or-else requested a review from aforge July 10, 2020 04:04
@or-else or-else changed the title Convert hard coded tag prefixes to calls into authenticators and validators Convert hard coded tag prefixes into calls to authenticators and validators Jul 10, 2020
defaultMaxLoginLength = 32

defaultMinPasswordLength = 3
)

// Token suitable as a login: starts with a Unicode letter (class L) and contains Unicode letters (L),
// numbers (N) and underscore.
var loginPattern = regexp.MustCompile(`^\pL[_\pL\pN]+$`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we actually want to allow using non-Latin characters in logins?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have that book site and although the instruction says "login should be made of latin characters and numbers" about 25% of users choose Cyrillic logins. I just don't see why we should limit it. There is no technical reason to limit. It's not obvious to me that there is a product reason.

@@ -321,7 +321,9 @@ If accounts are managed by the server, the server should respond with an error `

### `rtagns` Get a list of restricted tag namespaces.

Server may enforce certain tag namespaces to be restricted, i.e. not editable by the user.
Server may enforce certain tag namespaces (tag prefixes) to be restricted, i.e. not editable by the user.
These are also used when searching for users.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rephrase:
These are also used in Tinode discovery mechanism (e.g. searching for users, contact sync) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@or-else or-else merged commit 0ea5f66 into devel Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0