-
Notifications
You must be signed in to change notification settings - Fork 906
Request/response validators #1701
Copy link
Copy link
Closed
Labels
Type: IdeaThis issue is a high-level idea for discussion.This issue is a high-level idea for discussion.
Milestone
Description
What should we add or change to make your life better?
YARP has request/response transforms. They are useful for what they are.
They do not have the concept of failing a request or response when certain validation criteria are not satisfied. It would be nice to have a similar way to plugin validators that are able to return error responses to the caller.
Why is this important to you?
Two use cases we have
- we want to make sure a certain OAuth access token is available to forward to a remote API. If that token is not available, YARP should return a 401 straight away without proxying to the backend
- require the existence of certain headers (e.g. for antiforgery protection). Again the request should fail immediately.
I know that this could be achieved via middleware - but a mechanism similar to transforms would be less intrusive from configuration point of view.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type: IdeaThis issue is a high-level idea for discussion.This issue is a high-level idea for discussion.