Skip to content

Commit aaa018b

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

File tree

2 files changed

+140
-12
lines changed

2 files changed

+140
-12
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

+39-12
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"]
@@ -15,8 +19,31 @@ edition = "2021"
1519
[features]
1620
default = ["disk_storage", "redis_storage"]
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 = [
34+
"r2d2",
35+
"tokio",
36+
"redis",
37+
"redis/tls-native-tls",
38+
"redis/tokio-native-tls-comp",
39+
]
40+
redis_storage_rustls = [
41+
"r2d2",
42+
"tokio",
43+
"redis",
44+
"redis/tls-rustls",
45+
"redis/tokio-rustls-comp",
46+
]
2047

2148
[dependencies]
2249
moka = { version = "0.12", features = ["sync"] }
@@ -30,12 +57,12 @@ tracing = "0.1.40"
3057
metrics = "0.24"
3158

3259
# Optional dependencies
33-
rocksdb = { version = "0.22", optional = true, features = ["multi-threaded-cf"] }
60+
rocksdb = { version = "0.22", optional = true, features = [
61+
"multi-threaded-cf",
62+
] }
3463
redis = { version = "0.27", optional = true, features = [
3564
"connection-manager",
3665
"tokio-comp",
37-
"tls-native-tls",
38-
"tokio-native-tls-comp",
3966
"script",
4067
] }
4168
r2d2 = { version = "0.8", optional = true }
@@ -53,7 +80,11 @@ tonic = { version = "0.12.3", optional = true }
5380
tonic-reflection = { version = "0.12.3", optional = true }
5481
prost = { version = "0.13.3", optional = true }
5582
prost-types = { version = "0.13.3", optional = true }
56-
cel-interpreter = { git = "https://github.com/clarkmcc/cel-rust", rev = "5b02b08", features = ["json", "regex", "chrono"] }
83+
cel-interpreter = { git = "https://github.com/clarkmcc/cel-rust", rev = "5b02b08", features = [
84+
"json",
85+
"regex",
86+
"chrono",
87+
] }
5788
cel-parser = { git = "https://github.com/clarkmcc/cel-rust", rev = "5b02b08" }
5889

5990
[dev-dependencies]
@@ -69,11 +100,7 @@ redis = { version = "0.27", features = [
69100
paste = "1"
70101
rand = "0.8"
71102
tempfile = "3.5.0"
72-
tokio = { version = "1", features = [
73-
"rt-multi-thread",
74-
"macros",
75-
"time",
76-
] }
103+
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
77104

78105
[build-dependencies]
79106
tonic-build = "0.12"

0 commit comments

Comments
 (0)