Skip to content

feat: As a User, I want to be able to configure the priority of each plugin so I don't need to change the source code #6504

Description

@nfrankel

Issue description

Use-case

To test a new version of my endpoint, I want to use the proxy-mirror plugin.

The incoming request is /v1/hello. I'm using the proxy-rewrite plugin to rewrite the path to /hello before sending it to the upstream. However, the priority of proxy-rewrite is 1008; the priority of proxy-mirror 1010.

For this reason, the mirroring is first applied, sending /v1/hello to the mirror host, and only then is the rewrite applied, sending /hello to the nominal upstream. The mirror returns 404, as it doesn't know about v1. I need the opposite, first rewrite, then mirror.

Alternative solutions

  • Change the respective priority of proxy-mirror and proxy-rewrite to execute rewrite before mirror.

    Pro: easy fix
    Cons:

    • Breaking change
    • Some users may want to keep the current order
  • Move the ordering to configuration. Instead of having the priority in the source code, make it a runtime concern.

    Pro: very flexible
    Cons:

    • Breaking change
    • Require configuring the order, even if the current one fits
  • Allow to override default order. Keep the default priority in the source code, but allows overriding it in configuration

    Pro:

    • Very flexible
    • Compatible with existing usage

    Con: design and development effort

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions