mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-25 13:58:46 +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. <[email protected]>
This commit is contained in:
co-authored by
Marco A.
parent
a06ae2c835
commit
51e12e224d
@@ -77,7 +77,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)
|
||||
@@ -145,6 +153,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