mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-08 15:15:12 +00:00
feat: query side for executions and targets for actions v2 (#7524)
* feat: add projections and query side to executions and targets * feat: add list and get endpoints for targets * feat: add integration tests for query endpoints target and execution * fix: linting * fix: linting * fix: review changes, renames and corrections * fix: review changes, renames and corrections * fix: review changes, renames and corrections * fix: review changes, renames and corrections * fix: review changes, renames and corrections * fix: review changes, renames and corrections * fix: remove position from list details
This commit is contained in:
@@ -28,10 +28,10 @@ func TestServer_SetExecution_Request(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_All{All: true},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_All{All: true},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -42,9 +42,9 @@ func TestServer_SetExecution_Request(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{},
|
||||
},
|
||||
},
|
||||
Targets: []string{targetResp.GetId()},
|
||||
@@ -55,10 +55,10 @@ func TestServer_SetExecution_Request(t *testing.T) {
|
||||
name: "method, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.NotExistingService/List",
|
||||
},
|
||||
},
|
||||
@@ -72,10 +72,10 @@ func TestServer_SetExecution_Request(t *testing.T) {
|
||||
name: "method, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.SessionService/ListSessions",
|
||||
},
|
||||
},
|
||||
@@ -94,10 +94,10 @@ func TestServer_SetExecution_Request(t *testing.T) {
|
||||
name: "service, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Service{
|
||||
Service: "NotExistingService",
|
||||
},
|
||||
},
|
||||
@@ -111,10 +111,10 @@ func TestServer_SetExecution_Request(t *testing.T) {
|
||||
name: "service, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Service{
|
||||
Service: "zitadel.session.v2beta.SessionService",
|
||||
},
|
||||
},
|
||||
@@ -133,10 +133,10 @@ func TestServer_SetExecution_Request(t *testing.T) {
|
||||
name: "all, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -170,16 +170,17 @@ func TestServer_SetExecution_Request_Include(t *testing.T) {
|
||||
targetResp := Tester.CreateTarget(CTX, t)
|
||||
executionCond := "request"
|
||||
Tester.SetExecution(CTX, t,
|
||||
&execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_All{
|
||||
&execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
[]string{targetResp.GetId()},
|
||||
[]string{},
|
||||
)
|
||||
|
||||
tests := []struct {
|
||||
@@ -193,10 +194,10 @@ func TestServer_SetExecution_Request_Include(t *testing.T) {
|
||||
name: "method, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.SessionService/ListSessions",
|
||||
},
|
||||
},
|
||||
@@ -215,10 +216,10 @@ func TestServer_SetExecution_Request_Include(t *testing.T) {
|
||||
name: "service, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Service{
|
||||
Service: "zitadel.session.v2beta.SessionService",
|
||||
},
|
||||
},
|
||||
@@ -237,10 +238,10 @@ func TestServer_SetExecution_Request_Include(t *testing.T) {
|
||||
name: "all, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -285,10 +286,10 @@ func TestServer_DeleteExecution_Request(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_All{All: true},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_All{All: true},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -299,9 +300,9 @@ func TestServer_DeleteExecution_Request(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -311,10 +312,10 @@ func TestServer_DeleteExecution_Request(t *testing.T) {
|
||||
name: "method, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.SessionService/NotExisting",
|
||||
},
|
||||
},
|
||||
@@ -327,14 +328,14 @@ func TestServer_DeleteExecution_Request(t *testing.T) {
|
||||
name: "method, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.SessionService/GetSession",
|
||||
},
|
||||
},
|
||||
@@ -352,10 +353,10 @@ func TestServer_DeleteExecution_Request(t *testing.T) {
|
||||
name: "service, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Service{
|
||||
Service: "NotExistingService",
|
||||
},
|
||||
},
|
||||
@@ -368,14 +369,14 @@ func TestServer_DeleteExecution_Request(t *testing.T) {
|
||||
name: "service, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_Service{
|
||||
Service: "zitadel.user.v2beta.UserService",
|
||||
},
|
||||
},
|
||||
@@ -393,14 +394,14 @@ func TestServer_DeleteExecution_Request(t *testing.T) {
|
||||
name: "all, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Request{
|
||||
Request: &execution.SetRequestExecution{
|
||||
Condition: &execution.SetRequestExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Request{
|
||||
Request: &execution.RequestExecution{
|
||||
Condition: &execution.RequestExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -448,10 +449,10 @@ func TestServer_SetExecution_Response(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_All{All: true},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_All{All: true},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -462,9 +463,9 @@ func TestServer_SetExecution_Response(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{},
|
||||
},
|
||||
},
|
||||
Targets: []string{targetResp.GetId()},
|
||||
@@ -475,10 +476,10 @@ func TestServer_SetExecution_Response(t *testing.T) {
|
||||
name: "method, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.NotExistingService/List",
|
||||
},
|
||||
},
|
||||
@@ -492,10 +493,10 @@ func TestServer_SetExecution_Response(t *testing.T) {
|
||||
name: "method, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.SessionService/ListSessions",
|
||||
},
|
||||
},
|
||||
@@ -514,10 +515,10 @@ func TestServer_SetExecution_Response(t *testing.T) {
|
||||
name: "service, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Service{
|
||||
Service: "NotExistingService",
|
||||
},
|
||||
},
|
||||
@@ -531,10 +532,10 @@ func TestServer_SetExecution_Response(t *testing.T) {
|
||||
name: "service, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Service{
|
||||
Service: "zitadel.session.v2beta.SessionService",
|
||||
},
|
||||
},
|
||||
@@ -553,10 +554,10 @@ func TestServer_SetExecution_Response(t *testing.T) {
|
||||
name: "all, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -601,10 +602,10 @@ func TestServer_DeleteExecution_Response(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -617,9 +618,9 @@ func TestServer_DeleteExecution_Response(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -629,10 +630,10 @@ func TestServer_DeleteExecution_Response(t *testing.T) {
|
||||
name: "method, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.SessionService/NotExisting",
|
||||
},
|
||||
},
|
||||
@@ -645,14 +646,14 @@ func TestServer_DeleteExecution_Response(t *testing.T) {
|
||||
name: "method, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Method{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Method{
|
||||
Method: "/zitadel.session.v2beta.SessionService/GetSession",
|
||||
},
|
||||
},
|
||||
@@ -670,10 +671,10 @@ func TestServer_DeleteExecution_Response(t *testing.T) {
|
||||
name: "service, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Service{
|
||||
Service: "NotExistingService",
|
||||
},
|
||||
},
|
||||
@@ -686,14 +687,14 @@ func TestServer_DeleteExecution_Response(t *testing.T) {
|
||||
name: "service, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_Service{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_Service{
|
||||
Service: "zitadel.user.v2beta.UserService",
|
||||
},
|
||||
},
|
||||
@@ -711,14 +712,14 @@ func TestServer_DeleteExecution_Response(t *testing.T) {
|
||||
name: "all, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -766,10 +767,10 @@ func TestServer_SetExecution_Event(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -782,9 +783,9 @@ func TestServer_SetExecution_Event(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{},
|
||||
},
|
||||
},
|
||||
Targets: []string{targetResp.GetId()},
|
||||
@@ -798,10 +799,10 @@ func TestServer_SetExecution_Event(t *testing.T) {
|
||||
name: "event, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Event{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Event{
|
||||
Event: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -816,10 +817,10 @@ func TestServer_SetExecution_Event(t *testing.T) {
|
||||
name: "event, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Event{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Event{
|
||||
Event: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -841,10 +842,10 @@ func TestServer_SetExecution_Event(t *testing.T) {
|
||||
name: "group, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Group{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Group{
|
||||
Group: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -859,10 +860,10 @@ func TestServer_SetExecution_Event(t *testing.T) {
|
||||
name: "group, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Group{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Group{
|
||||
Group: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -881,10 +882,10 @@ func TestServer_SetExecution_Event(t *testing.T) {
|
||||
name: "all, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -929,10 +930,10 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -945,9 +946,9 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -959,10 +960,10 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "event, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Event{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Event{
|
||||
Event: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -976,14 +977,14 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "event, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Event{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Event{
|
||||
Event: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -1001,10 +1002,10 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "group, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Group{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Group{
|
||||
Group: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -1017,14 +1018,14 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "group, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_Group{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_Group{
|
||||
Group: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -1042,10 +1043,10 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "all, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -1063,14 +1064,14 @@ func TestServer_DeleteExecution_Event(t *testing.T) {
|
||||
name: "all, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Event{
|
||||
Event: &execution.SetEventExecution{
|
||||
Condition: &execution.SetEventExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Event{
|
||||
Event: &execution.EventExecution{
|
||||
Condition: &execution.EventExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -1118,10 +1119,10 @@ func TestServer_SetExecution_Function(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_All{All: true},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_All{All: true},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1132,9 +1133,9 @@ func TestServer_SetExecution_Function(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{},
|
||||
},
|
||||
},
|
||||
Targets: []string{targetResp.GetId()},
|
||||
@@ -1145,8 +1146,8 @@ func TestServer_SetExecution_Function(t *testing.T) {
|
||||
name: "function, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Function{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Function{
|
||||
Function: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -1158,8 +1159,8 @@ func TestServer_SetExecution_Function(t *testing.T) {
|
||||
name: "function, ok",
|
||||
ctx: CTX,
|
||||
req: &execution.SetExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Function{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Function{
|
||||
Function: "Action.Flow.Type.ExternalAuthentication.Action.TriggerType.PostAuthentication",
|
||||
},
|
||||
},
|
||||
@@ -1202,10 +1203,10 @@ func TestServer_DeleteExecution_Function(t *testing.T) {
|
||||
name: "missing permission",
|
||||
ctx: Tester.WithAuthorization(context.Background(), integration.OrgOwner),
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{
|
||||
Condition: &execution.SetResponseExecution_All{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{
|
||||
Condition: &execution.ResponseExecution_All{
|
||||
All: true,
|
||||
},
|
||||
},
|
||||
@@ -1218,9 +1219,9 @@ func TestServer_DeleteExecution_Function(t *testing.T) {
|
||||
name: "no condition, error",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Response{
|
||||
Response: &execution.SetResponseExecution{},
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Response{
|
||||
Response: &execution.ResponseExecution{},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -1230,8 +1231,8 @@ func TestServer_DeleteExecution_Function(t *testing.T) {
|
||||
name: "function, not existing",
|
||||
ctx: CTX,
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Function{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Function{
|
||||
Function: "xxx",
|
||||
},
|
||||
},
|
||||
@@ -1242,12 +1243,12 @@ func TestServer_DeleteExecution_Function(t *testing.T) {
|
||||
name: "function, ok",
|
||||
ctx: CTX,
|
||||
dep: func(ctx context.Context, request *execution.DeleteExecutionRequest) error {
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()})
|
||||
Tester.SetExecution(ctx, t, request.GetCondition(), []string{targetResp.GetId()}, []string{})
|
||||
return nil
|
||||
},
|
||||
req: &execution.DeleteExecutionRequest{
|
||||
Condition: &execution.SetConditions{
|
||||
ConditionType: &execution.SetConditions_Function{
|
||||
Condition: &execution.Condition{
|
||||
ConditionType: &execution.Condition_Function{
|
||||
Function: "Action.Flow.Type.ExternalAuthentication.Action.TriggerType.PostAuthentication",
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user