auth0 / terraform-provider-auth0

The Auth0 Terraform Provider is the official plugin for managing Auth0 tenant configuration through the Terraform tool.
https://registry.terraform.io/providers/auth0/auth0/latest/docs
Mozilla Public License 2.0
167 stars 86 forks source link

PATCH: Implemented checkpoint pagination for retrieving Role users #1048

Closed duedares-rvj closed 1 month ago

duedares-rvj commented 1 month ago

The auth0_roles data-source presently utilised Offset Pagination for fetching all users associated to a particular role. This limited them to only retrieve 1000 users at max.

Update this implementation to use Checkpoint Pagination which retrieves the full list.

🔧 Changes

📚 References

https://auth0.com/docs/api/management/v2/roles/get-role-user

🔬 Testing

Created 1500 users and associated them to a role. Used auth0_role to fetch all the users.

📝 Checklist

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.37%. Comparing base (3e91dcd) to head (471eaec).

Files with missing lines Patch % Lines
internal/auth0/role/data_source.go 63.63% 3 Missing and 1 partial :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/auth0/terraform-provider-auth0/pull/1048/graphs/tree.svg?width=650&height=150&src=pr&token=geObb1Hn9E&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0)](https://app.codecov.io/gh/auth0/terraform-provider-auth0/pull/1048?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0) ```diff @@ Coverage Diff @@ ## main #1048 +/- ## ========================================== - Coverage 89.38% 89.37% -0.02% ========================================== Files 126 126 Lines 17464 17471 +7 ========================================== + Hits 15610 15614 +4 - Misses 1316 1318 +2 - Partials 538 539 +1 ``` | [Files with missing lines](https://app.codecov.io/gh/auth0/terraform-provider-auth0/pull/1048?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0) | Coverage Δ | | |---|---|---| | [internal/auth0/role/data\_source.go](https://app.codecov.io/gh/auth0/terraform-provider-auth0/pull/1048?src=pr&el=tree&filepath=internal%2Fauth0%2Frole%2Fdata_source.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0#diff-aW50ZXJuYWwvYXV0aDAvcm9sZS9kYXRhX3NvdXJjZS5nbw==) | `79.59% <63.63%> (-1.13%)` | :arrow_down: |