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

Update data_source_okta_policy.go #1445

Merged
merged 2 commits into from
Feb 8, 2023
Merged

Update data_source_okta_policy.go #1445

merged 2 commits into from
Feb 8, 2023

Conversation

monde
Copy link
Collaborator

@monde monde commented Feb 8, 2023

We shouldn't be blocking with isClassicOrg on the GET for a policy as https://developer.okta.com/docs/reference/api/policy/#policy-object documents there are 7 policy types and only two of them are for OIE. And we shouldn't be blocking with a validation function. Let the operator choose their type and have the API return any errors instead of artificially checking here.

All

  • OKTA_SIGN_ON
  • PASSWORD
  • MFA_ENROLL
  • OAUTH_AUTHORIZATION_POLICY
  • IDP_DISCOVERY

Identity Engine

  • ACCESS_POLICY
  • PROFILE_ENROLLMENT

Passing OIE org:

$ TF_ACC=1 go test -tags unit -mod=readonly -test.v -run ^TestAccOktaDataSourcePolicy_read$ ./okta 2>&1
2023/02/08 11:20:04 [INFO]  running with default http client
=== RUN   TestAccOktaDataSourcePolicy_read
--- PASS: TestAccOktaDataSourcePolicy_read (6.07s)
PASS
ok      github.com/okta/terraform-provider-okta/okta    6.513s

Passing Classic org

$ TF_ACC=1 go test -tags unit -mod=readonly -test.v -run ^TestAccOktaDataSourcePolicy_read$ ./okta 2>&1
2023/02/08 11:20:29 [INFO]  running with default http client
=== RUN   TestAccOktaDataSourcePolicy_read
--- PASS: TestAccOktaDataSourcePolicy_read (2.84s)
PASS
ok      github.com/okta/terraform-provider-okta/okta    3.167s

@monde
Copy link
Collaborator Author

monde commented Feb 14, 2023

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.

2 participants