forked from mtusi2026/mtusi2026lab2
feat: lab2 done
This commit is contained in:
@@ -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"]);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user