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>
This commit is contained in:
Bernard Crnković 2023-01-11 21:41:52 +01:00 committed by GitHub
parent e18df74d5a
commit b6196a4b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

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