From e26859d644663d2b6448bc4ac50e80f206bef981 Mon Sep 17 00:00:00 2001 From: Silvan <27845747+adlerhurst@users.noreply.github.com> Date: Wed, 3 Dec 2025 22:41:22 +0100 Subject: [PATCH] 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. --- backend/v3/domain/check.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/v3/domain/check.go b/backend/v3/domain/check.go index 7212fa58f..b594acc8d 100644 --- a/backend/v3/domain/check.go +++ b/backend/v3/domain/check.go @@ -1,11 +1,15 @@ package domain -import "time" +import ( + "time" + + "github.com/zitadel/zitadel/internal/crypto" +) type Check struct { - Code []byte `db:"code"` - ExpiresAt *time.Time `db:"expires_at"` - FailedAttempts uint8 `db:"failed_attempts"` + Code *crypto.CryptoValue `db:"code"` + ExpiresAt *time.Time `db:"expires_at"` + FailedAttempts uint8 `db:"failed_attempts"` } type CheckType interface { @@ -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].