Commit 1769d6d42e5abc1a6a9f997088da1e8eb2a51fff
1 parent
d2ddf82ef1
Exists in
master
and in
1 other branch
rbac
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
auth_utility.go
... | ... | @@ -202,7 +202,7 @@ func secretFunc(token *jwt.Token) (interface{}, error) { |
202 | 202 | return []byte(secret), nil |
203 | 203 | } |
204 | 204 | |
205 | -// rbacEnforce returns true if role that made HTTP request is authorized to | |
205 | +// RbacCheck returns true if role that made HTTP request is authorized to | |
206 | 206 | // access the resource it is targeting. |
207 | 207 | // It exctracts user's role from the JWT token located in Authorization header of |
208 | 208 | // http.Request and then compares it with the list of supplied roles and returns |
... | ... | @@ -230,7 +230,7 @@ func RbacCheck(req *http.Request, authRoles []string) bool { |
230 | 230 | |
231 | 231 | // Rbac sets common headers and performs RBAC. |
232 | 232 | // If RBAC passes it calls the handlerFunc. |
233 | -func Rbac(handlerFunc http.HandlerFunc, authRoles []string) http.HandlerFunc { | |
233 | +func RbacHandler(handlerFunc http.HandlerFunc, authRoles []string) http.HandlerFunc { | |
234 | 234 | return func(w http.ResponseWriter, req *http.Request) { |
235 | 235 | w.Header().Set("Access-Control-Allow-Origin", "*") |
236 | 236 | ... | ... |