Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward original payload to delegated destination #451

Open
mcweba opened this issue Mar 30, 2022 · 5 comments
Open

Forward original payload to delegated destination #451

mcweba opened this issue Mar 30, 2022 · 5 comments

Comments

@mcweba
Copy link
Collaborator

mcweba commented Mar 30, 2022

With the delegate feature, one is able to peform two things with delegates:

  • Execute a new request with a new destination and a new payload
  • Transform the json payload of the original request and send it to a new destination

With the current implementation, it is not possible to reuse the orignal payload and send it to a new destination. This feature can be best explained by the Tee command in Linux.

To achieve this, a new property called copy could be introduced. Finally there can be only one of the three properties be present in a delegate:

  • payload
  • transform or transformWithMetadata
  • copy

The need for this feature came up, when we wanted to delegate non-json payloads.

@Kusig
Copy link
Contributor

Kusig commented Mar 30, 2022

So it is basically a NOP Transformation?
The only open question I have is if we should allow really any body content here and if this might introduce any kind of security issue if there is no transformation in between as it will become a black-box mover?

@mcweba
Copy link
Collaborator Author

mcweba commented Mar 31, 2022

Yes I we want to handle this case as a transformation it would be a NOP. Regarding security, we have the same situation for a regular request forwarding (Forwarder) because anything can be forwarded. The only difference to the delegate is, that a copy of the request is forwarded somewhere else.

@lbovet
Copy link
Member

lbovet commented Apr 5, 2022

If we don't do anything on the original payload, in what it differs from a routing rule or a hook?

@mcweba
Copy link
Collaborator Author

mcweba commented Apr 5, 2022

@lbovet good point. It differs from a regular routing rule because it duplicates the request. With a routing rule only, you can forward (or route) only to a single destination.
I also thought about using hooks instead of extending the delegates. In the current implementation of a hook, it's not possible to use a destination including wildcards like the $1. You can just define a "static" destination without any url parameters and url segments from the original request.
Instead of extending the delegates, we could also extend the hooks to be more flexible.

@mcweba
Copy link
Collaborator Author

mcweba commented Aug 8, 2024

See #606. It probably makes more sense to extend the hook feature to accept wildcards.

steniobhz pushed a commit that referenced this issue Aug 8, 2024
steniobhz pushed a commit that referenced this issue Aug 8, 2024
steniobhz pushed a commit that referenced this issue Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants