Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Enforcement of paginated API responses from the auth0 management v2 API #168

Closed
edify42 opened this issue Nov 24, 2020 · 5 comments · Fixed by #205
Closed

Enforcement of paginated API responses from the auth0 management v2 API #168

edify42 opened this issue Nov 24, 2020 · 5 comments · Fixed by #205

Comments

@edify42
Copy link
Contributor

edify42 commented Nov 24, 2020

Hey @alexkappa!

Happy to see you're still maintaining this 👍

We saw an email about paginated responses from the 21st January 2021 affecting these endpoints:

    GET /api/v2/clients
    GET /api/v2/client-grants
    GET /api/v2/grants
    GET /api/v2/connections
    GET /api/v2/device-credentials (NOTE: pagination will not be enforced when type is not provided)
    GET /api/v2/resource-servers
    GET /api/v2/rules

I looked through the source code here and found the client-grants and resource-servers endpoints had support for pagination but not the others.

I thought to create the issue so others might know and update their terraform providers if we did end up patching this

@alexkappa
Copy link
Contributor

Hi @edify42, thanks for filing an issue. What exactly is changing in these responses?

This SDK enforces per_page and include_totals with all List requests. This wraps the response in an envelope containing pagination metadata. Is this what you're referring to?

@levitiessen
Copy link

@alexkappa Thank you for your work on this and the terraform provider for Auth0.

I've copied text from Auth0's information provided to users:

After January 26, 2021, requests to API v2 will return a maximum of 50 items. In order to retrieve more than 50 items, requests to these 7 endpoints need to be updated using the per_page and page parameters:

GET /api/v2/clients
GET /api/v2/client-grants
GET /api/v2/grants
GET /api/v2/connections
GET /api/v2/device-credentials (NOTE: pagination will not be enforced when type is not provided)
GET /api/v2/resource-servers
GET /api/v2/rules

Our terraform operations have been getting deprecation notes in logs in Auth as recently as today, which makes me think there might be some tweaks required to get this in line with Auth0's new expectations.

@yvovandoorn
Copy link
Contributor

@levitiessen are you still getting dep notices? Could you point to which API end points is generating these warnings when applying Terraform changes?

@levitiessen
Copy link

levitiessen commented Mar 23, 2021 via email

@yvovandoorn
Copy link
Contributor

I understand.

Looking at it again, it looked like one endpoint, /api/v2/grants, was not using @alexkappa's SDK enforcement. I've opened up #205 to address it. After January, the default response is paginated, which would explain why it disappeared in your logs :-).

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

Successfully merging a pull request may close this issue.

4 participants