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

Missing "x-total-count" header for listIdentities endpoint #4128

Closed
3 of 5 tasks
thephilippbusch opened this issue Sep 27, 2024 · 1 comment
Closed
3 of 5 tasks

Missing "x-total-count" header for listIdentities endpoint #4128

thephilippbusch opened this issue Sep 27, 2024 · 1 comment
Labels
bug Something is not working.

Comments

@thephilippbusch
Copy link

thephilippbusch commented Sep 27, 2024

Preflight checklist

Ory Network Project

No response

Describe the bug

When calling the /admin/identities endpoint to list identities, the "X-Total-Count" header cannot be found in the response (in contrast to i.e. the /admin/sessions endpoint). This confuses me a bit, as the Link header is present. So I don't really see a reason, why the listIdentities endpoint should omit that header.

Is there a reason why the identites endpoint does not include an X-Total-Count header (since its also not mentioned on the pagination site in the docs)?

(PS: I'm not really experienced in Go, but it seems like the header could be added without much hassle when comparing the implementation of the listIdentities handler to the aforementioned sessions endpoint handler. I could maybe take a look at that but again, haven't done much with Go yet)

Reproducing the bug

  1. Run docker run oryd/kratos:v1.3.0
  2. Create some identities.
  3. Fetch from identities endpoint and print headers, i.e. via:
curl -X GET -I http://localhost:4434/admin/identities
  1. A similar result like the following should be printed:
HTTP/1.1 200 OK
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Type: application/json; charset=utf-8
Link: </admin/identities?page_size=250&page_token=some-page-token>; rel="first"
Date: Fri, 27 Sep 2024 13:24:18 GMT
Content-Length: 952
  1. The X-Total-Count header is missing.

In contrast, the sessions endpoint returns the following:

curl -X GET -I http://localhost:4434/admin/sessions
HTTP/1.1 200 OK
Cache-Control: private, no-cache, no-store, must-revalidate
Content-Type: application/json; charset=utf-8
Link: </admin/sessions?page_size=250&page_token=some-page-token>; rel="first"
X-Total-Count: 3
Date: Fri, 27 Sep 2024 13:27:07 GMT
Content-Length: 1122

Relevant log output

No response

Relevant configuration

No response

Version

1.3.0

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

Docker Compose

Additional Context

No response

@thephilippbusch thephilippbusch added the bug Something is not working. label Sep 27, 2024
@aeneasr
Copy link
Member

aeneasr commented Sep 27, 2024

We are no longer exposing this header due to performance reasons, so this is expected.

@aeneasr aeneasr closed this as completed Sep 27, 2024
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

2 participants