mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +00:00
feat: add action v2 execution on requests and responses (#7637)
* feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: add execution of targets to grpc calls * feat: split request and response logic to handle the different context information * feat: split request and response logic to handle the different context information * fix: integration test * fix: import alias * fix: refactor execution package * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * fix: refactor execution interceptor integration and unit tests * docs: basic documentation for executions and targets * fix: change order for interceptors * fix: merge back origin/main * fix: change target definition command and query side (#7735) * fix: change target definition command and query side * fix: correct refactoring name changes * fix: correct refactoring name changes * fix: changing execution defintion with target list and type * fix: changing execution definition with target list and type * fix: add back search queries for target and include * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * fix: projections change for execution with targets suffix table * docs: add example to actions v2 * docs: add example to actions v2 * fix: correct integration tests on query for executions * fix: add separate event for execution v2 as content changed * fix: add separate event for execution v2 as content changed * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes --------- Co-authored-by: adlerhurst <silvan.reusser@gmail.com> * fix: added review comment changes * fix: added review comment changes * Update internal/api/grpc/server/middleware/execution_interceptor.go Co-authored-by: Silvan <silvan.reusser@gmail.com> * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes * fix: added review comment changes --------- Co-authored-by: adlerhurst <silvan.reusser@gmail.com> Co-authored-by: Elio Bischof <elio@zitadel.com>
This commit is contained in:
@@ -15,9 +15,8 @@ type TargetWriteModel struct {
|
||||
|
||||
Name string
|
||||
TargetType domain.TargetType
|
||||
URL string
|
||||
Endpoint string
|
||||
Timeout time.Duration
|
||||
Async bool
|
||||
InterruptOnError bool
|
||||
|
||||
State domain.TargetState
|
||||
@@ -39,9 +38,8 @@ func (wm *TargetWriteModel) Reduce() error {
|
||||
case *target.AddedEvent:
|
||||
wm.Name = e.Name
|
||||
wm.TargetType = e.TargetType
|
||||
wm.URL = e.URL
|
||||
wm.Endpoint = e.Endpoint
|
||||
wm.Timeout = e.Timeout
|
||||
wm.Async = e.Async
|
||||
wm.State = domain.TargetActive
|
||||
case *target.ChangedEvent:
|
||||
if e.Name != nil {
|
||||
@@ -50,15 +48,12 @@ func (wm *TargetWriteModel) Reduce() error {
|
||||
if e.TargetType != nil {
|
||||
wm.TargetType = *e.TargetType
|
||||
}
|
||||
if e.URL != nil {
|
||||
wm.URL = *e.URL
|
||||
if e.Endpoint != nil {
|
||||
wm.Endpoint = *e.Endpoint
|
||||
}
|
||||
if e.Timeout != nil {
|
||||
wm.Timeout = *e.Timeout
|
||||
}
|
||||
if e.Async != nil {
|
||||
wm.Async = *e.Async
|
||||
}
|
||||
if e.InterruptOnError != nil {
|
||||
wm.InterruptOnError = *e.InterruptOnError
|
||||
}
|
||||
@@ -86,9 +81,8 @@ func (wm *TargetWriteModel) NewChangedEvent(
|
||||
agg *eventstore.Aggregate,
|
||||
name *string,
|
||||
targetType *domain.TargetType,
|
||||
url *string,
|
||||
endpoint *string,
|
||||
timeout *time.Duration,
|
||||
async *bool,
|
||||
interruptOnError *bool,
|
||||
) *target.ChangedEvent {
|
||||
changes := make([]target.Changes, 0)
|
||||
@@ -98,15 +92,12 @@ func (wm *TargetWriteModel) NewChangedEvent(
|
||||
if targetType != nil && wm.TargetType != *targetType {
|
||||
changes = append(changes, target.ChangeTargetType(*targetType))
|
||||
}
|
||||
if url != nil && wm.URL != *url {
|
||||
changes = append(changes, target.ChangeURL(*url))
|
||||
if endpoint != nil && wm.Endpoint != *endpoint {
|
||||
changes = append(changes, target.ChangeEndpoint(*endpoint))
|
||||
}
|
||||
if timeout != nil && wm.Timeout != *timeout {
|
||||
changes = append(changes, target.ChangeTimeout(*timeout))
|
||||
}
|
||||
if async != nil && wm.Async != *async {
|
||||
changes = append(changes, target.ChangeAsync(*async))
|
||||
}
|
||||
if interruptOnError != nil && wm.InterruptOnError != *interruptOnError {
|
||||
changes = append(changes, target.ChangeInterruptOnError(*interruptOnError))
|
||||
}
|
||||
|
Reference in New Issue
Block a user