mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-22 21:08:47 +00:00
feat(api): allow filtering apps by client id and entity id (#11385)
# Which Problems Are Solved There's currently no way to retrieve a project based on the client_id of an application. A developer would need to iterate through all projects and their applications to make the correlation. # How the Problems Are Solved - Added a possibility to filter for `client_id` and `entity_id` on the ListApplications endpoint. - Added the `project_id` on the `Application` response (used on the ListApplications endpoint). # Additional Changes None # Additional Context - closes #11340 - requires backport to v4.x
This commit is contained in:
@@ -28,6 +28,7 @@ func AppToPb(queryApp *query.App) *application.Application {
|
||||
State: appStateToPb(queryApp.State),
|
||||
Name: queryApp.Name,
|
||||
Configuration: appConfigToPb(queryApp),
|
||||
ProjectId: queryApp.ProjectID,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,6 +154,10 @@ func applicationFilterToQuery(applicationFilter *application.ApplicationSearchFi
|
||||
return query.NewAppStateSearchQuery(domain.AppState(q.StateFilter))
|
||||
case *application.ApplicationSearchFilter_TypeFilter:
|
||||
return applicationTypeFilterToQuery(q.TypeFilter)
|
||||
case *application.ApplicationSearchFilter_ClientIdFilter:
|
||||
return query.NewAppClientIDSearchQuery(strings.TrimSpace(q.ClientIdFilter.GetClientId()))
|
||||
case *application.ApplicationSearchFilter_EntityIdFilter:
|
||||
return query.NewAppSAMLEntityIDSearchQuery(strings.TrimSpace(q.EntityIdFilter.GetEntityId()))
|
||||
default:
|
||||
return nil, zerrors.ThrowInvalidArgument(nil, "CONV-z2mAGy", "List.Query.Invalid")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user