Let the cards E2E server raise the development login limit
Development logins were capped at a hard-coded 10 per minute per address.
The cards E2E suite logs in 21 times, and with the test added in 067a4a8
the expedition test's login became the eleventh within one minute: it got
"Trop de tentatives", never reached the admin guild tab and timed out in
CI. The limit is now the devAuthRateLimit option, still 10 by default, and
the E2E server raises it as it already did for apiRateLimit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
067a4a8fd6
commit
2831f01195
4 changed files with 20 additions and 3 deletions
|
|
@ -114,6 +114,8 @@ export function createCardsApiHandler({
|
|||
fetchImpl = fetch,
|
||||
devPerks = false,
|
||||
apiRateLimit = 60,
|
||||
// Connexions de développement par minute et par adresse ; les parcours E2E en enchaînent davantage.
|
||||
devAuthRateLimit = 10,
|
||||
// Envoi des alertes Discord ; par défaut, la route palico-bot de CARDS_DISCORD_ALERTS_URL avec la clé CARDS_DISCORD_ALERTS_KEY.
|
||||
sendAlert = null
|
||||
} = {}) {
|
||||
|
|
@ -269,7 +271,7 @@ export function createCardsApiHandler({
|
|||
|
||||
if (req.method === "POST" && url.pathname === "/api/cards/auth/dev") {
|
||||
if (!devAuth) throw Object.assign(new Error("Connexion de développement indisponible."), { status: 404, code: "NOT_FOUND" });
|
||||
rateLimit(req, "dev-auth", 10);
|
||||
rateLimit(req, "dev-auth", devAuthRateLimit);
|
||||
const player = service.upsertPlayer({ discordId: DEV_DISCORD_ID, displayName: "Version développement", isAdmin: true });
|
||||
const created = service.createSession(player.id);
|
||||
res.setHeader("Set-Cookie", sessionCookie(created.token, secureCookies));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue