feat: ListSessions to relational (#11987)

# Which Problems Are Solved

This PR introduces the possibility of using the relational DB when
calling the ListSession gRPC endpoint.

# How the Problems Are Solved

  - Implement the Querier interface for ListSession:
- Create a `domain` model for the Session object to be able to map the
gRPC session into it.
- Match the permission filters on ES side to be sure the same sessions
are returned
- Implement converter methods to go from `gRPC` to `domain` models (both
ways)
- Fix the session sql relational migration: rework the trigger to update
the `expiration` field to perform the update only when the input
`lifetime` has a non-zero value.
  - Link the Querier implementation with the gRPC endpoint
- Run the same integration tests against the relational DB, making sure
the outcome is the same. ⚠️ Due to missing permission checks, some
divergence is expected. Hence, specific code to circumvent the
differences has been put in place

# Additional Context

- Closes #11039
This commit is contained in:
Marco A.
2026-04-16 10:58:17 +02:00
committed by GitHub
parent 177589a0a8
commit 14acc60edd
15 changed files with 1912 additions and 294 deletions
@@ -195,6 +195,13 @@ func (u user) unqualifiedTableName() string {
return "users"
}
func (u user) qualifiedTableName() string {
if u.tableName != "" {
return "zitadel." + u.tableName
}
return "zitadel.users"
}
// -------------------------------------------------------------
// changes
// -------------------------------------------------------------