Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6785789

Browse files
committed
🧹
1 parent26e7bdd commit6785789

File tree

10 files changed

+503
-38
lines changed

10 files changed

+503
-38
lines changed

‎coderd/apidoc/docs.go

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing 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 aboutcustomizing how changed files appear on GitHub.

‎coderd/idpsync/group.go

Lines changed: 6 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"
@@ -15,7 +14,9 @@ import (
1514
"github.com/coder/coder/v2/coderd/database/db2sdk"
1615
"github.com/coder/coder/v2/coderd/database/dbauthz"
1716
"github.com/coder/coder/v2/coderd/runtimeconfig"
17+
"github.com/coder/coder/v2/coderd/util/ptr"
1818
"github.com/coder/coder/v2/coderd/util/slice"
19+
"github.com/coder/coder/v2/codersdk"
1920
)
2021

2122
typeGroupParamsstruct {
@@ -28,6 +29,7 @@ func (AGPLIDPSync) GroupSyncEnabled() bool {
2829
// AGPL does not support syncing groups.
2930
returnfalse
3031
}
32+
3133
func (sAGPLIDPSync)GroupSyncSettings() runtimeconfig.RuntimeEntry[*GroupSyncSettings] {
3234
returns.Group
3335
}
@@ -93,12 +95,12 @@ func (s AGPLIDPSync) SyncGroups(ctx context.Context, db database.Store, user dat
9395

9496
// Legacy deployment settings will override empty settings.
9597
iforgID==defaultOrgID&&settings.Field=="" {
96-
settings=&GroupSyncSettings{
98+
settings=ptr.Ref(GroupSyncSettings(codersdk.GroupSyncSettings{
9799
Field:s.Legacy.GroupField,
98100
LegacyNameMapping:s.Legacy.GroupMapping,
99101
RegexFilter:s.Legacy.GroupFilter,
100102
AutoCreateMissing:s.Legacy.CreateMissingGroups,
101-
}
103+
}))
102104
}
103105
orgSettings[orgID]=*settings
104106
}
@@ -239,27 +241,7 @@ func (s AGPLIDPSync) ApplyGroupDifference(ctx context.Context, tx database.Store
239241
returnnil
240242
}
241243

242-
typeGroupSyncSettingsstruct {
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-
Fieldstring`json:"field"`
247-
// Mapping maps from an OIDC group --> Coder group ID
248-
Mappingmap[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-
AutoCreateMissingbool`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-
LegacyNameMappingmap[string]string`json:"legacy_group_name_mapping,omitempty"`
262-
}
244+
typeGroupSyncSettings codersdk.GroupSyncSettings
263245

264246
func (s*GroupSyncSettings)Set(vstring)error {
265247
returnjson.Unmarshal([]byte(v),s)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp