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

Conditional primitive supports params in path #648

Open
YuqiXiao opened this issue Sep 10, 2020 · 0 comments
Open

Conditional primitive supports params in path #648

YuqiXiao opened this issue Sep 10, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@YuqiXiao
Copy link
Member

Is your feature request related to a problem? Please describe.
Path route rule supported by BFE is req_path_in(/user), req_path_prefix_in(/user), req_path_suffix_in(user) which deals with path like /user, /user.* or .* user. But what if i want to add route rule like RESTFUL API path /teams/{teamId}/users/{userId}.

Describe the solution you'd like
Support a kind of conditional primitive to solve path like /teams/{teamId}/users/{userId} and extract params to request.

As route_rule: {req_params(/teams/{teamId}/users/{userId}), clusterName: "cluster"} , when facing with request's path: /teams/1/users/3 BFE could:

  • match route rule and send the traffic to cluster;
  • extract variables of the path and save the variables in request {"teamId": "1", "userId": "3"};

Describe alternatives you've considered
Here is the example: mux

@iyangsj iyangsj added the enhancement New feature or request label Sep 11, 2020
@iyangsj iyangsj added this to the Proposal milestone Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants