feat(session): Passkey Check API with relation tables (#11858)

# Which Problems Are Solved

As part of #11035 , this PR implements the Passkey check logic for
session validation

# How the Problems Are Solved

  - Refactor webauth FinishLogin to support new domain model
  - Add webauth config to defaults
  - Implement passkey check logic and tests
- Manual transaction management to avoid stalling the DB while
FinishLogin callback is executed
- Update passkey Type condition to allow passing a text operation
(equal, contains, etc..)

# Additional Context

This is a cherry-picked PR + minor changes, coming from
https://github.com/zitadel/zitadel/pull/11164
- Relates to #11035

---------

Co-authored-by: Fabienne Bühler <[email protected]>
Co-authored-by: Gayathri Vijayan <[email protected]>
This commit is contained in:
Marco A.
2026-03-27 12:38:40 +01:00
committed by GitHub
co-authored by Fabienne Bühler Gayathri Vijayan
parent ec7a6d5526
commit 022bf74060
23 changed files with 1591 additions and 20 deletions
@@ -195,8 +195,8 @@ func (u userPasskey) KeyIDCondition(keyID string) database.Condition {
}
// TypeCondition implements [domain.HumanPasskeyConditions].
func (u userPasskey) TypeCondition(passkeyType domain.PasskeyType) database.Condition {
return database.NewTextCondition(u.typeColumn(), database.TextOperationEqual, passkeyType.String())
func (u userPasskey) TypeCondition(op database.TextOperation, passkeyType domain.PasskeyType) database.Condition {
return database.NewTextCondition(u.typeColumn(), op, passkeyType.String())
}
// -------------------------------------------------------------
@@ -1573,7 +1573,7 @@ func Test_user_ListConditions(t *testing.T) {
opts: []database.QueryOption{
database.WithCondition(database.And(
userRepo.InstanceIDCondition(instanceID1),
humanRepo.ExistsPasskey(humanRepo.PasskeyConditions().TypeCondition(domain.PasskeyTypeU2F)),
humanRepo.ExistsPasskey(humanRepo.PasskeyConditions().TypeCondition(database.TextOperationEqual, domain.PasskeyTypeU2F)),
)),
},
want: want{