mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 05:52:51 +00:00
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:
@@ -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].
|
||||
|
||||
Reference in New Issue
Block a user