endpoint should be POST not GET
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-03 15:12:42 +11:00
parent e7b2c86ba7
commit 85bea202f0
2 changed files with 15 additions and 15 deletions

View File

@@ -76,7 +76,7 @@ If the SECRETS_KEY environment variable is not defined, this API call to unlock
### User Operations
#### Register
POST `/api/admin/register`
POST `/api/admin/user/register`
Data
```
@@ -89,6 +89,18 @@ Data
This operation can only be performed by a user with a role that is admin enabled. There are 3 built in roles, which can be viewed via the `/api/admin/roles` endpoint.
#### Remove Users
POST `/api/admin/user/delete`
Data
```
{
"userName": ""
}
```
This operation can only be performed by a user with a role that is admin enabled. Removes user account corresponding to specified userName.
#### Login
POST `/api/login`
@@ -111,18 +123,6 @@ GET `/api/admin/users`
This operation can only be performed by a user with a role that is admin enabled. Lists currently defined users.
#### Remove Users
POST `/api/admin/user/delete`
Data
```
{
"userName": ""
}
```
This operation can only be performed by a user with a role that is admin enabled. Removes user account corresponding to specified userName.
### Secrets Operations
#### Store

View File

@@ -247,10 +247,10 @@ func main() {
// API calls that only an administrator can make
adminOnly := router.Group("/api/admin")
adminOnly.Use(middlewares.JwtAuthAdminMiddleware())
adminOnly.POST("/register", controllers.Register)
adminOnly.POST("/user/delete", controllers.DeleteUser)
adminOnly.POST("/user/register", controllers.Register)
adminOnly.GET("/roles", controllers.GetRoles)
adminOnly.GET("/users", controllers.GetUsers)
adminOnly.GET("/user/delete", controllers.DeleteUser)
// Get secrets
protected := router.Group("/api/secret")