docs(api): auth endpoints in bruno
This commit is contained in:
@@ -5,7 +5,7 @@ meta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get {
|
get {
|
||||||
url: http://{{url}}/lst/api/me
|
url: http://{{url}}/lst/api/user/me
|
||||||
body: none
|
body: none
|
||||||
auth: inherit
|
auth: inherit
|
||||||
}
|
}
|
||||||
|
|||||||
24
LogisticsSupportTool_API_DOCS/app/auth/Get Users.bru
Normal file
24
LogisticsSupportTool_API_DOCS/app/auth/Get Users.bru
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
meta {
|
||||||
|
name: Get Users
|
||||||
|
type: http
|
||||||
|
seq: 7
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: http://{{url}}/lst/api/admin/users
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
body:json {
|
||||||
|
{
|
||||||
|
"username":"matthes01",
|
||||||
|
"name":"blake",
|
||||||
|
"email":"blake.matthes@alpla.com",
|
||||||
|
"password":"nova0511"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
}
|
||||||
26
LogisticsSupportTool_API_DOCS/app/auth/GrantROle by ID.bru
Normal file
26
LogisticsSupportTool_API_DOCS/app/auth/GrantROle by ID.bru
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
meta {
|
||||||
|
name: GrantROle by ID
|
||||||
|
type: http
|
||||||
|
seq: 8
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: http://{{url}}/lst/api/admin/:userID/grant
|
||||||
|
body: json
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
params:path {
|
||||||
|
userID: 0hlO48C7Jw1J804FxrCnonK
|
||||||
|
}
|
||||||
|
|
||||||
|
body:json {
|
||||||
|
{
|
||||||
|
"module":"users",
|
||||||
|
"role":"admin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
}
|
||||||
@@ -5,16 +5,16 @@ meta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
url: http://{{url}}/lst/api/register
|
url: http://{{url}}/lst/api/user/register
|
||||||
body: json
|
body: json
|
||||||
auth: inherit
|
auth: inherit
|
||||||
}
|
}
|
||||||
|
|
||||||
body:json {
|
body:json {
|
||||||
{
|
{
|
||||||
"username":"matthes01",
|
"username":"matthes011",
|
||||||
"name":"blake",
|
"name":"blake",
|
||||||
"email":"blake.matthes@alpla.com",
|
"email":"blake1.matthes@alpla.com",
|
||||||
"password":"nova0511"
|
"password":"nova0511"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
35
LogisticsSupportTool_API_DOCS/app/auth/Session.bru
Normal file
35
LogisticsSupportTool_API_DOCS/app/auth/Session.bru
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
meta {
|
||||||
|
name: Session
|
||||||
|
type: http
|
||||||
|
seq: 5
|
||||||
|
}
|
||||||
|
|
||||||
|
get {
|
||||||
|
url: http://{{url}}/lst/api/auth/get-session
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
body:json {
|
||||||
|
{
|
||||||
|
"username": "matthes01",
|
||||||
|
"password": "nova0511"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
script:post-response {
|
||||||
|
// grab the raw Set-Cookie header
|
||||||
|
const cookies = res.headers["set-cookie"];
|
||||||
|
|
||||||
|
// cookies is usually an array, e.g. ["auth_session=abcd123; Path=/; HttpOnly; Secure; SameSite=Lax"]
|
||||||
|
|
||||||
|
// Extract just the value part ("auth_session=abcd123")
|
||||||
|
const sessionCookie = cookies[0].split(";")[0];
|
||||||
|
|
||||||
|
// Save it as an environment variable
|
||||||
|
bru.setEnvVar("session_cookie", sessionCookie);
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
}
|
||||||
28
LogisticsSupportTool_API_DOCS/app/auth/Signout.bru
Normal file
28
LogisticsSupportTool_API_DOCS/app/auth/Signout.bru
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
meta {
|
||||||
|
name: Signout
|
||||||
|
type: http
|
||||||
|
seq: 6
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
url: http://{{url}}/lst/api/auth/sign-out
|
||||||
|
body: none
|
||||||
|
auth: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
body:json {
|
||||||
|
{
|
||||||
|
"username": "matthes01",
|
||||||
|
"password": "nova0511"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
script:post-response {
|
||||||
|
|
||||||
|
// Save it as an environment variable
|
||||||
|
bru.setEnvVar("session_cookie", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
settings {
|
||||||
|
encodeUrl: true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user