File tree 3 files changed +26
-2
lines changed
3 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ Gafaelfawr does not support direct upgrades from versions older than 10.0.0. Whe
10
10
11
11
<!-- scriv-insert-here -->
12
12
13
+ <a id =' changelog-12.5.2 ' ></a >
14
+ ## 12.5.2 (2025-02-10)
15
+
16
+ ### Bug fixes
17
+
18
+ - Fix escaping of the Redis password to use the correct library function.
19
+
13
20
<a id =' changelog-12.5.1 ' ></a >
14
21
## 12.5.1 (2025-02-10)
15
22
Original file line number Diff line number Diff line change 25
25
from ipaddress import IPv4Network , IPv6Network
26
26
from pathlib import Path
27
27
from typing import Annotated , Any , Self
28
- from urllib .parse import urlencode
28
+ from urllib .parse import quote
29
29
30
30
import yaml
31
31
from pydantic import (
@@ -1096,7 +1096,7 @@ def redis_rate_limit_url(self) -> str:
1096
1096
netloc = f"{ host } :{ port } " if port else host
1097
1097
path = self .redis_ephemeral_url .path
1098
1098
if self .redis_password :
1099
- password = urlencode (self .redis_password .get_secret_value ())
1099
+ password = quote (self .redis_password .get_secret_value (), safe = "" )
1100
1100
return f"async+redis://:{ password } @{ netloc } { path } "
1101
1101
else :
1102
1102
return f"async+redis://{ netloc } { path } "
Original file line number Diff line number Diff line change @@ -136,3 +136,20 @@ def test_config_cilogon_test(monkeypatch: pytest.MonkeyPatch) -> None:
136
136
}
137
137
)
138
138
assert str (config .oidc .redirect_url ) == "https://example.com/login"
139
+
140
+
141
+ def test_redis_rate_limit_url (monkeypatch : pytest .MonkeyPatch ) -> None :
142
+ ephemeral = "redis://gafaelfawr-redis-ephemeral.gafaelfawr:6370/1"
143
+ persistent = "redis://gafaelfawr-redis.gafaelfawr:6370/0"
144
+ monkeypatch .delenv ("REDIS_6379_TCP_PORT" )
145
+ monkeypatch .delenv ("REDIS_HOST" )
146
+ monkeypatch .setenv ("GAFAELFAWR_REDIS_EPHEMERAL_URL" , ephemeral )
147
+ monkeypatch .setenv ("GAFAELFAWR_REDIS_PERSISTENT_URL" , persistent )
148
+ monkeypatch .setenv ("GAFAELFAWR_REDIS_PASSWORD" , "f:b/b@c" )
149
+ config = parse_config (config_path ("github" ))
150
+ assert str (config .redis_ephemeral_url ) == ephemeral
151
+ assert str (config .redis_persistent_url ) == persistent
152
+ assert config .redis_rate_limit_url == (
153
+ "async+redis://:f%3Ab%2Fb%[email protected] "
154
+ ":6370/1"
155
+ )
You can’t perform that action at this time.
0 commit comments