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

New resource: wiz_saml_group_mapping #216

Merged
merged 22 commits into from
Nov 18, 2024

Conversation

NerdJeremia
Copy link
Contributor

@NerdJeremia NerdJeremia commented Jul 30, 2024

This new resources allows the mapping of a saml provider group to a role on project(s) or on global scope without the need for the saml identity provider resource.

Output of acceptance test:

➜  terraform-provider-wiz git:(feature/saml-group-mapping) ✗ TF_ACC=1 go test ./internal/acceptance/... -v -run='TestAccResourceWizSAMLGroupMapping_basic'   
=== RUN   TestAccResourceWizSAMLGroupMapping_basic
2024/07/30 09:15:25 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/07/30 09:15:26 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/07/30 09:15:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/07/30 09:15:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/07/30 09:15:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:32 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:32 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:32 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:32 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:32 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:32 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:32 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/07/30 09:15:33 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/07/30 09:15:33 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:33 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:33 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:33 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:33 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:33 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/07/30 09:15:34 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/07/30 09:15:34 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/07/30 09:15:34 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
--- PASS: TestAccResourceWizSAMLGroupMapping_basic (9.33s)
PASS
ok      wiz.io/hashicorp/terraform-provider-wiz/internal/acceptance     9.652s

@NerdJeremia NerdJeremia requested a review from a team as a code owner July 30, 2024 07:23
internal/wiz/structs.go Outdated Show resolved Hide resolved
internal/wiz/structs.go Outdated Show resolved Hide resolved
internal/wiz/structs.go Outdated Show resolved Hide resolved
@NerdJeremia
Copy link
Contributor Author

Hey, thanks for your comments. I think it's ready for merging now 😁

@jschoombee
Copy link
Collaborator

I will make time in the coming days to review, thanks for all the contributions so far!

internal/wiz/structs.go Outdated Show resolved Hide resolved
internal/wiz/structs.go Outdated Show resolved Hide resolved
@jschoombee
Copy link
Collaborator

I left a few comments and a question/consideration around the schema of the resource itself. Also once ready for another review, please update the PR comments with the latest acc test run results

@NerdJeremia
Copy link
Contributor Author

Hi @jschoombee,
I think the code is ready for another review. I changed the mappings to be a set.
Here is the output of the acceptance test:

➜  terraform-provider-wiz git:(feature/saml-group-mapping) ✗ TF_ACC=1 go test ./internal/acceptance/... -v -run='TestAccResourceWizSAMLGroupMapping_basic'
=== RUN   TestAccResourceWizSAMLGroupMapping_basic
2024/08/20 16:05:44 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/20 16:05:44 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/20 16:05:45 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:45 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:45 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:45 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:45 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:45 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:45 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:46 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:46 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:46 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:46 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:46 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:47 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:48 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:49 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:05:50 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:50 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:50 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:51 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:52 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:53 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:54 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:54 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:55 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:05:56 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:56 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:56 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:56 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:57 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/20 16:05:57 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:05:59 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:59 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:59 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:59 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:05:59 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/20 16:06:03 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:03 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:03 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:03 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:03 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:03 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/20 16:06:03 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/20 16:06:03 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/20 16:06:04 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
--- PASS: TestAccResourceWizSAMLGroupMapping_basic (20.74s)
PASS
ok      wiz.io/hashicorp/terraform-provider-wiz/internal/acceptance     21.053s

internal/wiz/structs.go Outdated Show resolved Hide resolved
@NerdJeremia
Copy link
Contributor Author

Output of latest acceptance test:

➜  terraform-provider-wiz git:(feature/saml-group-mapping) ✗ TF_ACC=1 go test ./internal/acceptance/... -v -run='TestAccResourceWizSAMLGroupMapping_basic'
=== RUN   TestAccResourceWizSAMLGroupMapping_basic
2024/08/21 11:16:12 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/21 11:16:13 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:13 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:14 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:14 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:15 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:16 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:16 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:16 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:16 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:17 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:17 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:17 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:17 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:17 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:17 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:17 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:18 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:18 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:18 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:18 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:18 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:18 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:18 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:19 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:19 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:19 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:19 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:19 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:20 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:21 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:21 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:22 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:23 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:23 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:23 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:23 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:23 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:23 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:24 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:24 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:24 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:24 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:24 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:25 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:25 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:25 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:25 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/21 11:16:25 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:26 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:27 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:28 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:29 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:30 [DEBUG] POST https://api.eu7.app.wiz.io/graphql (status: 429): retrying in 1s (10 left)
2024/08/21 11:16:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:31 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/08/21 11:16:31 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/21 11:16:32 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/08/21 11:16:32 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
--- PASS: TestAccResourceWizSAMLGroupMapping_basic (20.48s)
PASS
ok      wiz.io/hashicorp/terraform-provider-wiz/internal/acceptance     20.794s

@jschoombee
Copy link
Collaborator

Thanks, think its good for merge. One last question around the acc tests, I notice quite a few 429 errors (rate limiting back off); is this happening in general for other acc tests also?

@NerdJeremia
Copy link
Contributor Author

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

@jschoombee
Copy link
Collaborator

jschoombee commented Aug 22, 2024

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

Maybe a pagination issue? Your acc test is just comparing one mapping against the saml idp's slice of mappings, which may be compute heavy but shouldn't cause a 429 which says that there are just too many API requests going on and for an acceptance test that shouldn't happen. How many mappings are present for the saml idp you are targeting?

For an idp with 1000s of group mappings in eu1 region I'm testing with, there's no validation of first - this controls the page size. For other queries, this validation is certainly in place, normally limited to around 500. It seems there is an issue with the vendor API, as I get 857 nodes when querying for 1000, ±2300 odd when querying for 3000. Not sure if their resolvers are doing some limiting which is not transparent to the caller, or if its just a bug but I'm just testing in a single region (eu1).

I think this needs to be tested out a bit more and possibly raised with Wiz.

Query that is returning ±2300 results and should be returning an error due to first integer size:

query samlIdentityProviderGroupMappings ($id: ID!, $first: Int! $after: String){
	    samlIdentityProviderGroupMappings (
	        id: 	$id,
			first: 	$first
			after: 	$after
	    ) {
			pageInfo {
				  hasNextPage
				  endCursor
			}
	        nodes {
			  providerGroupId
			  role {
				id
			  }
			  projects {
				id
			  }
			}
	    }
	}


###
{
  "first":  1000000000,
  "id": "company-sso"
}

The behaviour now is that it allows to create a resource for an IDP with multiple mappings, could be useful for say grouping by department.. This means that for every resource, its another round trip to get mappings right? In this case it might make sense to implement a data source for saml_idp_mappings which this resource could reference.

@NerdJeremia
Copy link
Contributor Author

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

Maybe a pagination issue? Your acc test is just comparing one mapping against the saml idp's slice of mappings, which may be compute heavy but shouldn't cause a 429 which says that there are just too many API requests going on and for an acceptance test that shouldn't happen. How many mappings are present for the saml idp you are targeting?

For an idp with 1000s of group mappings in eu1 region I'm testing with, there's no validation of first - this controls the page size. For other queries, this validation is certainly in place, normally limited to around 500. It seems there is an issue with the vendor API, as I get 857 nodes when querying for 1000, ±2300 odd when querying for 3000. Not sure if their resolvers are doing some limiting which is not transparent to the caller, or if its just a bug but I'm just testing in a single region (eu1).

I think this needs to be tested out a bit more and possibly raised with Wiz.

Query that is returning ±2300 results and should be returning an error due to first integer size:

query samlIdentityProviderGroupMappings ($id: ID!, $first: Int! $after: String){
	    samlIdentityProviderGroupMappings (
	        id: 	$id,
			first: 	$first
			after: 	$after
	    ) {
			pageInfo {
				  hasNextPage
				  endCursor
			}
	        nodes {
			  providerGroupId
			  role {
				id
			  }
			  projects {
				id
			  }
			}
	    }
	}


###
{
  "first":  1000000000,
  "id": "company-sso"
}

The behaviour now is that it allows to create a resource for an IDP with multiple mappings, could be useful for say grouping by department.. This means that for every resource, its another round trip to get mappings right? In this case it might make sense to implement a data source for saml_idp_mappings which this resource could reference.

I am testing with an idp that has about 1900 group mappings. You are right, the first parameter doesn't seem to be working properly for this query.

@jschoombee
Copy link
Collaborator

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

Maybe a pagination issue? Your acc test is just comparing one mapping against the saml idp's slice of mappings, which may be compute heavy but shouldn't cause a 429 which says that there are just too many API requests going on and for an acceptance test that shouldn't happen. How many mappings are present for the saml idp you are targeting?
For an idp with 1000s of group mappings in eu1 region I'm testing with, there's no validation of first - this controls the page size. For other queries, this validation is certainly in place, normally limited to around 500. It seems there is an issue with the vendor API, as I get 857 nodes when querying for 1000, ±2300 odd when querying for 3000. Not sure if their resolvers are doing some limiting which is not transparent to the caller, or if its just a bug but I'm just testing in a single region (eu1).
I think this needs to be tested out a bit more and possibly raised with Wiz.
Query that is returning ±2300 results and should be returning an error due to first integer size:

query samlIdentityProviderGroupMappings ($id: ID!, $first: Int! $after: String){
	    samlIdentityProviderGroupMappings (
	        id: 	$id,
			first: 	$first
			after: 	$after
	    ) {
			pageInfo {
				  hasNextPage
				  endCursor
			}
	        nodes {
			  providerGroupId
			  role {
				id
			  }
			  projects {
				id
			  }
			}
	    }
	}


###
{
  "first":  1000000000,
  "id": "company-sso"
}

The behaviour now is that it allows to create a resource for an IDP with multiple mappings, could be useful for say grouping by department.. This means that for every resource, its another round trip to get mappings right? In this case it might make sense to implement a data source for saml_idp_mappings which this resource could reference.

I am testing with an idp that has about 1900 group mappings. You are right, the first parameter doesn't seem to be working properly for this query.

So it needs a bit of attention then before merge, shall I release your other changes in the interim? Would you be open to continue working on this?

@NerdJeremia
Copy link
Contributor Author

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

Maybe a pagination issue? Your acc test is just comparing one mapping against the saml idp's slice of mappings, which may be compute heavy but shouldn't cause a 429 which says that there are just too many API requests going on and for an acceptance test that shouldn't happen. How many mappings are present for the saml idp you are targeting?
For an idp with 1000s of group mappings in eu1 region I'm testing with, there's no validation of first - this controls the page size. For other queries, this validation is certainly in place, normally limited to around 500. It seems there is an issue with the vendor API, as I get 857 nodes when querying for 1000, ±2300 odd when querying for 3000. Not sure if their resolvers are doing some limiting which is not transparent to the caller, or if its just a bug but I'm just testing in a single region (eu1).
I think this needs to be tested out a bit more and possibly raised with Wiz.
Query that is returning ±2300 results and should be returning an error due to first integer size:

query samlIdentityProviderGroupMappings ($id: ID!, $first: Int! $after: String){
	    samlIdentityProviderGroupMappings (
	        id: 	$id,
			first: 	$first
			after: 	$after
	    ) {
			pageInfo {
				  hasNextPage
				  endCursor
			}
	        nodes {
			  providerGroupId
			  role {
				id
			  }
			  projects {
				id
			  }
			}
	    }
	}


###
{
  "first":  1000000000,
  "id": "company-sso"
}

The behaviour now is that it allows to create a resource for an IDP with multiple mappings, could be useful for say grouping by department.. This means that for every resource, its another round trip to get mappings right? In this case it might make sense to implement a data source for saml_idp_mappings which this resource could reference.

I am testing with an idp that has about 1900 group mappings. You are right, the first parameter doesn't seem to be working properly for this query.

So it needs a bit of attention then before merge, shall I release your other changes in the interim? Would you be open to continue working on this?

Hey, yes it would be nice if you could release the other changes in the mean time.
What should I adjust so we can also merge this PR?

@jschoombee
Copy link
Collaborator

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

Maybe a pagination issue? Your acc test is just comparing one mapping against the saml idp's slice of mappings, which may be compute heavy but shouldn't cause a 429 which says that there are just too many API requests going on and for an acceptance test that shouldn't happen. How many mappings are present for the saml idp you are targeting?
For an idp with 1000s of group mappings in eu1 region I'm testing with, there's no validation of first - this controls the page size. For other queries, this validation is certainly in place, normally limited to around 500. It seems there is an issue with the vendor API, as I get 857 nodes when querying for 1000, ±2300 odd when querying for 3000. Not sure if their resolvers are doing some limiting which is not transparent to the caller, or if its just a bug but I'm just testing in a single region (eu1).
I think this needs to be tested out a bit more and possibly raised with Wiz.
Query that is returning ±2300 results and should be returning an error due to first integer size:

query samlIdentityProviderGroupMappings ($id: ID!, $first: Int! $after: String){
	    samlIdentityProviderGroupMappings (
	        id: 	$id,
			first: 	$first
			after: 	$after
	    ) {
			pageInfo {
				  hasNextPage
				  endCursor
			}
	        nodes {
			  providerGroupId
			  role {
				id
			  }
			  projects {
				id
			  }
			}
	    }
	}


###
{
  "first":  1000000000,
  "id": "company-sso"
}

The behaviour now is that it allows to create a resource for an IDP with multiple mappings, could be useful for say grouping by department.. This means that for every resource, its another round trip to get mappings right? In this case it might make sense to implement a data source for saml_idp_mappings which this resource could reference.

I am testing with an idp that has about 1900 group mappings. You are right, the first parameter doesn't seem to be working properly for this query.

So it needs a bit of attention then before merge, shall I release your other changes in the interim? Would you be open to continue working on this?

Would you mind submitting a PR to fix goreleaser (as I can't approve my own PRs and only a member of this repo), you can reference the open pull request in the repo? Once done then I can release your changes.

In terms of this PR I think it would be good to first get clarity from the vendor around the pagination issue, as we don't want to see rate limits being hit in simple acceptance tests.

@NerdJeremia
Copy link
Contributor Author

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

Maybe a pagination issue? Your acc test is just comparing one mapping against the saml idp's slice of mappings, which may be compute heavy but shouldn't cause a 429 which says that there are just too many API requests going on and for an acceptance test that shouldn't happen. How many mappings are present for the saml idp you are targeting?
For an idp with 1000s of group mappings in eu1 region I'm testing with, there's no validation of first - this controls the page size. For other queries, this validation is certainly in place, normally limited to around 500. It seems there is an issue with the vendor API, as I get 857 nodes when querying for 1000, ±2300 odd when querying for 3000. Not sure if their resolvers are doing some limiting which is not transparent to the caller, or if its just a bug but I'm just testing in a single region (eu1).
I think this needs to be tested out a bit more and possibly raised with Wiz.
Query that is returning ±2300 results and should be returning an error due to first integer size:

query samlIdentityProviderGroupMappings ($id: ID!, $first: Int! $after: String){
	    samlIdentityProviderGroupMappings (
	        id: 	$id,
			first: 	$first
			after: 	$after
	    ) {
			pageInfo {
				  hasNextPage
				  endCursor
			}
	        nodes {
			  providerGroupId
			  role {
				id
			  }
			  projects {
				id
			  }
			}
	    }
	}


###
{
  "first":  1000000000,
  "id": "company-sso"
}

The behaviour now is that it allows to create a resource for an IDP with multiple mappings, could be useful for say grouping by department.. This means that for every resource, its another round trip to get mappings right? In this case it might make sense to implement a data source for saml_idp_mappings which this resource could reference.

I am testing with an idp that has about 1900 group mappings. You are right, the first parameter doesn't seem to be working properly for this query.

So it needs a bit of attention then before merge, shall I release your other changes in the interim? Would you be open to continue working on this?

Would you mind submitting a PR to fix goreleaser (as I can't approve my own PRs and only a member of this repo), you can reference the open pull request in the repo? Once done then I can release your changes.

In terms of this PR I think it would be good to first get clarity from the vendor around the pagination issue, as we don't want to see rate limits being hit in simple acceptance tests.

Sure, I created a PR for that: #224.
Would you be able to get in contact with the vendor?

@jschoombee
Copy link
Collaborator

I think that is happening because it gets checked first if the mapping exists which involves a lot of queries because it has to go through all the data until it eventually finds the one or comes to the end.

Maybe a pagination issue? Your acc test is just comparing one mapping against the saml idp's slice of mappings, which may be compute heavy but shouldn't cause a 429 which says that there are just too many API requests going on and for an acceptance test that shouldn't happen. How many mappings are present for the saml idp you are targeting?
For an idp with 1000s of group mappings in eu1 region I'm testing with, there's no validation of first - this controls the page size. For other queries, this validation is certainly in place, normally limited to around 500. It seems there is an issue with the vendor API, as I get 857 nodes when querying for 1000, ±2300 odd when querying for 3000. Not sure if their resolvers are doing some limiting which is not transparent to the caller, or if its just a bug but I'm just testing in a single region (eu1).
I think this needs to be tested out a bit more and possibly raised with Wiz.
Query that is returning ±2300 results and should be returning an error due to first integer size:

query samlIdentityProviderGroupMappings ($id: ID!, $first: Int! $after: String){
	    samlIdentityProviderGroupMappings (
	        id: 	$id,
			first: 	$first
			after: 	$after
	    ) {
			pageInfo {
				  hasNextPage
				  endCursor
			}
	        nodes {
			  providerGroupId
			  role {
				id
			  }
			  projects {
				id
			  }
			}
	    }
	}


###
{
  "first":  1000000000,
  "id": "company-sso"
}

The behaviour now is that it allows to create a resource for an IDP with multiple mappings, could be useful for say grouping by department.. This means that for every resource, its another round trip to get mappings right? In this case it might make sense to implement a data source for saml_idp_mappings which this resource could reference.

I am testing with an idp that has about 1900 group mappings. You are right, the first parameter doesn't seem to be working properly for this query.

So it needs a bit of attention then before merge, shall I release your other changes in the interim? Would you be open to continue working on this?

Would you mind submitting a PR to fix goreleaser (as I can't approve my own PRs and only a member of this repo), you can reference the open pull request in the repo? Once done then I can release your changes.
In terms of this PR I think it would be good to first get clarity from the vendor around the pagination issue, as we don't want to see rate limits being hit in simple acceptance tests.

Sure, I created a PR for that: #224. Would you be able to get in contact with the vendor?

Suggest to log a support case with them for the same, it doesn't make sense for me to be the proxy for this.

@NerdJeremia
Copy link
Contributor Author

Hi @jschoombee,
I now received the following statement from wiz after opening a support ticket regarding the weird behaviour:
grafik

@NerdJeremia
Copy link
Contributor Author

Hey @jschoombee,
I just changed the value of the first parameter to 500 to counter act the rate limiting. This works better now and I think we can merge it.
Here is the output of the acceptance test:

terraform-provider-wiz git:(feature/saml-group-mapping) ✗ TF_ACC=1 go test ./internal/acceptance/... -v -run='TestAccResourceWizSAMLGroupMapping_basic'
=== RUN   TestAccResourceWizSAMLGroupMapping_basic
2024/11/13 09:50:55 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/11/13 09:50:56 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/11/13 09:50:56 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:56 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:57 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:58 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:59 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:59 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:50:59 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/11/13 09:50:59 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:00 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:01 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
2024/11/13 09:51:01 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/11/13 09:51:01 [DEBUG] POST https://auth.app.wiz.io/oauth/token
2024/11/13 09:51:02 [DEBUG] POST https://api.eu7.app.wiz.io/graphql
--- PASS: TestAccResourceWizSAMLGroupMapping_basic (7.03s)
PASS
ok      wiz.io/hashicorp/terraform-provider-wiz/internal/acceptance     7.345s

@jschoombee jschoombee merged commit 59fb845 into AxtonGrams:main Nov 18, 2024
6 of 7 checks passed
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