feat: As a user, I want to add metadata to routes, so that I can filter global plugins configuration by _meta.filter with this metadata

オープン
#12,997 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
lua
領域
api

調査の方向性

まず、既存のルート設定とグローバルプラグインの _meta.filter の動作を確認し、特に現在 $route_name がどのように使われているかを確認します。実装のエントリポイントを特定する前に、提案されているルートメタデータの形状とフィルタリングのセマンティクスについてメンテナーと合意を取ります。完了条件には、合意された機能設計と、グローバルプラグインフィルターでメタデータを照合する際の対応する動作が含まれます。

索引モデルが issue の本文から書いたものです。

説明

feature-request
Description
Problem description

We are using apisix with global configuration for a huge number of routes created by different teams. In this context, a global rate limit configuration plugin was deployed, but there are instances were this global configuration should be skipped in favor of a different, more permissive one.

We know it's possible to remove the global configuration and make plugin configurations shared and referenced between routes, but we want to still preserve the global rule as a default, instead of relying on routes to attach to a plugin definition, because otherwise we can't enforce that.

We came to a solution where we append special string on route names to be able to disable this global rate limit configuration on some routes, by using the _meta.filter property, and matching this special string on the $route_name variable.

Feature request

Having done this, it occurred to us that it may be useful to add metadata to a route, and be able to use it in the plugin's _meta.filter property, so we can share a common default behavior, but also skippable if requested.

I wanted to discuss if it's a common case, enough to justify this as a new feature, or maybe I'm just guessing too much and there are different solutions to this problem.

Thank you.

主要言語
Lua
スター
17.3k
フォーク
3k
平均マージ
4日 16時間
マージ済み PR(30日)
69

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/apisix のほかの issue

apache/apisix の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。