feat: add group allowlist for oidc (#11070)

* feat: group allow list in OIDC settings
This commit is contained in:
Steven Masley
2023-12-08 10:14:19 -06:00
committed by GitHub
parent cb89bc1729
commit 78517cab52
14 changed files with 141 additions and 5 deletions
+11
View File
@@ -291,6 +291,7 @@ type OIDCConfig struct {
IgnoreUserInfo clibase.Bool `json:"ignore_user_info" typescript:",notnull"`
GroupAutoCreate clibase.Bool `json:"group_auto_create" typescript:",notnull"`
GroupRegexFilter clibase.Regexp `json:"group_regex_filter" typescript:",notnull"`
GroupAllowList clibase.StringArray `json:"group_allow_list" typescript:",notnull"`
GroupField clibase.String `json:"groups_field" typescript:",notnull"`
GroupMapping clibase.Struct[map[string]string] `json:"group_mapping" typescript:",notnull"`
UserRoleField clibase.String `json:"user_role_field" typescript:",notnull"`
@@ -1187,6 +1188,16 @@ when required by your organization's security policy.`,
Group: &deploymentGroupOIDC,
YAML: "groupRegexFilter",
},
{
Name: "OIDC Allowed Groups",
Description: "If provided any group name not in the list will not be allowed to authenticate. This allows for restricting access to a specific set of groups. This filter is applied after the group mapping and before the regex filter.",
Flag: "oidc-allowed-groups",
Env: "CODER_OIDC_ALLOWED_GROUPS",
Default: "",
Value: &c.OIDC.GroupAllowList,
Group: &deploymentGroupOIDC,
YAML: "groupAllowed",
},
{
Name: "OIDC User Role Field",
Description: "This field must be set if using the user roles sync feature. Set this to the name of the claim used to store the user's role. The roles should be sent as an array of strings.",