mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-25 16:52:17 +00:00
# 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]>
58 lines
1.5 KiB
Go
58 lines
1.5 KiB
Go
package domain
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/backend/v3/storage/database"
|
|
"github.com/zitadel/zitadel/backend/v3/storage/eventstore"
|
|
"github.com/zitadel/zitadel/internal/config/systemdefaults"
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
|
"github.com/zitadel/zitadel/internal/webauthn"
|
|
)
|
|
|
|
var (
|
|
pool database.Pool
|
|
legacyEventstore eventstore.LegacyEventstore
|
|
sysConfig systemdefaults.SystemDefaults
|
|
passwordHasher *crypto.Hasher
|
|
idpEncryptionAlgo crypto.EncryptionAlgorithm
|
|
sessionTokenDecryptor SessionTokenDecryptor
|
|
mfaEncryptionAlgo crypto.EncryptionAlgorithm
|
|
otpSMSSecretGeneratorConfig *crypto.GeneratorConfig
|
|
webauthnConfig *webauthn.Config
|
|
)
|
|
|
|
func SetPool(p database.Pool) {
|
|
pool = p
|
|
}
|
|
|
|
func SetLegacyEventstore(es eventstore.LegacyEventstore) {
|
|
legacyEventstore = es
|
|
}
|
|
|
|
func SetSystemConfig(cfg systemdefaults.SystemDefaults) {
|
|
sysConfig = cfg
|
|
}
|
|
|
|
func SetPasswordHasher(hasher *crypto.Hasher) {
|
|
passwordHasher = hasher
|
|
}
|
|
|
|
func SetIDPEncryptionAlgorithm(idpEncryptionAlg crypto.EncryptionAlgorithm) {
|
|
idpEncryptionAlgo = idpEncryptionAlg
|
|
}
|
|
|
|
func SetSessionTokenDecryptor(decryptor SessionTokenDecryptor) {
|
|
sessionTokenDecryptor = decryptor
|
|
}
|
|
|
|
func SetOTPSMSSecretGeneratorConfig(cfg *crypto.GeneratorConfig) {
|
|
otpSMSSecretGeneratorConfig = cfg
|
|
}
|
|
|
|
func SetMFAEncryptionAlgorithm(mfaEncryptionAlg crypto.EncryptionAlgorithm) {
|
|
mfaEncryptionAlgo = mfaEncryptionAlg
|
|
}
|
|
|
|
func SetWebAuthNConfig(cfg *webauthn.Config) {
|
|
webauthnConfig = cfg
|
|
}
|