feat: lab2 done

This commit is contained in:
2026-10-09 15:48:03 +03:00
parent f743ee10a2
commit 575f8ee386
104 changed files with 7038 additions and 1099 deletions
+35
View File
@@ -0,0 +1,35 @@
meta {
name: Wrong password
type: http
seq: 1
}
post {
url: {{baseUrl}}/api/v1/auth/sessions
body: none
auth: basic
}
auth:basic {
username: {{username}}
password: definitely-wrong-password
}
docs {
Неверный пароль: 401 без раскрытия, существует ли пользователь,
и с тем же Basic-challenge, что и при неизвестном пользователе.
}
tests {
test("401 unauthorized", function() {
expect(res.status).to.equal(401);
});
test("Basic challenge", function() {
expect(res.headers["www-authenticate"]).to.equal('Basic realm="messenger", charset="UTF-8"');
});
test("request_id совпадает с заголовком", function() {
expect(res.body.error.request_id).to.equal(res.headers["x-request-id"]);
});
}