mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 20:01:28 +00:00
add: new Bearer Auth undefined test case and update Authorization header format
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
meta {
|
||||
name: Bearer Auth undefined
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{host}}/api/auth/bearer/protected
|
||||
body: none
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Bearer {{bearer_auth_token}}
|
||||
}
|
||||
|
||||
assert {
|
||||
res.body.message: eq Unauthorized
|
||||
res.status: eq 401
|
||||
}
|
||||
|
||||
tests {
|
||||
test("selected auth overrides Authorization header always", function() {
|
||||
const authHeader = req.getHeader("Authorization")
|
||||
expect(authHeader).to.eql("Bearer ")
|
||||
})
|
||||
}
|
||||
@@ -11,7 +11,7 @@ get {
|
||||
}
|
||||
|
||||
headers {
|
||||
Authorization: Bearer your_secret_token
|
||||
Authorization: Bearer {{bearer_auth_token}}
|
||||
}
|
||||
|
||||
vars:pre-request {
|
||||
|
||||
Reference in New Issue
Block a user