Skip to content

Commit

Permalink
Merge pull request #1562 from okta/OKTA-608744-add-skip-user-skip-group
Browse files Browse the repository at this point in the history
add skip user and skip group
  • Loading branch information
duytiennguyen-okta authored May 19, 2023
2 parents 156fd08 + 17375ab commit 29d1667
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 8 deletions.
17 changes: 17 additions & 0 deletions okta/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,23 @@ var (
},
}

skipUsersAndGroupsSchema = map[string]*schema.Schema{
"skip_users": {
Type: schema.TypeBool,
Optional: true,
Description: "Ignore users sync. This is a temporary solution until 'users' field is supported in all the app-like resources",
Default: false,
Deprecated: "Because users has been removed, this attribute is a no op and will be removed",
},
"skip_groups": {
Type: schema.TypeBool,
Optional: true,
Description: "Ignore groups sync. This is a temporary solution until 'groups' field is supported in all the app-like resources",
Default: false,
Deprecated: "Because groups has been removed, this attribute is a no op and will be removed",
},
}

appVisibilitySchema = map[string]*schema.Schema{
"auto_submit_toolbar": {
Type: schema.TypeBool,
Expand Down
4 changes: 2 additions & 2 deletions okta/data_source_okta_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func dataSourceApp() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceAppRead,
Schema: map[string]*schema.Schema{
Schema: buildSchema(skipUsersAndGroupsSchema, map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -61,7 +61,7 @@ func dataSourceApp() *schema.Resource {
Description: "Users associated with the application",
Deprecated: "The `users` field is now deprecated for the data source `okta_app`, please replace all uses of this with: `okta_app_user_assignments`",
},
},
}),
}
}

Expand Down
4 changes: 2 additions & 2 deletions okta/data_source_okta_app_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func dataSourceAppOauth() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceAppOauthRead,
Schema: map[string]*schema.Schema{
Schema: buildSchema(skipUsersAndGroupsSchema, map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -140,7 +140,7 @@ func dataSourceAppOauth() *schema.Resource {
Computed: true,
Description: "Indicates if the client is allowed to use wildcard matching of redirect_uris",
},
},
}),
}
}

Expand Down
4 changes: 2 additions & 2 deletions okta/data_source_okta_app_saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func dataSourceAppSaml() *schema.Resource {
return &schema.Resource{
ReadContext: dataSourceAppSamlRead,
Schema: map[string]*schema.Schema{
Schema: buildSchema(skipUsersAndGroupsSchema, map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -279,7 +279,7 @@ func dataSourceAppSaml() *schema.Resource {
Computed: true,
Description: "SAML Signed Request enabled",
},
},
}),
}
}

Expand Down
7 changes: 7 additions & 0 deletions okta/resource_okta_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ func resourceGroup() *schema.Resource {
Optional: true,
Description: "Group description",
},
"skip_users": {
Type: schema.TypeBool,
Optional: true,
Description: "Ignore users sync. This is a temporary solution until 'users' field is supported in all the app-like resources",
Default: false,
Deprecated: "Because users has been removed, this attribute is a no op and will be removed",
},
"custom_profile_attributes": {
Type: schema.TypeString,
Optional: true,
Expand Down
1 change: 0 additions & 1 deletion okta/resource_okta_policy_rule_idp_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

// TODU
func TestAccOktaPolicyRuleIdpDiscovery_crud(t *testing.T) {
mgr := newFixtureManager(policyRuleIdpDiscovery, t.Name())
config := mgr.GetFixtures("basic.tf", t)
Expand Down
7 changes: 7 additions & 0 deletions okta/resource_okta_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ func resourceUser() *schema.Resource {
},
},
Schema: map[string]*schema.Schema{
"skip_roles": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Do not populate user roles information (prevents additional API call)",
Deprecated: "Because admin_roles has been removed, this attribute is a no op and will be removed",
},
"city": {
Type: schema.TypeString,
Optional: true,
Expand Down
1 change: 0 additions & 1 deletion okta/resource_okta_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
)

// TODU
func TestAccOktaUser_customProfileAttributes(t *testing.T) {
mgr := newFixtureManager(user, t.Name())
config := mgr.GetFixtures("custom_attributes.tf", t)
Expand Down

0 comments on commit 29d1667

Please sign in to comment.