Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat free form expression #1027

Merged
merged 6 commits into from
Apr 8, 2022
Merged

Feat free form expression #1027

merged 6 commits into from
Apr 8, 2022

Conversation

monde
Copy link
Collaborator

@monde monde commented Mar 18, 2022

Okta controlled branch of @cbrgm's work in #1013:

This PR adds a free form expression string as an alternative search criteria to data_source_okta_user and data_source_okta_users as discussed in #1010 .

Usage example:

data "okta_users" "foo" {
  search {
    expression = "profile.department eq \"Engineering\" and (created lt \"2014-01-01T00:00:00.000Z\" or status eq \"ACTIVE\")"
  }
}

This allows more flexible search parameters for the datasources mentioned above.

Also, adds compound_search_operator property to data source okta_user and okta_users that is used to join multiple search elements. Previously it was a hard coded AND operation.

@monde monde requested a review from bretterer March 18, 2022 00:49
@monde monde marked this pull request as draft March 18, 2022 00:52
@cbrgm
Copy link
Contributor

cbrgm commented Mar 19, 2022

I think we'd have to update the docs as well right?

data "okta_users" "example" {

  compound_search_operator = "or"

  search {
    name       = "profile.department"
    value      = "Engineering"
    comparison = "eq"
  }

  search {
    name       = "profile.department"
    value      = "Data Analytics"
    comparison = "eq"
  }
}

Arguments Reference

  • ...
  • compound_search_operator - (Optional) Search operator uses when joining mulitple search clauses.

@monde
Copy link
Collaborator Author

monde commented Mar 21, 2022

I think we'd have to update the docs as well right?

@cbrgm agreed. I put the PR into draft status as I had to turn my attention to another matter at Okta. Also, I got blocked on trying to make ConflictsWith work correctly in the schema (expression conflicts with name/value/comparison, and visa versa). I'll put some more polish into this PR.

@monde monde marked this pull request as ready for review April 7, 2022 21:34
@MikeMondragon-okta MikeMondragon-okta force-pushed the feat_free_form_expression branch 2 times, most recently from b4e97d8 to bcf7615 Compare April 8, 2022 15:02
@monde monde merged commit ffd0bb0 into master Apr 8, 2022
@monde monde deleted the feat_free_form_expression branch April 8, 2022 18:26
@monde
Copy link
Collaborator Author

monde commented Apr 8, 2022

@cbrgm this is released as v3.23.0

@cbrgm
Copy link
Contributor

cbrgm commented Apr 11, 2022

Awesome! Thanks for your great work! Really cool to see this is happening!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants