mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:37:31 +00:00
feat: actions v2 api GA (#10364)
# Which Problems Are Solved The Actions v2beta API is not yet promoted to GA. # How the Problems Are Solved Promote Actions v2Beta API to Actions v2 API. # Additional Changes None # Additional Context None
This commit is contained in:
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
func TestServer_GetTarget(t *testing.T) {
|
||||
instance := integration.NewInstance(CTX)
|
||||
isolatedIAMOwnerCTX := instance.WithAuthorization(CTX, integration.UserTypeIAMOwner)
|
||||
isolatedIAMOwnerCTX := instance.WithAuthorizationToken(CTX, integration.UserTypeIAMOwner)
|
||||
type args struct {
|
||||
ctx context.Context
|
||||
dep func(context.Context, *action.GetTargetRequest, *action.GetTargetResponse) error
|
||||
@@ -36,7 +36,7 @@ func TestServer_GetTarget(t *testing.T) {
|
||||
{
|
||||
name: "missing permission",
|
||||
args: args{
|
||||
ctx: instance.WithAuthorization(context.Background(), integration.UserTypeOrgOwner),
|
||||
ctx: instance.WithAuthorizationToken(context.Background(), integration.UserTypeOrgOwner),
|
||||
req: &action.GetTargetRequest{},
|
||||
},
|
||||
wantErr: true,
|
||||
@@ -213,7 +213,7 @@ func TestServer_GetTarget(t *testing.T) {
|
||||
|
||||
func TestServer_ListTargets(t *testing.T) {
|
||||
instance := integration.NewInstance(CTX)
|
||||
isolatedIAMOwnerCTX := instance.WithAuthorization(CTX, integration.UserTypeIAMOwner)
|
||||
isolatedIAMOwnerCTX := instance.WithAuthorizationToken(CTX, integration.UserTypeIAMOwner)
|
||||
type args struct {
|
||||
ctx context.Context
|
||||
dep func(context.Context, *action.ListTargetsRequest, *action.ListTargetsResponse)
|
||||
@@ -228,7 +228,7 @@ func TestServer_ListTargets(t *testing.T) {
|
||||
{
|
||||
name: "missing permission",
|
||||
args: args{
|
||||
ctx: instance.WithAuthorization(context.Background(), integration.UserTypeOrgOwner),
|
||||
ctx: instance.WithAuthorizationToken(context.Background(), integration.UserTypeOrgOwner),
|
||||
req: &action.ListTargetsRequest{},
|
||||
},
|
||||
wantErr: true,
|
||||
@@ -445,7 +445,7 @@ func assertPaginationResponse(t *assert.CollectT, expected *filter.PaginationRes
|
||||
|
||||
func TestServer_ListExecutions(t *testing.T) {
|
||||
instance := integration.NewInstance(CTX)
|
||||
isolatedIAMOwnerCTX := instance.WithAuthorization(CTX, integration.UserTypeIAMOwner)
|
||||
isolatedIAMOwnerCTX := instance.WithAuthorizationToken(CTX, integration.UserTypeIAMOwner)
|
||||
targetResp := instance.CreateTarget(isolatedIAMOwnerCTX, t, "", "https://example.com", domain.TargetTypeWebhook, false)
|
||||
|
||||
type args struct {
|
||||
@@ -462,7 +462,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
{
|
||||
name: "missing permission",
|
||||
args: args{
|
||||
ctx: instance.WithAuthorization(context.Background(), integration.UserTypeOrgOwner),
|
||||
ctx: instance.WithAuthorizationToken(context.Background(), integration.UserTypeOrgOwner),
|
||||
req: &action.ListExecutionsRequest{},
|
||||
},
|
||||
wantErr: true,
|
||||
@@ -473,7 +473,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
ctx: isolatedIAMOwnerCTX,
|
||||
dep: func(ctx context.Context, request *action.ListExecutionsRequest, response *action.ListExecutionsResponse) {
|
||||
cond := request.Filters[0].GetInConditionsFilter().GetConditions()[0]
|
||||
resp := instance.SetExecution(ctx, t, cond, []string{targetResp.GetId()})
|
||||
resp := setExecution(ctx, t, instance, cond, []string{targetResp.GetId()})
|
||||
|
||||
// Set expected response with used values for SetExecution
|
||||
response.Executions[0].CreationDate = resp.GetSetDate()
|
||||
@@ -542,7 +542,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
resp := instance.SetExecution(ctx, t, cond, []string{target.GetId()})
|
||||
resp := setExecution(ctx, t, instance, cond, []string{target.GetId()})
|
||||
|
||||
response.Executions[0].CreationDate = resp.GetSetDate()
|
||||
response.Executions[0].ChangeDate = resp.GetSetDate()
|
||||
@@ -603,7 +603,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
}
|
||||
|
||||
cond1 := request.Filters[0].GetInConditionsFilter().GetConditions()[0]
|
||||
resp1 := instance.SetExecution(ctx, t, cond1, []string{targetResp.GetId()})
|
||||
resp1 := setExecution(ctx, t, instance, cond1, []string{targetResp.GetId()})
|
||||
response.Executions[2] = &action.Execution{
|
||||
CreationDate: resp1.GetSetDate(),
|
||||
ChangeDate: resp1.GetSetDate(),
|
||||
@@ -612,7 +612,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
}
|
||||
|
||||
cond2 := request.Filters[0].GetInConditionsFilter().GetConditions()[1]
|
||||
resp2 := instance.SetExecution(ctx, t, cond2, []string{targetResp.GetId()})
|
||||
resp2 := setExecution(ctx, t, instance, cond2, []string{targetResp.GetId()})
|
||||
response.Executions[1] = &action.Execution{
|
||||
CreationDate: resp2.GetSetDate(),
|
||||
ChangeDate: resp2.GetSetDate(),
|
||||
@@ -621,7 +621,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
}
|
||||
|
||||
cond3 := request.Filters[0].GetInConditionsFilter().GetConditions()[2]
|
||||
resp3 := instance.SetExecution(ctx, t, cond3, []string{targetResp.GetId()})
|
||||
resp3 := setExecution(ctx, t, instance, cond3, []string{targetResp.GetId()})
|
||||
response.Executions[0] = &action.Execution{
|
||||
CreationDate: resp3.GetSetDate(),
|
||||
ChangeDate: resp3.GetSetDate(),
|
||||
@@ -652,7 +652,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
dep: func(ctx context.Context, request *action.ListExecutionsRequest, response *action.ListExecutionsResponse) {
|
||||
conditions := request.Filters[0].GetInConditionsFilter().GetConditions()
|
||||
for i, cond := range conditions {
|
||||
resp := instance.SetExecution(ctx, t, cond, []string{targetResp.GetId()})
|
||||
resp := setExecution(ctx, t, instance, cond, []string{targetResp.GetId()})
|
||||
response.Executions[(len(conditions)-1)-i] = &action.Execution{
|
||||
CreationDate: resp.GetSetDate(),
|
||||
ChangeDate: resp.GetSetDate(),
|
||||
@@ -708,7 +708,7 @@ func TestServer_ListExecutions(t *testing.T) {
|
||||
dep: func(ctx context.Context, request *action.ListExecutionsRequest, response *action.ListExecutionsResponse) {
|
||||
conditions := request.Filters[0].GetInConditionsFilter().GetConditions()
|
||||
for i, cond := range conditions {
|
||||
resp := instance.SetExecution(ctx, t, cond, []string{targetResp.GetId()})
|
||||
resp := setExecution(ctx, t, instance, cond, []string{targetResp.GetId()})
|
||||
response.Executions[i] = &action.Execution{
|
||||
CreationDate: resp.GetSetDate(),
|
||||
ChangeDate: resp.GetSetDate(),
|
||||
|
Reference in New Issue
Block a user