Skip to content
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

Change out the triple-dot sequence in third-party invites to an ellipsis character #324

Merged
merged 6 commits into from
Dec 1, 2020

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Nov 26, 2020

Besides a slightly nicer presentation, this can be useful when email addresses that contain period characters are obfuscated. Consider the address: [email protected].

If this address is obfuscated to firstname....@exa..., we end up with a slightly odd-looking sequence of four periods on the left-hand side.

With an ellipsis character, we'd instead get firstname.…@exa…, which is still a little odd, but is clearer with regards to what exactly was obfuscated.

Applying this to the dinsic branch as it grew out of a dinsic PR conversation, but will be ported to mainline with the rest of the obfuscated code it touches.

Not sponsored as this was not a paid-for request.

Besides a slightly nicer presentation, this can be useful when email addresses
that contain period characters are obfuscated. Consider the address:
`[email protected]`. If this address ends up being obfuscated to
`firstname....@exa...`, we end up with a slightly odd-looking sequence of
four periods on the left-hand side.

With an ellipsis character, we'd instead get `firstname.…@exa…`, which is still
a little odd, but is clearer with regards to what exactly was obfuscated.
@anoadragon453 anoadragon453 requested a review from clokep November 26, 2020 18:00
This allows processing the ellipsis character in Python 2
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

This should be OK. I assume there's no issues here with using a non-ASCII character?

:type characters_to_reveal: int

:return: The redacted string.
:rtype: unicode
"""
ellipsis_character = u"…"
Copy link
Member

Choose a reason for hiding this comment

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

This could probably just be inlined in each place it is used? Unless there's a plan to make this configurable. If you want to keep it, I might call this obfuscation_string or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really a plan, no. I think I did it out of habit, but it indeed doesn't bring much value.

@anoadragon453
Copy link
Member Author

I assume there's no issues here with using a non-ASCII character?

I'm not entirely sure. I know that clients regularly handle them in usernames, and I know that Sydent's database can handle them. Synapse presumably accepts them. This will be tested on DINUM's preprod beforehand at least.

cc @giomfo

@anoadragon453 anoadragon453 merged commit c33d976 into dinsic Dec 1, 2020
@anoadragon453 anoadragon453 deleted the anoa/dotdotdot_to_ellipsis branch December 1, 2020 16:59
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