Skip to content

Commit 791a059

Browse files
committed
work on moving to the manager
1 parent f2857c6 commit 791a059

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

coderd/idpsync/idpsync.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,19 @@ type IDPSync interface {
3434
SyncOrganizations(ctx context.Context, tx database.Store, user database.User, params OrganizationParams) error
3535

3636
GroupSyncEnabled() bool
37-
// ParseGroupClaims takes claims from an OIDC provider, and returns the
38-
// group sync params for assigning users into groups.
37+
// ParseGroupClaims takes claims from an OIDC provider, and returns the params
38+
// for group syncing. Most of the logic happens in SyncGroups.
3939
ParseGroupClaims(ctx context.Context, _ jwt.MapClaims) (GroupParams, *HTTPError)
40+
41+
// SyncGroups assigns and removes users from groups based on the provided params.
42+
SyncGroups(ctx context.Context, db database.Store, user database.User, params GroupParams) error
4043
}
4144

4245
// AGPLIDPSync is the configuration for syncing user information from an external
4346
// IDP. All related code to syncing user information should be in this package.
4447
type AGPLIDPSync struct {
45-
Logger slog.Logger
48+
Logger slog.Logger
49+
Manager runtimeconfig.Manager
4650

4751
SyncSettings
4852
}
@@ -74,9 +78,10 @@ type SyncSettings struct {
7478
GroupFilter *regexp.Regexp
7579
}
7680

77-
func NewAGPLSync(logger slog.Logger, settings DeploymentSyncSettings) *AGPLIDPSync {
81+
func NewAGPLSync(logger slog.Logger, manager runtimeconfig.Manager, settings DeploymentSyncSettings) *AGPLIDPSync {
7882
return &AGPLIDPSync{
79-
Logger: logger.Named("idp-sync"),
83+
Logger: logger.Named("idp-sync"),
84+
Manager: manager,
8085
SyncSettings: SyncSettings{
8186
DeploymentSyncSettings: settings,
8287
},

0 commit comments

Comments
 (0)