mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-15 10:25:11 +00:00
fix: remove legacy events (#10464)
# Which Problems Are Solved Some events that are now unused are clogging the event queue from time to time. # How the Problems Are Solved Remove the events described in #10458 # Additional Changes - Updated `stringer` and `enumer` in Makefile target `core_generate_all` to resolve generated files compilation issues # Notes It looks like there are a lot of changes, but most of it is fixing translation files. I suggest doing a review per-commit # Additional Context - Closes #10458 - Depends on https://github.com/zitadel/zitadel/pull/10513
This commit is contained in:
@@ -9,12 +9,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
machineSecretPrefix = machineEventPrefix + "secret."
|
||||
MachineSecretSetType = machineSecretPrefix + "set"
|
||||
MachineSecretHashUpdatedType = machineSecretPrefix + "updated"
|
||||
MachineSecretRemovedType = machineSecretPrefix + "removed"
|
||||
MachineSecretCheckSucceededType = machineSecretPrefix + "check.succeeded"
|
||||
MachineSecretCheckFailedType = machineSecretPrefix + "check.failed"
|
||||
machineSecretPrefix = machineEventPrefix + "secret."
|
||||
MachineSecretSetType = machineSecretPrefix + "set"
|
||||
MachineSecretHashUpdatedType = machineSecretPrefix + "updated"
|
||||
MachineSecretRemovedType = machineSecretPrefix + "removed"
|
||||
)
|
||||
|
||||
type MachineSecretSetEvent struct {
|
||||
@@ -98,80 +96,6 @@ func MachineSecretRemovedEventMapper(event eventstore.Event) (eventstore.Event,
|
||||
return credentialsRemoved, nil
|
||||
}
|
||||
|
||||
type MachineSecretCheckSucceededEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
}
|
||||
|
||||
func (e *MachineSecretCheckSucceededEvent) Payload() interface{} {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *MachineSecretCheckSucceededEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewMachineSecretCheckSucceededEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
) *MachineSecretCheckSucceededEvent {
|
||||
return &MachineSecretCheckSucceededEvent{
|
||||
BaseEvent: *eventstore.NewBaseEventForPush(
|
||||
ctx,
|
||||
aggregate,
|
||||
MachineSecretCheckSucceededType,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
func MachineSecretCheckSucceededEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
check := &MachineSecretCheckSucceededEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
}
|
||||
err := event.Unmarshal(check)
|
||||
if err != nil {
|
||||
return nil, zerrors.ThrowInternal(err, "USER-x002n1p", "unable to unmarshal machine secret check succeeded")
|
||||
}
|
||||
|
||||
return check, nil
|
||||
}
|
||||
|
||||
type MachineSecretCheckFailedEvent struct {
|
||||
eventstore.BaseEvent `json:"-"`
|
||||
}
|
||||
|
||||
func (e *MachineSecretCheckFailedEvent) Payload() interface{} {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *MachineSecretCheckFailedEvent) UniqueConstraints() []*eventstore.UniqueConstraint {
|
||||
return nil
|
||||
}
|
||||
|
||||
func NewMachineSecretCheckFailedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
) *MachineSecretCheckFailedEvent {
|
||||
return &MachineSecretCheckFailedEvent{
|
||||
BaseEvent: *eventstore.NewBaseEventForPush(
|
||||
ctx,
|
||||
aggregate,
|
||||
MachineSecretCheckFailedType,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
func MachineSecretCheckFailedEventMapper(event eventstore.Event) (eventstore.Event, error) {
|
||||
check := &MachineSecretCheckFailedEvent{
|
||||
BaseEvent: *eventstore.BaseEventFromRepo(event),
|
||||
}
|
||||
err := event.Unmarshal(check)
|
||||
if err != nil {
|
||||
return nil, zerrors.ThrowInternal(err, "USER-x7901b1l", "unable to unmarshal machine secret check failed")
|
||||
}
|
||||
|
||||
return check, nil
|
||||
}
|
||||
|
||||
type MachineSecretHashUpdatedEvent struct {
|
||||
*eventstore.BaseEvent `json:"-"`
|
||||
HashedSecret string `json:"hashedSecret,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user