on master help sign in
Remove export workaround from rateLimit definitions; compiler bug fixed
commit7f6069a99aecc396011804dc33205b6b95bae06f authoriko <mail@iko.soy> dateSun 10 May 2026, 12:09 (5 months ago) parent18f4f7b
1 file changed+2−4
server.knot+2−4
server.knot+2−4
@@ -254,9 +254,7 @@ type ForwardFailure = {server: Text, failedAt: Timestamp, failures: Int, firstFa
254254
255255-- Per-pubkey token bucket on /auth/challenge: prevents one key from
256256-- exhausting the challenge pool by repeated nonce requests.
257−-- (`export` is a workaround for a compiler bug where the unused-name pass
258−-- doesn't walk route `rateLimit` clauses.)
259−export challengeRateLimit = {
257+challengeRateLimit = {
260258 key: \input ctx -> Just {value: input.pubkey},
261259 limit: {requests: maxChallengeRatePerKey, window: challengeRateWindowMs}
262260}
@@ -264,7 +262,7 @@ export challengeRateLimit = {
264262-- Per-session token bucket on /messages, keyed by the Bearer token. A pubkey
265263-- is capped at `maxSessionsPerKey` live sessions, so the effective per-pubkey
266264-- send budget is bounded as well.
267−export sendRateLimit = {
265+sendRateLimit = {
268266 key: \input ctx -> Just {value: input.authorization},
269267 limit: {requests: maxSendRatePerKey, window: sendRateWindowMs}
270268}