mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:47:33 +00:00
fix: remove action feature flag and include execution (#9727)
# Which Problems Are Solved Actions v2 is not a feature flag anymore, include functionality on executions is not used and json tags of proto messages are handled incorrectly. # How the Problems Are Solved - Remove actions from the feature flags on system and instance level - Remove include type on executions, only in the API, later maybe in the handling logic as well - Use protojson in request and response handling of actions v2 # Additional Changes - Correct integration tests for request and response handling - Use json.RawMessage for events, so that the event payload is not base64 encoded - Added separate context for async webhook calls, that executions are not cancelled when called async # Additional Context Related to #9759 Closes #9710 --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/execution"
|
||||
@@ -54,28 +57,28 @@ func (e *mockExecutionTarget) GetSigningKey() string {
|
||||
return e.SigningKey
|
||||
}
|
||||
|
||||
type mockContentRequest struct {
|
||||
Content string
|
||||
}
|
||||
|
||||
func newMockContentRequest(content string) *mockContentRequest {
|
||||
return &mockContentRequest{
|
||||
Content: content,
|
||||
func newMockContentRequest(content string) proto.Message {
|
||||
return &structpb.Struct{
|
||||
Fields: map[string]*structpb.Value{
|
||||
"content": {
|
||||
Kind: &structpb.Value_StringValue{StringValue: content},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func newMockContextInfoRequest(fullMethod, request string) *ContextInfoRequest {
|
||||
return &ContextInfoRequest{
|
||||
FullMethod: fullMethod,
|
||||
Request: newMockContentRequest(request),
|
||||
Request: Message{Message: newMockContentRequest(request)},
|
||||
}
|
||||
}
|
||||
|
||||
func newMockContextInfoResponse(fullMethod, request, response string) *ContextInfoResponse {
|
||||
return &ContextInfoResponse{
|
||||
FullMethod: fullMethod,
|
||||
Request: newMockContentRequest(request),
|
||||
Response: newMockContentRequest(response),
|
||||
Request: Message{Message: newMockContentRequest(request)},
|
||||
Response: Message{Message: newMockContentRequest(response)},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,7 +594,7 @@ func Test_executeTargetsForGRPCFullMethod_request(t *testing.T) {
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.res.want, resp)
|
||||
assert.EqualExportedValues(t, tt.res.want, resp)
|
||||
|
||||
for _, closeF := range closeFuncs {
|
||||
closeF()
|
||||
@@ -632,7 +635,7 @@ func testServerCall(
|
||||
time.Sleep(sleep)
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
resp, err := json.Marshal(respBody)
|
||||
resp, err := protojson.Marshal(respBody.(proto.Message))
|
||||
if err != nil {
|
||||
http.Error(w, "error", http.StatusInternalServerError)
|
||||
return
|
||||
@@ -723,7 +726,8 @@ func Test_executeTargetsForGRPCFullMethod_response(t *testing.T) {
|
||||
statusCode: http.StatusOK,
|
||||
},
|
||||
},
|
||||
req: []byte{},
|
||||
req: newMockContentRequest(""),
|
||||
resp: newMockContentRequest(""),
|
||||
},
|
||||
res{
|
||||
wantErr: true,
|
||||
@@ -790,7 +794,7 @@ func Test_executeTargetsForGRPCFullMethod_response(t *testing.T) {
|
||||
} else {
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
assert.Equal(t, tt.res.want, resp)
|
||||
assert.EqualExportedValues(t, tt.res.want, resp)
|
||||
|
||||
for _, closeF := range closeFuncs {
|
||||
closeF()
|
||||
|
Reference in New Issue
Block a user