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:
Livio Spring
2026-01-22 07:41:35 +00:00
committed by GitHub
parent 597f385ca4
commit 7d6a2950b4
6 changed files with 171 additions and 5 deletions
+16
View File
@@ -670,6 +670,22 @@ func NewAppProjectIDSearchQuery(id string) (SearchQuery, error) {
return NewTextQuery(AppColumnProjectID, id, TextEquals)
}
func NewAppClientIDSearchQuery(clientID string) (SearchQuery, error) {
oidcClientIDQuery, err := NewTextQuery(AppOIDCConfigColumnClientID, clientID, TextEquals)
if err != nil {
return nil, err
}
apiClientIDQuery, err := NewTextQuery(AppAPIConfigColumnClientID, clientID, TextEquals)
if err != nil {
return nil, err
}
return NewOrQuery(oidcClientIDQuery, apiClientIDQuery)
}
func NewAppSAMLEntityIDSearchQuery(entityID string) (SearchQuery, error) {
return NewTextQuery(AppSAMLConfigColumnEntityID, entityID, TextEquals)
}
func prepareAppQuery(activeOnly bool) (sq.SelectBuilder, func(*sql.Row) (*App, error)) {
query := sq.Select(
AppColumnID.identifier(),