Skip to content

Request/response validators #1701

@leastprivilege

Description

@leastprivilege

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

  1. 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
  2. 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.

Metadata

Metadata

Assignees

Labels

Type: IdeaThis issue is a high-level idea for discussion.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions