Преглед на файлове

fix wrong source of "usergroup" metadata (#99)

* extract hardcoded jwt field names into config

* Update config.go

* bugfix: source group from usergroup field instead of password

Co-authored-by: James Read <contact@jread.com>
Bernard Crnković преди 3 години
родител
ревизия
b6196a4b3f
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 2
      internal/acl/acl.go

+ 1 - 2
internal/acl/acl.go

@@ -79,8 +79,7 @@ func UserFromContext(ctx context.Context, cfg *config.Config) *AuthenticatedUser
 
 
 	if ok {
 	if ok {
 		ret.Username = getMetdataKeyOrEmpty(md, "username")
 		ret.Username = getMetdataKeyOrEmpty(md, "username")
-		ret.Usergroup = getMetdataKeyOrEmpty(md, "password")
-
+		ret.Usergroup = getMetdataKeyOrEmpty(md, "usergroup")
 	}
 	}
 
 
 	buildUserAcls(cfg, ret)
 	buildUserAcls(cfg, ret)