Compare commits
No commits in common. "4f5e314b9682b810c101ccdcee27a1a867aac1f4" and "19f2e676b0254888ae60a989159a73b410e7cc49" have entirely different histories.
4f5e314b96
...
19f2e676b0
1 changed files with 1 additions and 8 deletions
|
|
@ -78,17 +78,10 @@ test.describe('KTO-01 Kriterium 7: Drosselung der Anmeldung (throttle)', () => {
|
||||||
test('KTO-01 Kriterium 7: AUTH-CFG-10 eine zweite IP ist von der Drosselung der ersten nicht betroffen', async () => {
|
test('KTO-01 Kriterium 7: AUTH-CFG-10 eine zweite IP ist von der Drosselung der ersten nicht betroffen', async () => {
|
||||||
const { email, password } = await createUser();
|
const { email, password } = await createUser();
|
||||||
const first = client(randomIp());
|
const first = client(randomIp());
|
||||||
const started = Date.now();
|
|
||||||
for (let attempt = 1; attempt <= authConfig.loginBurst; attempt++) {
|
for (let attempt = 1; attempt <= authConfig.loginBurst; attempt++) {
|
||||||
await first.signIn(email, `${password}-falsch`);
|
await first.signIn(email, `${password}-falsch`);
|
||||||
}
|
}
|
||||||
const tolerance = refillTolerance(Date.now() - started);
|
expect((await first.signIn(email, `${password}-falsch`)).status).toBe(429);
|
||||||
// Der Limiter fuellt 0,5 Token/s nach: bis zu `tolerance` weitere Versuche, bis die 429 kommt.
|
|
||||||
let limited = await first.signIn(email, `${password}-falsch`);
|
|
||||||
for (let extra = 0; extra < tolerance && limited.status !== 429; extra++) {
|
|
||||||
limited = await first.signIn(email, `${password}-falsch`);
|
|
||||||
}
|
|
||||||
expect(limited.status).toBe(429);
|
|
||||||
|
|
||||||
const second = client(randomIp());
|
const second = client(randomIp());
|
||||||
const wrong = await second.signIn(email, `${password}-falsch`);
|
const wrong = await second.signIn(email, `${password}-falsch`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue