mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
NET-152 enrollment keys for non admins (#2346)
* return 401 instead of 403 * fixed http.StatusForbidden * Tagged build version (temp) * Unauthorized_Err when applicable * untagged version * fixed PUT /api/users/networks/user1 * - expired token redirs to login - added `/api/enrollment_keys` for non-admins - unit test for enrollment keys for non-admins * handle user perms in `/hosts` * removed debug * misc * - support masteradmin - return hosts with partial access * added `ismaster` to middleware
This commit is contained in:
@@ -148,6 +148,7 @@ retry:
|
||||
if res.StatusCode == http.StatusUnauthorized && !retried && ctx.MasterKey == "" {
|
||||
req.Header.Set("Authorization", "Bearer "+getAuthToken(ctx, true))
|
||||
retried = true
|
||||
// TODO add a retry limit, drop goto
|
||||
goto retry
|
||||
}
|
||||
resBodyBytes, err := io.ReadAll(res.Body)
|
||||
|
Reference in New Issue
Block a user