fix(api): fix for ListAppKeys() not returning app keys (#10465)

# Which Problems Are Solved

`ListAppKeys()` does not work properly, in that it does not return any
app keys.

# How the Problems Are Solved

The issue stems from a mistake SQL query not joining the
`projections.authn_keys2` table to `projections.projects4` instead of
joining to `projections.apps7`

# Additional Changes

`ListAppKeys()` returns the app key IDs in order of their creation

- Closes https://github.com/zitadel/zitadel/issues/10420
- backport to v4.x

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
(cherry picked from commit a637ae5aa5)
This commit is contained in:
Iraq
2025-08-15 14:51:43 +02:00
committed by Livio Spring
parent 4efa59d61a
commit dbe0bdbe73
3 changed files with 116 additions and 7 deletions

View File

@@ -13,9 +13,9 @@ import (
)
var (
CTX, OrgCTX context.Context
Instance *integration.Instance
Client mgmt_pb.ManagementServiceClient
CTX, IAMOwnerCTX, OrgCTX context.Context
Instance *integration.Instance
Client mgmt_pb.ManagementServiceClient
)
func TestMain(m *testing.M) {
@@ -25,6 +25,7 @@ func TestMain(m *testing.M) {
Instance = integration.NewInstance(ctx)
CTX = ctx
IAMOwnerCTX = Instance.WithAuthorization(ctx, integration.UserTypeIAMOwner)
OrgCTX = Instance.WithAuthorization(ctx, integration.UserTypeOrgOwner)
Client = Instance.Client.Mgmt
return m.Run()