mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-06 14:52:35 +00:00
feat(actionsv2): Propagate request headers in actions v2 (#10632)
# Which Problems Are Solved
This PR adds functionality to propagate request headers in actions v2.
# How the Problems Are Solved
The new functionality is added to the`ExecutionHandler` interceptors,
where the incoming request headers (from a list of allowed headers to be
forwarded) are set in the payload of the request before calling the
target.
# Additional Changes
This PR also contains minor fixes to the Actions V2 example docs.
# Additional Context
- Closes #9941
---------
Co-authored-by: Marco A. <marco@zitadel.com>
(cherry picked from commit 51e12e224d)
This commit is contained in:
committed by
Livio Spring
parent
8cf623d5b5
commit
3e678ceac0
@@ -76,7 +76,15 @@ func TestServer_ExecutionTarget(t *testing.T) {
|
||||
targetCreated := instance.CreateTarget(ctx, t, targetCreatedName, targetCreatedURL, target_domain.TargetTypeCall, false)
|
||||
|
||||
// request received by target
|
||||
wantRequest := &middleware.ContextInfoRequest{FullMethod: fullMethod, InstanceID: instance.ID(), OrgID: orgID, ProjectID: projectID, UserID: userID, Request: middleware.Message{Message: request}}
|
||||
wantRequest := &middleware.ContextInfoRequest{
|
||||
FullMethod: fullMethod,
|
||||
InstanceID: instance.ID(),
|
||||
OrgID: orgID,
|
||||
ProjectID: projectID,
|
||||
UserID: userID,
|
||||
Request: middleware.Message{Message: request},
|
||||
Headers: map[string][]string{"Content-Type": {"application/grpc"}, "Host": {instance.Host()}},
|
||||
}
|
||||
changedRequest := &action.GetTargetRequest{Id: targetCreated.GetId()}
|
||||
// replace original request with different targetID
|
||||
urlRequest, closeRequest, calledRequest, _ := integration.TestServerCallProto(wantRequest, 0, http.StatusOK, changedRequest)
|
||||
@@ -144,6 +152,7 @@ func TestServer_ExecutionTarget(t *testing.T) {
|
||||
UserID: userID,
|
||||
Request: middleware.Message{Message: changedRequest},
|
||||
Response: middleware.Message{Message: expectedResponse},
|
||||
Headers: map[string][]string{"Content-Type": {"application/grpc"}, "Host": {instance.Host()}},
|
||||
}
|
||||
// after request with different targetID, return changed response
|
||||
targetResponseURL, closeResponse, calledResponse, _ := integration.TestServerCallProto(wantResponse, 0, http.StatusOK, changedResponse)
|
||||
|
||||
Reference in New Issue
Block a user