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,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].
|
||||||
|
|||||||
Reference in New Issue
Block a user