diff --git a/README.md b/README.md index 88b89d4..d78d903 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.go b/main.go index 2ce04c1..6635d0f 100644 --- a/main.go +++ b/main.go @@ -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")