@@ -34,15 +34,19 @@ type IDPSync interface {
34
34
SyncOrganizations (ctx context.Context , tx database.Store , user database.User , params OrganizationParams ) error
35
35
36
36
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 .
39
39
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
40
43
}
41
44
42
45
// AGPLIDPSync is the configuration for syncing user information from an external
43
46
// IDP. All related code to syncing user information should be in this package.
44
47
type AGPLIDPSync struct {
45
- Logger slog.Logger
48
+ Logger slog.Logger
49
+ Manager runtimeconfig.Manager
46
50
47
51
SyncSettings
48
52
}
@@ -74,9 +78,10 @@ type SyncSettings struct {
74
78
GroupFilter * regexp.Regexp
75
79
}
76
80
77
- func NewAGPLSync (logger slog.Logger , settings DeploymentSyncSettings ) * AGPLIDPSync {
81
+ func NewAGPLSync (logger slog.Logger , manager runtimeconfig. Manager , settings DeploymentSyncSettings ) * AGPLIDPSync {
78
82
return & AGPLIDPSync {
79
- Logger : logger .Named ("idp-sync" ),
83
+ Logger : logger .Named ("idp-sync" ),
84
+ Manager : manager ,
80
85
SyncSettings : SyncSettings {
81
86
DeploymentSyncSettings : settings ,
82
87
},
0 commit comments