forked from mtusi2026/mtusi2026lab2
feat: lab2 done
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
meta {
|
||||
name: X-User-Id alone does not authenticate
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/v1/users/me
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
headers {
|
||||
X-User-Id: {{userId}}
|
||||
}
|
||||
|
||||
docs {
|
||||
Заголовок X-User-Id остался от lab1 и с lab2 не даёт доступа:
|
||||
без действующей Bearer-сессии ответ 401.
|
||||
}
|
||||
|
||||
tests {
|
||||
test("401 unauthorized", function() {
|
||||
expect(res.status).to.equal(401);
|
||||
});
|
||||
|
||||
test("Bearer challenge", function() {
|
||||
expect(res.headers["www-authenticate"]).to.equal('Bearer realm="messenger"');
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user