Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

baffao bff oauth implementation #9

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/conformance/Authorize/Authorize.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: Authorize
type: http
seq: 1
}

get {
url: {{host}}/oauth/authorize
}

assert {
res.status: eq 307
res.body: isEmpty
res.headers.location: isDefined
res.headers.location: eq {{authServerUrl}}/oauth/authorize
}

script:pre-request {
req.setMaxRedirects(0);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
meta {
name: Authorize Callback Without Query Params
type: http
seq: 1
}

get {
url: {{host}}/oauth/callback
}

assert {
res.status: eq 400
res.headers.location: undefined
}
20 changes: 20 additions & 0 deletions tests/conformance/Authorize/Callback/Authorize Callback.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: Authorize Callback
type: http
seq: 1
}

get {
url: {{host}}/oauth/callback
}

assert {
res.status: eq 301
res.body: isEmpty
res.headers.location: isDefined
res.headers.location: eq /
}

script:pre-request {
req.setMaxRedirects(0);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
meta {
name: Get Sessions When Set Cookie
type: http
seq: 2
}

get {
url: {{host}}/sessions
body: none
auth: none
}

headers {
Cookie: jwt=test
}

assert {
res.status: eq 200
res.body: isJson
res.body.sessions: length 0
}
17 changes: 17 additions & 0 deletions tests/conformance/Sessions/Get Sessions/Get Sessions.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
meta {
name: Get Sessions
type: http
seq: 1
}

get {
url: {{host}}/sessions
body: none
auth: none
}

assert {
res.status: eq 200
res.body: isJson
res.body.sessions: length 0
}
16 changes: 16 additions & 0 deletions tests/conformance/Sessions/Has Session.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: Has Session
type: http
seq: 1
}

head {
url: {{host}}/sessions
body: none
auth: none
}

assert {
res.status: eq 204
res.body: isEmpty
}
8 changes: 8 additions & 0 deletions tests/conformance/bruno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": "1",
"name": "baffao",
"type": "collection",
"ignore": [
"node_modules"
]
}
4 changes: 4 additions & 0 deletions tests/conformance/environments/local.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vars {
host: http://localhost:3000
authServerUrl: http://localhost:8080
}