forked from mtusi2026/mtusi2026lab2
feat: lab2 done
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
meta {
|
||||
name: Basic on business endpoint
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{baseUrl}}/api/v1/users/me
|
||||
body: none
|
||||
auth: basic
|
||||
}
|
||||
|
||||
auth:basic {
|
||||
username: {{username}}
|
||||
password: {{password}}
|
||||
}
|
||||
|
||||
docs {
|
||||
Basic принимается только на POST /auth/sessions. На бизнес-endpoint
|
||||
он даёт 401 с Bearer-challenge, даже если credentials верные.
|
||||
}
|
||||
|
||||
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