diff --git a/examples/okta_group_rule/datasource.tf b/examples/okta_group_rule/datasource.tf new file mode 100644 index 000000000..cd85ef6d3 --- /dev/null +++ b/examples/okta_group_rule/datasource.tf @@ -0,0 +1,24 @@ +resource "okta_group" "test" { + name = "testAcc_replace_with_uuid" +} + +resource "okta_group_rule" "test" { + name = "testAcc_replace_with_uuid" + status = "ACTIVE" + group_assignments = [okta_group.test.id] + expression_type = "urn:okta:expression:1.0" + expression_value = "String.startsWith(user.firstName,\"andy\")" +} + +# This example is for syntax purposes only. If it was actually run +# data.okta_group_rule.test_by_id would fail because okta_group_rule.test +# wouldn't be in the search index yet. The data source implementation relies on +# a group rule search function in the Okta API + +data "okta_group_rule" "test_by_id" { + id = okta_group_rule.test.id +} + +data "okta_group_rule" "test_by_name" { + name = "testAcc_replace_with_uuid" +} diff --git a/okta/data_source_okta_group_rule.go b/okta/data_source_okta_group_rule.go new file mode 100644 index 000000000..3eca34c1b --- /dev/null +++ b/okta/data_source_okta_group_rule.go @@ -0,0 +1,100 @@ +package okta + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/okta/terraform-provider-okta/sdk" + "github.com/okta/terraform-provider-okta/sdk/query" +) + +func dataSourceGroupRule() *schema.Resource { + return &schema.Resource{ + ReadContext: dataSourceGroupRuleRead, + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"name"}, + }, + "name": { + Type: schema.TypeString, + Optional: true, + }, + "group_assignments": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "expression_type": { + Type: schema.TypeString, + Computed: true, + }, + "expression_value": { + Type: schema.TypeString, + Computed: true, + }, + "status": statusSchema, + "users_excluded": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + } +} + +func dataSourceGroupRuleRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + var rule *sdk.GroupRule + ruleID, idOk := d.GetOk("id") + if idOk { + respRule, _, err := getOktaClientFromMetadata(m).Group.GetGroupRule(ctx, ruleID.(string), nil) + if err != nil { + return diag.Errorf("failed get group rule by ID: %v", err) + } + rule = respRule + } else { + ruleName, nameOk := d.GetOk("name") + if nameOk { + var name = ruleName.(string) + searchParams := &query.Params{Search: name, Limit: 1} + rules, _, err := getOktaClientFromMetadata(m).Group.ListGroupRules(ctx, searchParams) + switch { + case err != nil: + return diag.Errorf("failed to get group rule by name: %v", err) + case len(rules) < 1: + return diag.Errorf("group rule with name '%s' does not exist", name) + } + // exact name search should only return one result, but loop through to be safe + for _, ruleCandidate := range rules { + if ruleName == ruleCandidate.Name { + rule = ruleCandidate + break + } + } + } + } + + if rule == nil { + return diag.Errorf("config must provide 'name' or 'id' to retrieve a group rule") + } + + d.SetId(rule.Id) + _ = d.Set("name", rule.Name) + _ = d.Set("status", rule.Status) + if rule.Conditions != nil { + _ = d.Set("expression_type", rule.Conditions.Expression.Type) + _ = d.Set("expression_value", rule.Conditions.Expression.Value) + } + if rule.Conditions.People != nil && rule.Conditions.People.Users != nil { + _ = d.Set("users_excluded", convertStringSliceToSet(rule.Conditions.People.Users.Exclude)) + } + err := setNonPrimitives(d, map[string]interface{}{ + "group_assignments": convertStringSliceToSet(rule.Actions.AssignUserToGroups.GroupIds), + }) + if err != nil { + return diag.Errorf("failed to set group rule properties: %v", err) + } + return nil +} diff --git a/okta/data_source_okta_group_rule_test.go b/okta/data_source_okta_group_rule_test.go new file mode 100644 index 000000000..45abecffa --- /dev/null +++ b/okta/data_source_okta_group_rule_test.go @@ -0,0 +1,73 @@ +package okta + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccOktaDataSourceGroupRule_read(t *testing.T) { + mgr := newFixtureManager(groupRule, t.Name()) + step1config := groupAndRule + step2config := fmt.Sprintf("%s%s", groupAndRule, groupRuleDataSources) + + oktaResourceTest(t, resource.TestCase{ + PreCheck: testAccPreCheck(t), + ErrorCheck: testAccErrorChecks(t), + ProviderFactories: testAccProvidersFactories, + Steps: []resource.TestStep{ + { + Config: mgr.ConfigReplace(step1config), + }, + { + Config: mgr.ConfigReplace(step2config), + Check: resource.ComposeTestCheckFunc( + // hack for eventual consistency on the group rule creation on Okta API side + sleepInSecondsForTest(2), + + resource.TestCheckResourceAttrSet("data.okta_group_rule.test_by_id", "id"), + resource.TestCheckResourceAttr("data.okta_group_rule.test_by_id", "name", fmt.Sprintf("testAccTwo_%d", mgr.Seed)), + resource.TestCheckResourceAttr("data.okta_group_rule.test_by_id", "status", "ACTIVE"), + + resource.TestCheckResourceAttrSet("data.okta_group_rule.test_by_name", "id"), + resource.TestCheckResourceAttr("data.okta_group_rule.test_by_name", "name", fmt.Sprintf("testAccTwo_%d", mgr.Seed)), + resource.TestCheckResourceAttr("data.okta_group_rule.test_by_name", "status", "ACTIVE"), + ), + }, + }, + }) +} + +const groupAndRule = ` +resource "okta_group" "test" { + name = "testAcc_replace_with_uuid" +} + +resource "okta_group_rule" "test1" { + name = "testAccOne_replace_with_uuid" + status = "ACTIVE" + group_assignments = [okta_group.test.id] + expression_type = "urn:okta:expression:1.0" + expression_value = "String.startsWith(user.firstName,\"andy\")" +} + +resource "okta_group_rule" "test2" { + name = "testAccTwo_replace_with_uuid" + status = "ACTIVE" + group_assignments = [okta_group.test.id] + expression_type = "urn:okta:expression:1.0" + expression_value = "String.startsWith(user.firstName,\"andy\")" + depends_on = [okta_group_rule.test1] +} +` + +const groupRuleDataSources = ` +data "okta_group_rule" "test_by_id" { + id = okta_group_rule.test2.id +} + +data "okta_group_rule" "test_by_name" { + name = "testAccTwo_replace_with_uuid" +} +` diff --git a/okta/provider.go b/okta/provider.go index 7e1177cd9..3df253532 100644 --- a/okta/provider.go +++ b/okta/provider.go @@ -368,6 +368,7 @@ func Provider() *schema.Provider { defaultPolicy: dataSourceDefaultPolicy(), group: dataSourceGroup(), groupEveryone: dataSourceEveryoneGroup(), + groupRule: dataSourceGroupRule(), groups: dataSourceGroups(), idpMetadataSaml: dataSourceIdpMetadataSaml(), idpOidc: dataSourceIdpOidc(), diff --git a/okta/utils_for_test.go b/okta/utils_for_test.go index fc8f3159e..321d00dc0 100644 --- a/okta/utils_for_test.go +++ b/okta/utils_for_test.go @@ -5,6 +5,7 @@ import ( "os" "strings" "testing" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -204,3 +205,12 @@ func testAttributeJSON(name, attribute, expectedJSON string) resource.TestCheckF return nil } } + +// sleepInSecondsForTest Add sleep in a test to allow for eventual consistency +// thanks github.com/hashicorp/terraform-provider-google/google/provider_test.go +func sleepInSecondsForTest(t int) resource.TestCheckFunc { + return func(s *terraform.State) error { + time.Sleep(time.Duration(t) * time.Second) + return nil + } +} diff --git a/test/fixtures/vcr/TestAccOktaDataSourceGroupRule_read/mm-oie-2022-10-07-max.yaml b/test/fixtures/vcr/TestAccOktaDataSourceGroupRule_read/mm-oie-2022-10-07-max.yaml new file mode 100644 index 000000000..901275368 --- /dev/null +++ b/test/fixtures/vcr/TestAccOktaDataSourceGroupRule_read/mm-oie-2022-10-07-max.yaml @@ -0,0 +1,1238 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/ + method: GET + response: + body: '[]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:57 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/ + method: GET + response: + body: '[]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:57 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/ + method: GET + response: + body: '[]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:57 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/ + method: GET + response: + body: '[]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:57 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: | + {"profile":{"name":"testAcc_3778815348","description":""}} + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + Content-Type: + - application/json + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups + method: POST + response: + body: '{"id":"00g8qs3uepusR3UIA1d7","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:58.000Z","lastMembershipUpdated":"2023-06-29T21:55:58.000Z","objectClass":["okta:user_group"],"type":"OKTA_GROUP","profile":{"name":"testAcc_3778815348","description":""},"_links":{"logo":[{"name":"medium","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-medium.1a5ebe44c4244fb796c235d86b47e3bb.png","type":"image/png"},{"name":"large","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-large.d9cfbd8a00a4feac1aa5612ba02e99c0.png","type":"image/png"}],"users":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/users"},"apps":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/apps"}}}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7 + method: GET + response: + body: '{"id":"00g8qs3uepusR3UIA1d7","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:58.000Z","lastMembershipUpdated":"2023-06-29T21:55:58.000Z","objectClass":["okta:user_group"],"type":"OKTA_GROUP","profile":{"name":"testAcc_3778815348","description":""},"_links":{"logo":[{"name":"medium","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-medium.1a5ebe44c4244fb796c235d86b47e3bb.png","type":"image/png"},{"name":"large","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-large.d9cfbd8a00a4feac1aa5612ba02e99c0.png","type":"image/png"}],"users":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/users"},"apps":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/apps"}}}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7 + method: GET + response: + body: '{"id":"00g8qs3uepusR3UIA1d7","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:58.000Z","lastMembershipUpdated":"2023-06-29T21:55:58.000Z","objectClass":["okta:user_group"],"type":"OKTA_GROUP","profile":{"name":"testAcc_3778815348","description":""},"_links":{"logo":[{"name":"medium","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-medium.1a5ebe44c4244fb796c235d86b47e3bb.png","type":"image/png"},{"name":"large","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-large.d9cfbd8a00a4feac1aa5612ba02e99c0.png","type":"image/png"}],"users":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/users"},"apps":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/apps"}}}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/ + method: GET + response: + body: '[]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: | + {"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"conditions":{"expression":{"type":"urn:okta:expression:1.0","value":"String.startsWith(user.firstName,\"andy\")"},"people":{"users":{}}},"name":"testAccOne_3778815348","type":"group_rule"} + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + Content-Type: + - application/json + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules + method: POST + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"INACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7/lifecycle/activate + method: POST + response: + body: "" + headers: + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/ + method: GET + response: + body: '[{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:58.000Z","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: | + {"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"conditions":{"expression":{"type":"urn:okta:expression:1.0","value":"String.startsWith(user.firstName,\"andy\")"},"people":{"users":{}}},"name":"testAccTwo_3778815348","type":"group_rule"} + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + Content-Type: + - application/json + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules + method: POST + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"INACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:58 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7/lifecycle/activate + method: POST + response: + body: "" + headers: + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7 + method: GET + response: + body: '{"id":"00g8qs3uepusR3UIA1d7","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:58.000Z","lastMembershipUpdated":"2023-06-29T21:55:58.000Z","objectClass":["okta:user_group"],"type":"OKTA_GROUP","profile":{"name":"testAcc_3778815348","description":""},"_links":{"logo":[{"name":"medium","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-medium.1a5ebe44c4244fb796c235d86b47e3bb.png","type":"image/png"},{"name":"large","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-large.d9cfbd8a00a4feac1aa5612ba02e99c0.png","type":"image/png"}],"users":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/users"},"apps":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/apps"}}}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:55:59 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7 + method: GET + response: + body: '{"id":"00g8qs3uepusR3UIA1d7","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:58.000Z","lastMembershipUpdated":"2023-06-29T21:55:58.000Z","objectClass":["okta:user_group"],"type":"OKTA_GROUP","profile":{"name":"testAcc_3778815348","description":""},"_links":{"logo":[{"name":"medium","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-medium.1a5ebe44c4244fb796c235d86b47e3bb.png","type":"image/png"},{"name":"large","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-large.d9cfbd8a00a4feac1aa5612ba02e99c0.png","type":"image/png"}],"users":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/users"},"apps":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/apps"}}}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules?limit=1&search=testAccTwo_3778815348 + method: GET + response: + body: '[{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:59.000Z","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:00 GMT + Report-To: + - '{"group":"csp","max_age":31536000,"endpoints":[{"url":"https://oktacsp.report-uri.com/a/t/g"}],"include_subdomains":true}' + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules?limit=1&search=testAccTwo_3778815348 + method: GET + response: + body: '[{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:59.000Z","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:01 GMT + Link: + - ; rel="self" + Report-To: + - '{"group":"csp","max_age":31536000,"endpoints":[{"url":"https://oktacsp.report-uri.com/a/t/g"}],"include_subdomains":true}' + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:01 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:01 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:01 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:03 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules?limit=1&search=testAccTwo_3778815348 + method: GET + response: + body: '[{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:59.000Z","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:03 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:03 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:03 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7 + method: GET + response: + body: '{"id":"00g8qs3uepusR3UIA1d7","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:58.000Z","lastMembershipUpdated":"2023-06-29T21:55:58.000Z","objectClass":["okta:user_group"],"type":"OKTA_GROUP","profile":{"name":"testAcc_3778815348","description":""},"_links":{"logo":[{"name":"medium","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-medium.1a5ebe44c4244fb796c235d86b47e3bb.png","type":"image/png"},{"name":"large","href":"https://op3static.oktacdn.com/assets/img/logos/groups/odyssey/okta-large.d9cfbd8a00a4feac1aa5612ba02e99c0.png","type":"image/png"}],"users":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/users"},"apps":{"href":"https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7/apps"}}}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:03 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules?limit=1&search=testAccTwo_3778815348 + method: GET + response: + body: '[{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:59.000Z","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:03 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qs4g5oRdsGtUT1d7","status":"ACTIVE","name":"testAccOne_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules?limit=1&search=testAccTwo_3778815348 + method: GET + response: + body: '[{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","created":"2023-06-29T21:55:58.000Z","lastUpdated":"2023-06-29T21:55:59.000Z","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}]' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + Link: + - ; rel="self" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7 + method: GET + response: + body: '{"type":"group_rule","id":"0pr8qsafyrEdD4iJO1d7","status":"ACTIVE","name":"testAccTwo_3778815348","conditions":{"people":{"users":{"exclude":[]},"groups":{"exclude":[]}},"expression":{"value":"String.startsWith(user.firstName,\"andy\")","type":"urn:okta:expression:1.0"}},"actions":{"assignUserToGroups":{"groupIds":["00g8qs3uepusR3UIA1d7"]}},"allGroupsValid":true}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7/lifecycle/deactivate + method: POST + response: + body: "" + headers: + Date: + - Thu, 29 Jun 2023 21:56:04 GMT + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qsafyrEdD4iJO1d7?removeUsers=false + method: DELETE + response: + body: '{}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:05 GMT + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7/lifecycle/deactivate + method: POST + response: + body: "" + headers: + Date: + - Thu, 29 Jun 2023 21:56:05 GMT + status: 204 No Content + code: 204 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/rules/0pr8qs4g5oRdsGtUT1d7?removeUsers=false + method: DELETE + response: + body: '{}' + headers: + Content-Type: + - application/json + Date: + - Thu, 29 Jun 2023 21:56:05 GMT + status: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Authorization: + - SSWS REDACTED + User-Agent: + - okta-sdk-golang/2.17.0 golang/go1.20.4 darwin/amd64 okta-terraform/4.0.3 + url: https://mm-oie-2022-10-07-max.oktapreview.com/api/v1/groups/00g8qs3uepusR3UIA1d7 + method: DELETE + response: + body: "" + headers: + Date: + - Thu, 29 Jun 2023 21:56:05 GMT + status: 204 No Content + code: 204 + duration: "" diff --git a/website/docs/d/group_rule.html.markdown b/website/docs/d/group_rule.html.markdown new file mode 100644 index 000000000..543883046 --- /dev/null +++ b/website/docs/d/group_rule.html.markdown @@ -0,0 +1,39 @@ +--- +layout: "okta" +page_title: "Okta: okta_group_rule" +sidebar_current: "docs-okta-datasource-group-rule" +description: |- Get a group rule from Okta. +--- + +# okta_group_rule + +Use this data source to retrieve a group rule from Okta. + +## Example Usage + +```hcl +data "okta_group_rule" "test" { + id = okta_group_rule.example.id +} +``` + +## Arguments Reference + +- `id` - (Optional) The ID of the group rule to retrieve. +- `name` - (Optional) The name of the Group Rule to retrieve. + +## Attributes Reference + +- `id` - The ID of the Group Rule. + +- `name` - The name of the Group Rule. + +- `group_assignments` - The list of group ids to assign the users to. + +- `expression_type` - The expression type to use to invoke the rule. + +- `expression_value` - The expression value. + +- `status` - The status of the group rule. + +- `users_excluded` - The list of user IDs that would be excluded when rules are processed. diff --git a/website/okta.erb b/website/okta.erb index dffcc675b..5f80b07c5 100644 --- a/website/okta.erb +++ b/website/okta.erb @@ -70,6 +70,9 @@ > okta_group + > + okta_group_rule + > okta_groups