Update bruno for Login, Logout, Register, and Session

This commit is contained in:
Dita Aji Pratama 2025-02-11 13:20:25 +07:00
parent 4d8381dcea
commit 7f4f367cf4
4 changed files with 68 additions and 1 deletions

18
bruno/Auth/Login.bru Normal file
View File

@ -0,0 +1,18 @@
meta {
name: Login
type: http
seq: 5
}
post {
url: http://localhost:11000/api/auth/login
body: json
auth: none
}
body:json {
{
"username":"su",
"password":"su"
}
}

15
bruno/Auth/Logout.bru Normal file
View File

@ -0,0 +1,15 @@
meta {
name: Logout
type: http
seq: 7
}
post {
url: http://localhost:11000/api/auth/logout
body: none
auth: none
}
headers {
Authorization: Bearer xx.xx.xx
}

View File

@ -5,11 +5,15 @@ meta {
}
post {
url: http://localhost:11000/api/auth/register/su
url: http://localhost:11000/api/auth/register/:roles
body: json
auth: none
}
params:path {
roles: su
}
body:json {
{
"captcha":"test",

30
bruno/Auth/Session.bru Normal file
View File

@ -0,0 +1,30 @@
meta {
name: Session
type: http
seq: 6
}
post {
url: http://localhost:11000/api/auth/session/:type
body: none
auth: none
}
params:path {
type: check
}
headers {
Authorization: Bearer xx.xx.xx
}
docs {
This API only used when you use CostaPy as your main client.
Session have a 3 type:
- `set` for set the Bearer inside the Authorization. Need to declare a `jwt` on JSON Body.
- `check` for check the Bearer is still valid or not.
- `out` for remove the Bearer inside of Authorization.
The `set`, `out`, and some part of `check` is still not tested yet. Need the interface to test it.
}