fix(domain): use crypto.CryptoValue (#11131)

Update the `Check` struct to utilize `crypto.CryptoValue` for the `Code`
field, enhancing security and type safety. Adjust the `CheckTypeInit`
struct accordingly to maintain consistency.
This commit is contained in:
Silvan
2025-12-03 21:41:22 +00:00
committed by GitHub
parent b4732579cb
commit e26859d644
+9 -5
View File
@@ -1,11 +1,15 @@
package domain package domain
import "time" import (
"time"
"github.com/zitadel/zitadel/internal/crypto"
)
type Check struct { type Check struct {
Code []byte `db:"code"` Code *crypto.CryptoValue `db:"code"`
ExpiresAt *time.Time `db:"expires_at"` ExpiresAt *time.Time `db:"expires_at"`
FailedAttempts uint8 `db:"failed_attempts"` FailedAttempts uint8 `db:"failed_attempts"`
} }
type CheckType interface { type CheckType interface {
@@ -24,7 +28,7 @@ type CheckTypeInit struct {
// Expiry is the duration after which the check expires. // Expiry is the duration after which the check expires.
Expiry *time.Duration Expiry *time.Duration
// Code to be used for the check. // Code to be used for the check.
Code []byte Code *crypto.CryptoValue
} }
// isCheckType implements [CheckType]. // isCheckType implements [CheckType].