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

When there are no OAuth2 clients registered, getClients API will always return rel="next" in the Link header #3674

Open
5 tasks done
denysandriyanov opened this issue Nov 28, 2023 · 0 comments
Labels
bug Something is not working.

Comments

@denysandriyanov
Copy link

denysandriyanov commented Nov 28, 2023

Preflight checklist

Ory Network Project

No response

Describe the bug

When deploying Hydra and it does not have any clients yet. doing a API Call to getClients will always respod with response that has a Link header in which rel="next" is always present. Meaning if API client is utilizing the contract and doing calls to get all clients from all pages, it will stuck to infinite loop because next page rel link will always be present

Reproducing the bug

  1. On virgin Hydra with empty database do an API call to get Oauth2 clients, with let's say page size 10 and page token "1" as first page token.

Expected result:
Considering there are not any clients response should contain Link header without rel="next"

Actual result:
Response contains Link header with rel="next" and every next call to this next page with this token returns again empty page and again rel="next" in Link header containing token to next empty page, never ending.

Relevant log output

Example of Link header while no any single client exists:
</admin/clients?page_size=250&page_token=eyJvZmZzZXQiOiIwIiwidiI6Mn0>; rel="first",</admin/clients?page_size=250&page_token=eyJvZmZzZXQiOiIyNTAiLCJ2IjoyfQ>; rel="next",</admin/clients?page_size=250&page_token=eyJvZmZzZXQiOiItMjUwIiwidiI6Mn0>; rel="prev"

Relevant configuration

No response

Version

oryd/hydra:v2.1.2

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

No response

@denysandriyanov denysandriyanov added the bug Something is not working. label Nov 28, 2023
@denysandriyanov denysandriyanov changed the title When there are no OAuth2 clients registered, and doing getClients will always return rel="next" in the Link header When there are no OAuth2 clients registered, getClients API will always return rel="next" in the Link header Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

1 participant