canonical / identity-platform-admin-ui

Admin UI for the Canonical identity broker and identity provider solution
Other
5 stars 4 forks source link

List identities endpoint missing first page #256

Closed edlerd closed 2 months ago

edlerd commented 3 months ago

Description

When reading the GET /api/v0/identities endpoints, the page=1 is requested from kratos. There is also a page=0, but there is no way to read it via the admin ui endpoint at the moment.

I'd expect to be able to read my own writes on identities endpoints. This is currently broken, as a created identity is not included in the response of a read request. See [1] and [2] below for examples.

Pagination is also broken for GET /api/v0/schemas in exactly the same way. This is another issue described in the comments of #44

[1] create identity request

curl -d '
{
  "credentials": {
    "oidc": {
      "config": {
        "config": {
          "hashed_password": "string",
          "password": "string"
        },
        "providers": [
          {
            "provider": "string",
            "subject": "string"
          }
        ]
      }
    },
    "password": {
      "config": {
        "hashed_password": "string",
        "password": "string"
      }
    }
  },
  "metadata_admin": null,
  "metadata_public": null,
  "recovery_addresses": [
    {
      "created_at": "2019-08-24T14:15:22Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "updated_at": "2019-08-24T14:15:22Z",
      "value": "string",
      "via": "string"
    }
  ],
  "schema_id": "social_user_v0",
  "state": "active",
  "traits": {"email": "foo@bar.com"},
  "verifiable_addresses": [
    {
      "created_at": "2014-01-01T23:28:56.782Z",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "status": "string",
      "updated_at": "2014-01-01T23:28:56.782Z",
      "value": "string",
      "verified": true,
      "verified_at": "2019-08-24T14:15:22Z",
      "via": "email"
    }
  ]
}
' -X POST -H 'Content-Type: application/json' http://127.0.0.1:8000/api/v0/identities

[2] read identities, gives empty result

curl http://127.0.0.1:8000/api/v0/identities
{"data":[],"message":"List of identities","status":200,"_meta":{"page":1,"size":100}}

there is no way to read page 0, even if we specify it

curl http://127.0.0.1:8000/api/v0/identities?page=0
{"data":[],"message":"List of identities","status":200,"_meta":{"page":1,"size":100}}

request to kratos directly returns the identity on page 0

curl "http://127.0.0.1:4434/admin/identities?page=0&size=100"
[{"id":"079de71e-62eb-400a-bfbc-d6b77d04c290","schema_id":"social_user_v0","schema_url":"https://10.64.140.43/iam-kratos/schemas/c29jaWFsX3VzZXJfdjA","state":"active","state_changed_at":"2024-03-28T11:47:27.24283Z","traits":{"email":"foo@bar.com"},"metadata_public":null,"metadata_admin":null,"created_at":"2024-03-28T11:47:27.24456Z","updated_at":"2024-03-28T11:47:27.24456Z","organization_id":null}]

kratos does not include the identity on page 1:

curl "http://127.0.0.1:4434/admin/identities?page=1&size=100"
[]
shipperizer commented 3 months ago

linked to #44

syncronize-issues-to-jira[bot] commented 3 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-784.

This message was autogenerated