Skip to content

Commit a2cf469

Browse files
poljardkasak
andcommitted
feat(base): Introduce a DisplayName struct
This patch introduces a struct that normalizes and sanitizes display names. Display names can be a source of abuse and can contain characters which might make it hard to distinguish one display name from the other. This struct attempts to make it easier to protect against such abuse. Changelog: Introduce a DisplayName struct which normalizes and sanitizes display names. Co-authored-by: Denis Kasak <[email protected]>
1 parent 232391c commit a2cf469

File tree

3 files changed

+425
-4
lines changed

3 files changed

+425
-4
lines changed

Cargo.lock

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/matrix-sdk-base/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ assert_matches = { workspace = true, optional = true }
5050
assert_matches2 = { workspace = true, optional = true }
5151
async-trait = { workspace = true }
5252
bitflags = { version = "2.4.0", features = ["serde"] }
53+
decancer = "3.2.4"
5354
eyeball = { workspace = true }
5455
eyeball-im = { workspace = true }
5556
futures-util = { workspace = true }
@@ -60,14 +61,15 @@ matrix-sdk-crypto = { workspace = true, optional = true }
6061
matrix-sdk-store-encryption = { workspace = true }
6162
matrix-sdk-test = { workspace = true, optional = true }
6263
once_cell = { workspace = true }
64+
regex = "1.11.0"
6365
ruma = { workspace = true, features = ["canonical-json", "unstable-msc3381", "unstable-msc2867", "rand"] }
66+
unicode-normalization = "0.1.24"
6467
serde = { workspace = true, features = ["rc"] }
6568
serde_json = { workspace = true }
6669
tokio = { workspace = true }
6770
thiserror = { workspace = true }
6871
tracing = { workspace = true }
6972
uniffi = { workspace = true, optional = true }
70-
regex = "1.11.1"
7173

7274
[dev-dependencies]
7375
assert_matches = { workspace = true }
@@ -77,6 +79,7 @@ futures-executor = { workspace = true }
7779
http = { workspace = true }
7880
matrix-sdk-test = { workspace = true }
7981
stream_assert = { workspace = true }
82+
similar-asserts = { workspace = true }
8083

8184
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
8285
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }

0 commit comments

Comments
 (0)