Commit d1e5e16
authored
wfe/ra: Periodically load rate limit overrides from the database (#8407)
Add a `refreshOverrides` func to the `ratelimits.limitRegistry` struct.
Instead of populating the static `overrides` field once when creating an
instance of the struct, call the new func at startup and then every 30
minutes.
Emit relevant logs and metrics from `limitRegistry`.
Add an `OverridesFromDB` limiter config flag (for RA & WFE) to read
overrides from the DB instead of a file.
Flatten `newLimitRegistry.*()` methods' logic into their sole caller,
`NewTransactionBuilder()`.
Rename `loadDefaults()` & `loadOverrides()`, appending `FromFile` for
clarity/consistency.
test: Add ra-sct-provider dependency on SA.
**Important for deployment:** If the `OverridesFromDB` config flag is
enabled, an RA now depends on the SA in order to load overrides. The RA
must be added as a gRPC client of `sa.StorageAuthorityReadOnly`.
*CPS Compliance Review:* `OverridesFromDB` only controls how we load
rate limit overrides, which has no compliance implications beyond
general API availability (e.g. for revocation). I've checked our CP/CPS
to confirm we make no related stipulations.
Fixes #83821 parent d924a2a commit d1e5e16
File tree
16 files changed
+680
-124
lines changed- cmd
- boulder-ra
- boulder-wfe2
- sfe
- ratelimits
- ra
- sfe
- test
- config-next
- wfe2
16 files changed
+680
-124
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
| |||
271 | 276 | | |
272 | 277 | | |
273 | 278 | | |
274 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
275 | 288 | | |
| 289 | + | |
| 290 | + | |
276 | 291 | | |
277 | 292 | | |
278 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
326 | 330 | | |
327 | 331 | | |
328 | 332 | | |
| 333 | + | |
329 | 334 | | |
330 | 335 | | |
331 | 336 | | |
| |||
334 | 339 | | |
335 | 340 | | |
336 | 341 | | |
337 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
338 | 350 | | |
| 351 | + | |
339 | 352 | | |
340 | 353 | | |
341 | 354 | | |
| |||
413 | 426 | | |
414 | 427 | | |
415 | 428 | | |
| 429 | + | |
416 | 430 | | |
417 | 431 | | |
418 | 432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
113 | 123 | | |
114 | 124 | | |
115 | 125 | | |
| |||
234 | 244 | | |
235 | 245 | | |
236 | 246 | | |
| 247 | + | |
237 | 248 | | |
238 | 249 | | |
239 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
711 | | - | |
| 711 | + | |
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
| |||
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
970 | | - | |
| 970 | + | |
971 | 971 | | |
972 | 972 | | |
973 | 973 | | |
| |||
0 commit comments