diff --git a/authentik/core/api/sources.py b/authentik/core/api/sources.py index c7d8205dd2..93154c1559 100644 --- a/authentik/core/api/sources.py +++ b/authentik/core/api/sources.py @@ -85,7 +85,7 @@ class SourceViewSet( serializer_class = SourceSerializer lookup_field = "slug" search_fields = ["slug", "name"] - filterset_fields = ["slug", "name", "managed"] + filterset_fields = ["slug", "name", "managed", "pbm_uuid"] def get_queryset(self): # pragma: no cover return Source.objects.select_subclasses() diff --git a/schema.yml b/schema.yml index 1e5d9466f3..452bbb5c10 100644 --- a/schema.yml +++ b/schema.yml @@ -25207,6 +25207,11 @@ paths: description: Number of results to return per page. schema: type: integer + - in: query + name: pbm_uuid + schema: + type: string + format: uuid - name: search required: false in: query diff --git a/web/src/admin/stages/identification/IdentificationStageFormHelpers.ts b/web/src/admin/stages/identification/IdentificationStageFormHelpers.ts index a6a3159048..e9846e60b3 100644 --- a/web/src/admin/stages/identification/IdentificationStageFormHelpers.ts +++ b/web/src/admin/stages/identification/IdentificationStageFormHelpers.ts @@ -27,13 +27,13 @@ export function sourcesSelector(instanceSources: string[] | undefined) { return async () => { const sourcesApi = new SourcesApi(DEFAULT_CONFIG); const sources = await Promise.allSettled( - instanceSources.map((instanceId) => - sourcesApi.sourcesAllRetrieve({ slug: instanceId }), - ), + instanceSources.map((instanceId) => sourcesApi.sourcesAllList({ pbmUuid: instanceId })), ); return sources .filter((s) => s.status === "fulfilled") .map((s) => s.value) + .filter((s) => s.pagination.count > 0) + .map((s) => s.results[0]) .map(sourceToSelect); }; }