diff --git a/auth_utility.go b/auth_utility.go index c0a35e5..5ad13a5 100644 --- a/auth_utility.go +++ b/auth_utility.go @@ -202,7 +202,7 @@ func secretFunc(token *jwt.Token) (interface{}, error) { return []byte(secret), nil } -// rbacEnforce returns true if role that made HTTP request is authorized to +// RbacCheck returns true if role that made HTTP request is authorized to // access the resource it is targeting. // It exctracts user's role from the JWT token located in Authorization header of // 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 { // Rbac sets common headers and performs RBAC. // If RBAC passes it calls the handlerFunc. -func Rbac(handlerFunc http.HandlerFunc, authRoles []string) http.HandlerFunc { +func RbacHandler(handlerFunc http.HandlerFunc, authRoles []string) http.HandlerFunc { return func(w http.ResponseWriter, req *http.Request) { w.Header().Set("Access-Control-Allow-Origin", "*")