8000 Conditional primitive supports params in path · Issue #648 · bfenetworks/bfe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Conditional primitive supports params in path #648
Open
@YuqiXiao

Description

@YuqiXiao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0