Skip to content

Commit 283e3cc

Browse files
authored
feat: add group_sync and role_sync for coderd_organization_resource (#147)
1 parent dedb7d0 commit 283e3cc

File tree

4 files changed

+377
-1
lines changed

4 files changed

+377
-1
lines changed

docs/resources/organization.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,33 @@ An organization on the Coder deployment
2323

2424
- `description` (String)
2525
- `display_name` (String) Display name of the organization. Defaults to name.
26+
- `group_sync` (Block, Optional) (see [below for nested schema](#nestedblock--group_sync))
2627
- `icon` (String)
28+
- `role_sync` (Block, Optional) (see [below for nested schema](#nestedblock--role_sync))
2729

2830
### Read-Only
2931

3032
- `id` (String) Organization ID
3133

34+
<a id="nestedblock--group_sync"></a>
35+
### Nested Schema for `group_sync`
36+
37+
Optional:
38+
39+
- `auto_create_missing` (Boolean) Controls whether groups will be created if they are missing.
40+
- `field` (String) The claim field that specifies what groups a user should be in.
41+
- `mapping` (Map of List of String) A map from OIDC group name to Coder group ID.
42+
- `regex_filter` (String) A regular expression that will be used to filter the groups returned by the OIDC provider. Any group not matched will be ignored.
43+
44+
45+
<a id="nestedblock--role_sync"></a>
46+
### Nested Schema for `role_sync`
47+
48+
Optional:
49+
50+
- `field` (String) The claim field that specifies what organization roles a user should be given.
51+
- `mapping` (Map of List of String) A map from OIDC group name to Coder organization role.
52+
3253
## Import
3354

3455
Import is supported using the following syntax:

internal/codersdkvalidator/regex.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package codersdkvalidator
2+
3+
import (
4+
"regexp"
5+
6+
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
7+
)
8+
9+
func checkRegexp(it string) error {
10+
_, err := regexp.Compile("")
11+
return err
12+
}
13+
14+
func Regexp() validator.String {
15+
return validatorFromFunc(checkRegexp, "value must be a valid regexp")
16+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy