Auth: Add disable of team sync for JWT Authentication (#62191)

* fix: disable team sync for JWT Authentication

* add: comment to test

* change test to conform to new expected behavior

* fix: spelling

* formatting
This commit is contained in:
Eric Leijonmarck
2023-01-27 16:05:25 +01:00
committed by GitHub
parent df2db3bb23
commit 5531e22f46
6 changed files with 39 additions and 10 deletions
+3 -2
View File
@@ -69,8 +69,9 @@ func (s *JWT) Authenticate(ctx context.Context, r *authn.Request) (*authn.Identi
AuthID: sub,
OrgRoles: map[int64]org.RoleType{},
ClientParams: authn.ClientParams{
SyncUser: true,
SyncTeamMembers: true,
SyncUser: true,
// We do not allow team member sync from JWT Authentication
SyncTeamMembers: false,
AllowSignUp: s.cfg.JWTAuthAutoSignUp,
EnableDisabledUsers: false,
}}
+1 -1
View File
@@ -49,9 +49,9 @@ func TestAuthenticateJWT(t *testing.T) {
IsDisabled: false,
HelpFlags1: 0,
ClientParams: authn.ClientParams{
SyncTeamMembers: false,
SyncUser: true,
AllowSignUp: true,
SyncTeamMembers: true,
LookUpParams: models.UserLookupParams{
UserID: nil,
Email: stringPtr("eai.doe@cor.po"),