Skip to content

Commit fd94b80

Browse files
committed
test(e2e): Bruno tests
1 parent a31cde1 commit fd94b80

File tree

11 files changed

+165
-38
lines changed

11 files changed

+165
-38
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
meta {
2+
name: 401 Invalid Token
3+
type: http
4+
seq: 6
5+
}
6+
7+
get {
8+
url: http://localhost:3000/api/protected
9+
body: none
10+
auth: bearer
11+
}
12+
13+
auth:bearer {
14+
token: blablabla.xxxx.xxxx
15+
}
16+
17+
assert {
18+
res.status: eq 401
19+
res.headers['www-authenticate']: eq Bearer error="invalid_token"
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
meta {
2+
name: 401 No Token
3+
type: http
4+
seq: 5
5+
}
6+
7+
get {
8+
url: http://localhost:3000/api/protected
9+
body: none
10+
auth: none
11+
}
12+
13+
assert {
14+
res.status: eq 401
15+
res.headers['www-authenticate']: eq Bearer
16+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
meta {
2+
name: Protected EC
3+
type: http
4+
seq: 2
5+
}
6+
7+
get {
8+
url: http://localhost:3000/api/protected
9+
body: none
10+
auth: bearer
11+
}
12+
13+
auth:bearer {
14+
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6ImVjMDEifQ.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjMwMDEiLCJzdWIiOiJiQGIuY29tIiwiZXhwIjoyMDAwMDAwMDAwLCJuYmYiOjE1MTYyMzkwMjJ9.YMQHWpGLJ3P59SvPX-RIW3uT5rfzShzcP1TNcaXr0VnsxCXYO0og0c3_O30no0D_ct0hOUJINY5tBsok-66Gzw
15+
}
16+
17+
assert {
18+
res.status: eq 200
19+
res.body: contains [email protected]
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
meta {
2+
name: Protected ED
3+
type: http
4+
seq: 3
5+
}
6+
7+
get {
8+
url: http://localhost:3000/api/protected
9+
body: none
10+
auth: bearer
11+
}
12+
13+
auth:bearer {
14+
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSIsImtpZCI6ImVkMDEifQ.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjMwMDEiLCJzdWIiOiJiQGIuY29tIiwiZXhwIjoyMDAwMDAwMDAwLCJuYmYiOjE1MTYyMzkwMjJ9.5bFOZqc-lBFy4gFifQ_CTx1A3R6Nry71gdi7KH2GGvTZQC_ZI1vNbqGnWQhpR6n_jUd9ICUc0pPI5iLCB6K1Bg
15+
}
16+
17+
assert {
18+
res.status: eq 200
19+
res.body: contains [email protected]
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
meta {
2+
name: Protected RSA
3+
type: http
4+
seq: 1
5+
}
6+
7+
get {
8+
url: http://localhost:3000/api/protected
9+
body: none
10+
auth: bearer
11+
}
12+
13+
auth:bearer {
14+
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6InJzYTAxIn0.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjMwMDEiLCJzdWIiOiJiQGIuY29tIiwiZXhwIjoyMDAwMDAwMDAwLCJuYmYiOjE1MTYyMzkwMjJ9.pmm8Kdk-SvycXIGpWb1R0DuP5nlB7w4QQS7trhN_OjOpbk0A8F_lC4BdClz3rol2Pgo61lcFckJgjNBj34DQGeTGOtvxdiUXNgi1aKiXH4AyPzZeZx30PgFxa1fxhuZhBAj6xIZKBSBQvVyjeVQzAScINRCBX8zfCaXSU1ZCUkJl5vbD7zT-cYIFU76we9HcIYKRXwTiAyoNn3Lixa1H3_t5sbx3om2WlIB2x-sGpoDFDjorcuJT1yQx3grTRTBzHyRBRjZ3e8wrMbiacy-m3WoEFdkssQgYi_dSQH0hvxgacvGWayK0UqD7O5UL6EzTA2feXbgA_68o5gfvSnM8CUsPut5gZr-gwVbQKPbBdCQtl_wXIMot7UNKYEiFV38x5EmUr-ShzQcditW6fciguuY1Qav502UE1UMXvt5p8-kYxw2AaaVd6iTgQBzkBrtvywMYWzIwzGNA70RvUhI2rlgcn8GEU_51Tv_NMHjp6CjDbAxQVKa0PlcRE4pd6yk_IJSR4Nska_8BQZdPbsFn--z_XHEDoRZQ1C1M6m77xVndg3zX0sNQPXfWsttCbBmaHvMKTOp0cH9rlWB9r9nTo9fn8jcfqlak2O2IAzfzsOdVfUrES6T1UWkWobs9usGgqJuIkZHbDd4tmXyPRT4wrU7hxEyE9cuvuZPAi8GYt80
15+
}
16+
17+
assert {
18+
res.status: eq 200
19+
res.body: contains [email protected]
20+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: Public URL
3+
type: http
4+
seq: 4
5+
}
6+
7+
get {
8+
url: http://localhost:3000/public
9+
body: none
10+
auth: none
11+
}
12+
13+
assert {
14+
res.status: eq 200
15+
}

demo-server/bruno-e2e/bruno.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": "1",
3+
"name": "jwt-authorizer E2E",
4+
"type": "collection",
5+
"ignore": [
6+
"node_modules",
7+
".git"
8+
]
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: Discovery
3+
type: http
4+
seq: 1
5+
}
6+
7+
get {
8+
url: http://localhost:3001/.well-known/openid-configuration
9+
body: none
10+
auth: none
11+
}
12+
13+
assert {
14+
res.status: eq 200
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: JWKS Endpoint
3+
type: http
4+
seq: 2
5+
}
6+
7+
get {
8+
url: http://localhost:3001/jwks
9+
body: none
10+
auth: none
11+
}
12+
13+
assert {
14+
res.status: eq 200
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: Test Tokens
3+
type: http
4+
seq: 3
5+
}
6+
7+
get {
8+
url: http://localhost:3001/tokens
9+
body: none
10+
auth: none
11+
}
12+
13+
assert {
14+
res.status: eq 200
15+
}

0 commit comments

Comments
 (0)