test(better auth): implementation start of better auth

This commit is contained in:
2025-09-19 22:23:32 -05:00
parent 6c56dfa810
commit 6faee89b25
37 changed files with 3433 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
meta {
name: Auth Me
type: http
seq: 1
}
get {
url: http://{{url}}/lst/api/me
body: none
auth: inherit
}
headers {
Cookie: {{session_cookie}}
}
settings {
encodeUrl: true
}

View File

@@ -0,0 +1,24 @@
meta {
name: Register
type: http
seq: 2
}
post {
url: http://{{url}}/lst/api/register
body: json
auth: inherit
}
body:json {
{
"username":"matthes01",
"name":"blake",
"email":"blake.matthes@alpla.com",
"password":"nova0511"
}
}
settings {
encodeUrl: true
}

View File

@@ -0,0 +1,35 @@
meta {
name: Sign-In - email
type: http
seq: 3
}
post {
url: http://{{url}}/lst/api/auth/sign-in/email
body: json
auth: inherit
}
body:json {
{
"email": "blake.matthes@alpla.com",
"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
}

View File

@@ -0,0 +1,35 @@
meta {
name: Sign-In - username
type: http
seq: 4
}
post {
url: http://{{url}}/lst/api/auth/sign-in/username
body: json
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
}

View File

@@ -0,0 +1,8 @@
meta {
name: auth
seq: 1
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,8 @@
meta {
name: app
seq: 2
}
auth {
mode: inherit
}

View File

@@ -0,0 +1,15 @@
meta {
name: Health
type: http
seq: 1
}
get {
url: http://{{url}}/lst/api/system/health
body: none
auth: inherit
}
settings {
encodeUrl: true
}

View File

@@ -0,0 +1,8 @@
meta {
name: system
seq: 2
}
auth {
mode: inherit
}