Skip to content

Commit 925e3ee

Browse files
committed
Add rustls support when using Redis
Via `redis_storage_rustls` feature. This doesn't affect default usage.
1 parent 5a2fccf commit 925e3ee

File tree

2 files changed

+138
-13
lines changed

2 files changed

+138
-13
lines changed

Cargo.lock

+101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

limitador/Cargo.toml

+37-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[package]
22
name = "limitador"
33
version = "0.8.0-dev"
4-
authors = ["David Ortiz <[email protected]>", "Eguzki Astiz Lezaun <[email protected]>", "Alex Snaps <[email protected]>"]
4+
authors = [
5+
"David Ortiz <[email protected]>",
6+
"Eguzki Astiz Lezaun <[email protected]>",
7+
"Alex Snaps <[email protected]>",
8+
]
59
license = "Apache-2.0"
610
keywords = ["rate-limiting", "rate", "limiter"]
711
categories = ["web-programming"]
@@ -13,10 +17,30 @@ readme = "README.md"
1317
edition = "2021"
1418

1519
[features]
16-
default = ["disk_storage", "redis_storage"]
20+
default = ["disk_storage", "redis_storage_nativetls"]
1721
disk_storage = ["rocksdb"]
18-
distributed_storage = ["tokio", "tokio-stream", "h2", "base64", "uuid", "tonic", "tonic-reflection", "prost", "prost-types"]
19-
redis_storage = ["redis", "r2d2", "tokio"]
22+
distributed_storage = [
23+
"tokio",
24+
"tokio-stream",
25+
"h2",
26+
"base64",
27+
"uuid",
28+
"tonic",
29+
"tonic-reflection",
30+
"prost",
31+
"prost-types",
32+
]
33+
redis_storage = ["r2d2", "tokio", "redis"]
34+
redis_storage_nativetls = [
35+
"redis_storage",
36+
"redis/tls-native-tls",
37+
"redis/tokio-native-tls-comp",
38+
]
39+
redis_storage_rustls = [
40+
"redis_storage",
41+
"redis/tls-rustls",
42+
"redis/tokio-rustls-comp",
43+
]
2044

2145
[dependencies]
2246
moka = { version = "0.12", features = ["sync"] }
@@ -30,12 +54,12 @@ tracing = "0.1.40"
3054
metrics = "0.24"
3155

3256
# Optional dependencies
33-
rocksdb = { version = "0.22", optional = true, features = ["multi-threaded-cf"] }
57+
rocksdb = { version = "0.22", optional = true, features = [
58+
"multi-threaded-cf",
59+
] }
3460
redis = { version = "0.27", optional = true, features = [
3561
"connection-manager",
3662
"tokio-comp",
37-
"tls-native-tls",
38-
"tokio-native-tls-comp",
3963
"script",
4064
] }
4165
r2d2 = { version = "0.8", optional = true }
@@ -53,7 +77,11 @@ tonic = { version = "0.12.3", optional = true }
5377
tonic-reflection = { version = "0.12.3", optional = true }
5478
prost = { version = "0.13.3", optional = true }
5579
prost-types = { version = "0.13.3", optional = true }
56-
cel-interpreter = { git = "https://github.com/clarkmcc/cel-rust", rev = "5b02b08", features = ["json", "regex", "chrono"] }
80+
cel-interpreter = { git = "https://github.com/clarkmcc/cel-rust", rev = "5b02b08", features = [
81+
"json",
82+
"regex",
83+
"chrono",
84+
] }
5785
cel-parser = { git = "https://github.com/clarkmcc/cel-rust", rev = "5b02b08" }
5886

5987
[dev-dependencies]
@@ -69,11 +97,7 @@ redis = { version = "0.27", features = [
6997
paste = "1"
7098
rand = "0.8"
7199
tempfile = "3.5.0"
72-
tokio = { version = "1", features = [
73-
"rt-multi-thread",
74-
"macros",
75-
"time",
76-
] }
100+
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
77101

78102
[build-dependencies]
79103
tonic-build = "0.12"

0 commit comments

Comments
 (0)