mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:17:32 +00:00
fix: move v2 pkgs (#1331)
* fix: move eventstore pkgs * fix: move eventstore pkgs * fix: remove v2 view * fix: remove v2 view
This commit is contained in:
47
internal/domain/machine_key.go
Normal file
47
internal/domain/machine_key.go
Normal file
@@ -0,0 +1,47 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
)
|
||||
|
||||
type MachineKey struct {
|
||||
models.ObjectRoot
|
||||
|
||||
KeyID string
|
||||
Type AuthNKeyType
|
||||
ExpirationDate time.Time
|
||||
PrivateKey []byte
|
||||
PublicKey []byte
|
||||
}
|
||||
|
||||
func (key *MachineKey) setPublicKey(publicKey []byte) {
|
||||
key.PublicKey = publicKey
|
||||
}
|
||||
|
||||
func (key *MachineKey) setPrivateKey(privateKey []byte) {
|
||||
key.PrivateKey = privateKey
|
||||
}
|
||||
|
||||
func (key *MachineKey) expirationDate() time.Time {
|
||||
return key.ExpirationDate
|
||||
}
|
||||
|
||||
func (key *MachineKey) setExpirationDate(expiration time.Time) {
|
||||
key.ExpirationDate = expiration
|
||||
}
|
||||
|
||||
type MachineKeyState int32
|
||||
|
||||
const (
|
||||
MachineKeyStateUnspecified MachineKeyState = iota
|
||||
MachineKeyStateActive
|
||||
MachineKeyStateRemoved
|
||||
|
||||
machineKeyStateCount
|
||||
)
|
||||
|
||||
func (f MachineKeyState) Valid() bool {
|
||||
return f >= 0 && f < machineKeyStateCount
|
||||
}
|
Reference in New Issue
Block a user