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
+7 -3
View File
@@ -1,9 +1,13 @@
package domain
import "time"
import (
"time"
"github.com/zitadel/zitadel/internal/crypto"
)
type Check struct {
Code []byte `db:"code"`
Code *crypto.CryptoValue `db:"code"`
ExpiresAt *time.Time `db:"expires_at"`
FailedAttempts uint8 `db:"failed_attempts"`
}
@@ -24,7 +28,7 @@ type CheckTypeInit struct {
// Expiry is the duration after which the check expires.
Expiry *time.Duration
// Code to be used for the check.
Code []byte
Code *crypto.CryptoValue
}
// isCheckType implements [CheckType].