8000 chore: support multi-org group sync with runtime configuration by Emyrk · Pull Request #14578 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: support multi-org group sync with runtime configuration #14578

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 38 commits into from
Sep 11, 2024
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
99c97c2
wip
Emyrk Sep 3, 2024
bfddeb6
begin group sync main work
Emyrk Sep 3, 2024
f2857c6
initial implementation of group sync
Emyrk Sep 3, 2024
791a059
work on moving to the manager
Emyrk Sep 4, 2024
4326e9d
fixup compile issues
Emyrk Sep 4, 2024
6d3ed2e
fixup some tests
Emyrk Sep 4, 2024
0803619
handle allow list
Emyrk Sep 4, 2024
596e7b4
WIP unit test for group sync
Emyrk Sep 4, 2024
b9476ac
fixup tests, account for existing groups
Emyrk Sep 4, 2024
ee8e4e4
fix compile issues
Emyrk Sep 5, 2024
d5ff0f7
add comment for test helper
Emyrk Sep 5, 2024
86c0f6f
handle legacy params
Emyrk Sep 5, 2024
2f03e18
make gen
Emyrk Sep 5, 2024
ec8092d
cleanup
Emyrk Sep 5, 2024
d63727d
add unit test for legacy behavior
Emyrk Sep 5, 2024
2a1769c
work on batching removal by name or id
Emyrk Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup compile issues
  • Loading branch information
Emyrk committed Sep 9, 2024
commit 4326e9d94af1915ac1d109e72f808ed9cb3acd5c
4 changes: 1 addition & 3 deletions coderd/idpsync/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/db2sdk"
"github.com/coder/coder/v2/coderd/database/dbauthz"
"github.com/coder/coder/v2/coderd/runtimeconfig"
"github.com/coder/coder/v2/coderd/util/slice"
)

Expand Down Expand Up @@ -44,7 +43,6 @@ func (s AGPLIDPSync) SyncGroups(ctx context.Context, db database.Store, user dat
ctx = dbauthz.AsSystemRestricted(ctx)

db.InTx(func(tx database.Store) error {
resolver := runtimeconfig.NewStoreResolver(tx)
userGroups, err := tx.GetGroups(ctx, database.GetGroupsParams{
HasMemberID: user.ID,
})
Expand All @@ -62,7 +60,7 @@ func (s AGPLIDPSync) SyncGroups(ctx context.Context, db database.Store, user dat
// For each org, we need to fetch the sync settings
orgSettings := make(map[uuid.UUID]GroupSyncSettings)
for orgID := range userOrgs {
orgResolver := runtimeconfig.NewOrgResolver(orgID, resolver)
orgResolver := s.Manager.Scoped(orgID.String())
settings, err := s.SyncSettings.Group.Resolve(ctx, orgResolver)
if err != nil {
return xerrors.Errorf("resolve group sync settings: %w", err)
Expand Down
0