mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-09-01 20:08:36 +00:00
admin-api: allow filtering OAuth2 sessions by multiple clients
Make `filter[client]` on `GET /api/admin/v1/oauth2-sessions` repeatable so admin tooling can fetch sessions belonging to a set of clients in one request. The field on `FilterParams` changes from `Option<Ulid>` to `Vec<Ulid>`; the struct was already extracted with `axum_extra::extract::Query` so the repeated values are not silently dropped. Each client ULID is validated to exist (mirroring the previous single-client `404` behaviour) before being passed to the new `OAuth2SessionFilter::for_clients` storage filter. The `Display` impl used to reconstruct cursor links now emits one `filter[client]=…` segment per client so pagination preserves the filter. The OpenAPI schema is regenerated via `misc/update.sh` and now describes the parameter as an array.
This commit is contained in:
+14
-20
@@ -505,7 +505,7 @@
|
||||
"oauth2-session"
|
||||
],
|
||||
"summary": "List OAuth 2.0 sessions",
|
||||
"description": "Retrieve a list of OAuth 2.0 sessions.\nNote that by default, all sessions, including finished ones are returned, with the oldest first.\nUse the `filter[status]` parameter to filter the sessions by their status and `page[last]` parameter to retrieve the last N sessions.",
|
||||
"description": "Retrieve a list of OAuth 2.0 sessions.\nNote that by default, all sessions, including finished ones are returned, with the oldest first.\nUse the `filter[status]` parameter to filter the sessions by their status and `page[last]` parameter to retrieve the last N sessions.\nThe `filter[client]` parameter may be repeated to filter on multiple clients at once.",
|
||||
"operationId": "listOAuth2Sessions",
|
||||
"parameters": [
|
||||
{
|
||||
@@ -609,17 +609,14 @@
|
||||
{
|
||||
"in": "query",
|
||||
"name": "filter[client]",
|
||||
"description": "Retrieve the items for the given client",
|
||||
"description": "Retrieve the items for the given client(s)\n\n This parameter may be repeated to filter on multiple clients at\n once (sessions matching any of the given clients are returned).",
|
||||
"schema": {
|
||||
"description": "Retrieve the items for the given client",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ULID"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
"description": "Retrieve the items for the given client(s)\n\n This parameter may be repeated to filter on multiple clients at\n once (sessions matching any of the given clients are returned).",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ULID"
|
||||
},
|
||||
"default": []
|
||||
},
|
||||
"style": "form"
|
||||
},
|
||||
@@ -5412,15 +5409,12 @@
|
||||
]
|
||||
},
|
||||
"filter[client]": {
|
||||
"description": "Retrieve the items for the given client",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/ULID"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
"description": "Retrieve the items for the given client(s)\n\n This parameter may be repeated to filter on multiple clients at\n once (sessions matching any of the given clients are returned).",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/ULID"
|
||||
},
|
||||
"default": []
|
||||
},
|
||||
"filter[client-kind]": {
|
||||
"description": "Retrieve the items only for a specific client kind",
|
||||
|
||||
Reference in New Issue
Block a user