endpoint should be POST not GET
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
26
README.md
26
README.md
@@ -76,7 +76,7 @@ If the SECRETS_KEY environment variable is not defined, this API call to unlock
|
|||||||
### User Operations
|
### User Operations
|
||||||
|
|
||||||
#### Register
|
#### Register
|
||||||
POST `/api/admin/register`
|
POST `/api/admin/user/register`
|
||||||
|
|
||||||
Data
|
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.
|
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
|
#### Login
|
||||||
POST `/api/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.
|
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
|
### Secrets Operations
|
||||||
|
|
||||||
#### Store
|
#### Store
|
||||||
|
4
main.go
4
main.go
@@ -247,10 +247,10 @@ func main() {
|
|||||||
// API calls that only an administrator can make
|
// API calls that only an administrator can make
|
||||||
adminOnly := router.Group("/api/admin")
|
adminOnly := router.Group("/api/admin")
|
||||||
adminOnly.Use(middlewares.JwtAuthAdminMiddleware())
|
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("/roles", controllers.GetRoles)
|
||||||
adminOnly.GET("/users", controllers.GetUsers)
|
adminOnly.GET("/users", controllers.GetUsers)
|
||||||
adminOnly.GET("/user/delete", controllers.DeleteUser)
|
|
||||||
|
|
||||||
// Get secrets
|
// Get secrets
|
||||||
protected := router.Group("/api/secret")
|
protected := router.Group("/api/secret")
|
||||||
|
Reference in New Issue
Block a user