From 7f4f367cf4b1e76944ff5c4f39a95f2cc193f505 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Tue, 11 Feb 2025 13:20:25 +0700 Subject: [PATCH] Update bruno for Login, Logout, Register, and Session --- bruno/Auth/Login.bru | 18 ++++++++++++++++++ bruno/Auth/Logout.bru | 15 +++++++++++++++ bruno/Auth/Register.bru | 6 +++++- bruno/Auth/Session.bru | 30 ++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 bruno/Auth/Login.bru create mode 100644 bruno/Auth/Logout.bru create mode 100644 bruno/Auth/Session.bru diff --git a/bruno/Auth/Login.bru b/bruno/Auth/Login.bru new file mode 100644 index 0000000..4c4fb64 --- /dev/null +++ b/bruno/Auth/Login.bru @@ -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" + } +} diff --git a/bruno/Auth/Logout.bru b/bruno/Auth/Logout.bru new file mode 100644 index 0000000..1124b62 --- /dev/null +++ b/bruno/Auth/Logout.bru @@ -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 +} diff --git a/bruno/Auth/Register.bru b/bruno/Auth/Register.bru index d194263..18a38ad 100644 --- a/bruno/Auth/Register.bru +++ b/bruno/Auth/Register.bru @@ -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", diff --git a/bruno/Auth/Session.bru b/bruno/Auth/Session.bru new file mode 100644 index 0000000..37aca89 --- /dev/null +++ b/bruno/Auth/Session.bru @@ -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. +}