AuthN: Make client params part of the identity (#61050)

* AuthN: Change client params to be a return value of authenticate

* AuthN: move client params to be part of the identity
This commit is contained in:
Karl Persson
2023-01-05 20:17:41 +01:00
committed by GitHub
parent 183397194a
commit cdd7392f68
14 changed files with 91 additions and 128 deletions
@@ -50,9 +50,8 @@ func TestOrgSync_SyncOrgUser(t *testing.T) {
log log.Logger
}
type args struct {
ctx context.Context
clientParams *authn.ClientParams
id *authn.Identity
ctx context.Context
id *authn.Identity
}
tests := []struct {
name string
@@ -71,9 +70,6 @@ func TestOrgSync_SyncOrgUser(t *testing.T) {
},
args: args{
ctx: context.Background(),
clientParams: &authn.ClientParams{
SyncUser: true,
},
id: &authn.Identity{
ID: "user:1",
Login: "test",
@@ -86,6 +82,9 @@ func TestOrgSync_SyncOrgUser(t *testing.T) {
Email: ptrString("test"),
Login: nil,
},
ClientParams: authn.ClientParams{
SyncUser: true,
},
},
},
wantID: &authn.Identity{
@@ -101,6 +100,9 @@ func TestOrgSync_SyncOrgUser(t *testing.T) {
Email: ptrString("test"),
Login: nil,
},
ClientParams: authn.ClientParams{
SyncUser: true,
},
},
wantErr: false,
},
@@ -113,7 +115,7 @@ func TestOrgSync_SyncOrgUser(t *testing.T) {
accessControl: tt.fields.accessControl,
log: tt.fields.log,
}
if err := s.SyncOrgUser(tt.args.ctx, tt.args.clientParams, tt.args.id, nil); (err != nil) != tt.wantErr {
if err := s.SyncOrgUser(tt.args.ctx, tt.args.id, nil); (err != nil) != tt.wantErr {
t.Errorf("OrgSync.SyncOrgUser() error = %v, wantErr %v", err, tt.wantErr)
}