Closed RocKordier closed 10 months ago
Definitely an issue. The HTTP API clearly supports page 0, when trying with the CLI. Example ( with Kratos 1.0.0):
> kratos list identities 0 10
2023/08/30 16:48:59 [DEBUG] GET http://kratos_bdshifters_svc:4434/admin/identities?page=0&per_page=10
ID VERIFIED ADDRESSES RECOVERY ADDRESSES SCHEMA ID SCHEMA URL
71bd916d-cabf-453e-aedf-4a438da9c9c4 j@gmail.com j@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
708b637b-29d2-4113-b51f-b6e4fa5e0dd9 verif6@gmail.com verif6@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
695a4564-4d8f-4555-9b21-f381e62a8231 ju3@gmail.com ju3@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
5a474bf8-dd3c-4894-bcfa-d417bd1dadd5 ju@gmail.com ju@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
523c2198-e5f7-4252-bea1-53ad7d20dca2 ju4@gmail.com ju4@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
5169f4d2-ca24-4876-9b23-7acbac71d531 verif10@gmail.com verif10@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
508fb41e-236b-471c-ae07-60336241f616 julien.r@gmail.com julien.r@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
46149db0-157d-4c38-a2c2-ae2b082b51ec ju5@gmail.com ju5@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
0f3fdd01-229f-43a0-b27c-929431b086a4 test_upsert_orders.x0976jdh@mail.com test_upsert_orders.x0976jdh@mail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
0ab1e51d-d51b-471b-87dc-e5f278f8d475 verif2@gmail.com verif2@gmail.com default_v2 http://localhost:4200/proxy/kratos/schemas/ZGVmYXVsdF92Mg
This makes the use of the SDK useless, since we can't fetch the complete list of identities.
It looks like the SDK definition is not correct here. page
and per_page
are actually deprecated, and one should use page_token
and page_size
instead.
Preflight checklist
Describe the bug
ATM its not possible to fetch the first page of the listIdentities Endpoint.
Ory admin console doing it the right way, I think.
The
page
parameter should also allow page0
.Also I'm a bit confused about the Endpoint description. https://www.ory.sh/docs/kratos/reference/api#tag/identity/operation/listIdentities
Why the
page
- parameter isn't a realpage
parameter? Whats the recommended way to safely fetch all identities via API? Why there could be empty pages in between? Is it intended to look at thex-total-count
- Header and fetch pages as long as all identities has been fetched? How does the ory admin console calculate the page selector?Thx for your help Eric
Reproducing the bug
STR:
IdentityApi
Client0
$config = new \Ory\Kratos\Client\Configuration(); $config->setHost('https://host.tld'); $config->setApiKey('Authorization', 'Bearer ory_pat_xxx');
$api = new \Ory\Kratos\Client\Api\IdentityApi(new \GuzzleHttp\Client(), $config);
[$identities, $error, $headers] = $api->listIdentitiesWithHttpInfo(20, 0);
Relevant configuration
Version
ory/kratos-client-php:0.13.1
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Ory Network
Additional Context
No response