8000 feat: get and update group IdP Sync settings by aslilac · Pull Request #14647 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: get and update group IdP Sync settings #14647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Sep 16, 2024
Prev Previous commit
Next Next commit
update unit test
  • Loading branch information
Emyrk committed Sep 16, 2024
commit c8982a484104fed257fd9b92d61ff120b346170d
5 changes: 3 additions & 2 deletions enterprise/coderd/idpsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
string(codersdk.ExperimentMultiOrganization),
}

client, db, user := coderdenttest.NewWithDatabase(t, &coderdenttest.Options{
owner, db, user := coderdenttest.NewWithDatabase(t, &coderdenttest.Options{
Options: &coderdtest.Options{
DeploymentValues: dv,
},
Expand All @@ -40,14 +40,15 @@
},
},
})
orgAdmin, _ := coderdtest.CreateAnotherUser(t, owner, user.OrganizationID, rbac.ScopedRoleOrgAdmin(user.OrganizationID))

ctx := testutil.Context(t, testutil.WaitShort)
dbresv := runtimeconfig.OrganizationResolver(user.OrganizationID, runtimeconfig.NewStoreResolver(db))
entry := runtimeconfig.MustNew[*idpsync.GroupSyncSettings]("group-sync-settings")
err := entry.SetRuntimeValue(dbauthz.AsSystemRestricted(ctx), dbresv, &idpsync.GroupSyncSettings{Field: "august"})

Check failure on line 48 in enterprise/coderd/idpsync_test.go

View workflow job for this annotation

GitHub Actions / lint

ruleguard: Using 'AsSystemRestricted' is dangerous and should be accompanied by a comment explaining why it's ok and a nolint. (gocritic)
require.NoError(t, err)

settings, err := client.GroupIDPSyncSettings(ctx, user.OrganizationID.String())
settings, err := orgAdmin.GroupIDPSyncSettings(ctx, user.OrganizationID.String())
require.NoError(t, err)
require.Equal(t, "august", settings.Field)
})
Expand Down
Loading
0