Skip to content

Commit 0df7f28

Browse files
committed
add interface method to allow api crud
1 parent a86ba83 commit 0df7f28

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

coderd/idpsync/group.go

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ func (AGPLIDPSync) GroupSyncEnabled() bool {
2828
// AGPL does not support syncing groups.
2929
return false
3030
}
31+
func (s AGPLIDPSync) GroupSyncSettings() runtimeconfig.RuntimeEntry[*GroupSyncSettings] {
32+
return s.Group
33+
}
3134

3235
func (s AGPLIDPSync) ParseGroupClaims(_ context.Context, _ jwt.MapClaims) (GroupParams, *HTTPError) {
3336
return GroupParams{

coderd/idpsync/idpsync.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ type IDPSync interface {
3636
// ParseGroupClaims takes claims from an OIDC provider, and returns the params
3737
// for group syncing. Most of the logic happens in SyncGroups.
3838
ParseGroupClaims(ctx context.Context, mergedClaims jwt.MapClaims) (GroupParams, *HTTPError)
39-
4039
// SyncGroups assigns and removes users from groups based on the provided params.
4140
SyncGroups(ctx context.Context, db database.Store, user database.User, params GroupParams) error
41+
// GroupSyncSettings is exposed for the API to implement CRUD operations
42+
// on the settings used by IDPSync. This entry is thread safe and can be
43+
// accessed concurrently. The settings are stored in the database.
44+
GroupSyncSettings() runtimeconfig.RuntimeEntry[*GroupSyncSettings]
4245
}
4346

4447
// AGPLIDPSync is the configuration for syncing user information from an external

0 commit comments

Comments
 (0)