-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1081 from okta/fix_cso
Fix for v3.25.1 release
- Loading branch information
Showing
12 changed files
with
77 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
data "okta_users" "compound_search" { | ||
compound_search_operator = "and" | ||
|
||
search { | ||
name = "profile.firstName" | ||
value = "TestAcc" | ||
} | ||
|
||
search { | ||
name = "profile.lastName" | ||
value = "Jones" | ||
} | ||
|
||
search { | ||
name = "profile.email" | ||
comparison = "pr" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ var userSearchSchemaDescription = "Filter to find " + | |
"must match what is in Okta, which is likely camel case. " + | ||
"Expression is a free form expression filter " + | ||
"https://developer.okta.com/docs/reference/core-okta-api/#filter . " + | ||
"The set name/value/comparision properties will be ignored if expression is present" | ||
"The set name/value/comparison properties will be ignored if expression is present" | ||
|
||
var userSearchSchema = map[string]*schema.Schema{ | ||
"name": { | ||
|
@@ -30,10 +30,9 @@ var userSearchSchema = map[string]*schema.Schema{ | |
Optional: true, | ||
}, | ||
"comparison": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "eq", | ||
ValidateDiagFunc: elemInSlice([]string{"eq", "lt", "gt", "sw"}), | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: "eq", | ||
}, | ||
"expression": { | ||
Type: schema.TypeString, | ||
|
@@ -76,7 +75,7 @@ func dataSourceUser() *schema.Resource { | |
Optional: true, | ||
Default: "and", | ||
ValidateDiagFunc: elemInSlice([]string{"and", "or"}), | ||
Description: "Search operator uses when joining mulitple search clauses", | ||
Description: "Search operator used when joining mulitple search clauses", | ||
}, | ||
}), | ||
} | ||
|
@@ -148,7 +147,15 @@ func getSearchCriteria(d *schema.ResourceData) string { | |
filterList[i] = fmt.Sprintf(`%s`, fmap["expression"]) | ||
continue | ||
} | ||
filterList[i] = fmt.Sprintf(`%s %s "%s"`, fmap["name"], fmap["comparison"], fmap["value"]) | ||
|
||
// Need to set up the filter clause to allow comparions that do not | ||
// accept a right hand argument and those that do. | ||
// profile.email pr | ||
filterList[i] = fmt.Sprintf(`%s %s`, fmap["name"], fmap["comparison"]) | ||
if fmap["value"] != "" { | ||
// profile.email eq "[email protected]" | ||
filterList[i] = fmt.Sprintf(`%s "%s"`, filterList[i], fmap["value"]) | ||
} | ||
} | ||
|
||
operator := " and " | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters