mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-02 20:32:19 +00:00
# Which Problems Are Solved Add OTP Email challenge needed for Create/Set session in the RT model. # How the Problems Are Solved Introduce `OTPEmailChallengeCommand` (validate/execute/events) for session creation checks Add unit tests # Additional Changes Remove unused fields from `session_challenge_otp_sms.go` # Additional Context - Related to https://github.com/zitadel/zitadel/issues/11035 --------- Co-authored-by: Marco A. <[email protected]>
63 lines
1.7 KiB
Go
63 lines
1.7 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
|
|
otpEmailSecretGeneratorConfig *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 SetOTPEmailSecretGeneratorConfig(cfg *crypto.GeneratorConfig) {
|
|
otpEmailSecretGeneratorConfig = cfg
|
|
}
|
|
|
|
func SetMFAEncryptionAlgorithm(mfaEncryptionAlg crypto.EncryptionAlgorithm) {
|
|
mfaEncryptionAlgo = mfaEncryptionAlg
|
|
}
|
|
|
|
func SetWebAuthNConfig(cfg *webauthn.Config) {
|
|
webauthnConfig = cfg
|
|
}
|