go-cook/rest.http

72 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2024-04-03 16:12:34 -07:00
### Create a standard User
POST http://localhost:1323/api/v1/auth/register
2024-04-03 16:12:34 -07:00
Content-Type: application/x-www-form-urlencoded
2024-04-05 17:53:50 -07:00
username=test&password=test1234!
2024-04-03 16:12:34 -07:00
### Login with user
POST http://localhost:1323/api/v1/auth/login
Content-Type: application/x-www-form-urlencoded
2024-04-05 17:53:50 -07:00
username=test&password=test1234!
2024-04-03 16:12:34 -07:00
2024-04-03 16:12:34 -07:00
### Login with the admin token
POST http://localhost:1323/api/v1/auth/login
Content-Type: application/x-www-form-urlencoded
password=lol
2024-04-21 10:29:46 -07:00
### Try to refresh the token
POST http://localhost:1323/api/v1/auth/refreshToken
Content-Type: application/json
Authorization: Bearer
{
"username": "test",
"refreshToken": ""
}
2024-04-03 16:12:34 -07:00
### Add Scope to test user
POST http://localhost:1323/api/v1/auth/scopes/add
Content-Type: application/json
Authorization: Bearer
{
2024-04-05 17:53:50 -07:00
"username": "test",
2024-04-03 16:12:34 -07:00
"scopes": [
"recipe:create"
]
}
### Remove scope from test user
POST http://localhost:1323/api/v1/auth/scopes/remove
Content-Type: application/json
Authorization: Bearer
{
2024-04-05 17:53:50 -07:00
"username": "test",
"scopes": [
"recipe:create"
]
}
2024-04-03 16:12:34 -07:00
2024-03-26 17:54:32 -07:00
###
2024-04-03 16:12:34 -07:00
POST http://localhost:1323/api/v1/
2024-03-26 17:54:32 -07:00
###
GET http://localhost:1323/api/v1/demo/hello
###
GET http://localhost:1323/api/v1/demo/hello/james
###
GET http://localhost:1323/api/v1/demo/hello/body
Content-Type: application/json
2024-03-26 17:54:32 -07:00
{
"name": "body"
}
###
POST http://localhost:1323/api/v1/login?username=test
###
GET http://localhost:1323/api/v1/demo/protected
Authorization: Bearer