mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:17:32 +00:00
feat: Instance commands (#3385)
* fix: add events for domain * fix: add/remove domain command side * fix: add/remove domain command side * fix: add/remove domain query side * fix: create instance * fix: merge v2 * fix: instance domain * fix: instance domain * fix: instance domain * fix: instance domain * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from writemodels * fix: remove domain.IAMID from api * fix: remove domain.IAMID * fix: remove domain.IAMID * fix: add instance domain queries * fix: fix after merge * Update auth_request.go * fix keypair * remove unused code * feat: read instance id from context * feat: remove unused code * feat: use instance id from context * some fixes Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -157,6 +157,26 @@ func eventFromEventPusher(event eventstore.Command) *repository.Event {
|
||||
}
|
||||
}
|
||||
|
||||
func eventFromEventPusherWithInstanceID(instanceID string, event eventstore.Command) *repository.Event {
|
||||
data, _ := eventstore.EventData(event)
|
||||
return &repository.Event{
|
||||
ID: "",
|
||||
Sequence: 0,
|
||||
PreviousAggregateSequence: 0,
|
||||
PreviousAggregateTypeSequence: 0,
|
||||
CreationDate: time.Time{},
|
||||
Type: repository.EventType(event.Type()),
|
||||
Data: data,
|
||||
EditorService: event.EditorService(),
|
||||
EditorUser: event.EditorUser(),
|
||||
Version: repository.Version(event.Aggregate().Version),
|
||||
AggregateID: event.Aggregate().ID,
|
||||
AggregateType: repository.AggregateType(event.Aggregate().Type),
|
||||
ResourceOwner: sql.NullString{String: event.Aggregate().ResourceOwner, Valid: event.Aggregate().ResourceOwner != ""},
|
||||
InstanceID: sql.NullString{String: instanceID, Valid: instanceID != ""},
|
||||
}
|
||||
}
|
||||
|
||||
func eventFromEventPusherWithCreationDateNow(event eventstore.Command) *repository.Event {
|
||||
e := eventFromEventPusher(event)
|
||||
e.CreationDate = time.Now()
|
||||
@@ -171,6 +191,15 @@ func uniqueConstraintsFromEventConstraint(constraint *eventstore.EventUniqueCons
|
||||
Action: repository.UniqueConstraintAction(constraint.Action)}
|
||||
}
|
||||
|
||||
func uniqueConstraintsFromEventConstraintWithInstanceID(instanceID string, constraint *eventstore.EventUniqueConstraint) *repository.UniqueConstraint {
|
||||
return &repository.UniqueConstraint{
|
||||
InstanceID: instanceID,
|
||||
UniqueType: constraint.UniqueType,
|
||||
UniqueField: constraint.UniqueField,
|
||||
ErrorMessage: constraint.ErrorMessage,
|
||||
Action: repository.UniqueConstraintAction(constraint.Action)}
|
||||
}
|
||||
|
||||
func GetMockSecretGenerator(t *testing.T) crypto.Generator {
|
||||
ctrl := gomock.NewController(t)
|
||||
alg := crypto.CreateMockEncryptionAlg(ctrl)
|
||||
|
Reference in New Issue
Block a user