Skip to content

Commit 6011963

Browse files
committed
hmm.
1 parent 26e7bdd commit 6011963

File tree

10 files changed

+501
-38
lines changed

10 files changed

+501
-38
lines changed

coderd/apidoc/docs.go

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/idpsync/group.go

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7-
"regexp"
87

98
"github.com/golang-jwt/jwt/v4"
109
"github.com/google/uuid"
@@ -16,6 +15,7 @@ import (
1615
"github.com/coder/coder/v2/coderd/database/dbauthz"
1716
"github.com/coder/coder/v2/coderd/runtimeconfig"
1817
"github.com/coder/coder/v2/coderd/util/slice"
18+
"github.com/coder/coder/v2/codersdk"
1919
)
2020

2121
type GroupParams struct {
@@ -94,10 +94,12 @@ func (s AGPLIDPSync) SyncGroups(ctx context.Context, db database.Store, user dat
9494
// Legacy deployment settings will override empty settings.
9595
if orgID == defaultOrgID && settings.Field == "" {
9696
settings = &GroupSyncSettings{
97-
Field: s.Legacy.GroupField,
98-
LegacyNameMapping: s.Legacy.GroupMapping,
99-
RegexFilter: s.Legacy.GroupFilter,
100-
AutoCreateMissing: s.Legacy.CreateMissingGroups,
97+
GroupSyncSettings: codersdk.GroupSyncSettings{
98+
Field: s.Legacy.GroupField,
99+
LegacyNameMapping: s.Legacy.GroupMapping,
100+
RegexFilter: s.Legacy.GroupFilter,
101+
AutoCreateMissing: s.Legacy.CreateMissingGroups,
102+
},
101103
}
102104
}
103105
orgSettings[orgID] = *settings
@@ -240,25 +242,7 @@ func (s AGPLIDPSync) ApplyGroupDifference(ctx context.Context, tx database.Store
240242
}
241243

242244
type GroupSyncSettings struct {
243-
// Field selects the claim field to be used as the created user's
244-
// groups. If the group field is the empty string, then no group updates
245-
// will ever come from the OIDC provider.
246-
Field string `json:"field"`
247-
// Mapping maps from an OIDC group --> Coder group ID
248-
Mapping map[string][]uuid.UUID `json:"mapping"`
249-
// RegexFilter is a regular expression that filters the groups returned by
250-
// the OIDC provider. Any group not matched by this regex will be ignored.
251-
// If the group filter is nil, then no group filtering will occur.
252-
RegexFilter *regexp.Regexp `json:"regex_filter"`
253-
// AutoCreateMissing controls whether groups returned by the OIDC provider
254-
// are automatically created in Coder if they are missing.
255-
AutoCreateMissing bool `json:"auto_create_missing_groups"`
256-
// LegacyNameMapping is deprecated. It remaps an IDP group name to
257-
// a Coder group name. Since configuration is now done at runtime,
258-
// group IDs are used to account for group renames.
259-
// For legacy configurations, this config option has to remain.
260-
// Deprecated: Use Mapping instead.
261-
LegacyNameMapping map[string]string `json:"legacy_group_name_mapping,omitempty"`
245+
codersdk.GroupSyncSettings
262246
}
263247

264248
func (s *GroupSyncSettings) Set(v string) error {

0 commit comments

Comments
 (0)