diff --git a/LogisticsSupportTool_API_DOCS/app/auth/Auth Me.bru b/LogisticsSupportTool_API_DOCS/app/auth/Auth Me.bru index 6545d06..b3b6c03 100644 --- a/LogisticsSupportTool_API_DOCS/app/auth/Auth Me.bru +++ b/LogisticsSupportTool_API_DOCS/app/auth/Auth Me.bru @@ -5,7 +5,7 @@ meta { } get { - url: http://{{url}}/lst/api/me + url: http://{{url}}/lst/api/user/me body: none auth: inherit } diff --git a/LogisticsSupportTool_API_DOCS/app/auth/Get Users.bru b/LogisticsSupportTool_API_DOCS/app/auth/Get Users.bru new file mode 100644 index 0000000..eb4db6e --- /dev/null +++ b/LogisticsSupportTool_API_DOCS/app/auth/Get Users.bru @@ -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 +} diff --git a/LogisticsSupportTool_API_DOCS/app/auth/GrantROle by ID.bru b/LogisticsSupportTool_API_DOCS/app/auth/GrantROle by ID.bru new file mode 100644 index 0000000..a8cc340 --- /dev/null +++ b/LogisticsSupportTool_API_DOCS/app/auth/GrantROle by ID.bru @@ -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 +} diff --git a/LogisticsSupportTool_API_DOCS/app/auth/Register.bru b/LogisticsSupportTool_API_DOCS/app/auth/Register.bru index 915a845..29c94dd 100644 --- a/LogisticsSupportTool_API_DOCS/app/auth/Register.bru +++ b/LogisticsSupportTool_API_DOCS/app/auth/Register.bru @@ -5,16 +5,16 @@ meta { } post { - url: http://{{url}}/lst/api/register + url: http://{{url}}/lst/api/user/register body: json auth: inherit } body:json { { - "username":"matthes01", + "username":"matthes011", "name":"blake", - "email":"blake.matthes@alpla.com", + "email":"blake1.matthes@alpla.com", "password":"nova0511" } } diff --git a/LogisticsSupportTool_API_DOCS/app/auth/Session.bru b/LogisticsSupportTool_API_DOCS/app/auth/Session.bru new file mode 100644 index 0000000..aff92e6 --- /dev/null +++ b/LogisticsSupportTool_API_DOCS/app/auth/Session.bru @@ -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 +} diff --git a/LogisticsSupportTool_API_DOCS/app/auth/Signout.bru b/LogisticsSupportTool_API_DOCS/app/auth/Signout.bru new file mode 100644 index 0000000..679829e --- /dev/null +++ b/LogisticsSupportTool_API_DOCS/app/auth/Signout.bru @@ -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 +}