Complexity limits: max joins, max nesting depth and cartesian products

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

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

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python, sql

調査の方向性

Start with src/sqlguardllm/rules/complexity.py and src/sqlguardllm/policy.py to see how existing rules and policy options are declared, then read tests/corpus/complexity.yaml for the corpus format. Implement max_joins, max_subquery_depth and forbid_cartesian, all off by default, with the too_complex code and English and Spanish messages. Done when the new corpus cases pass and comma joins linked by WHERE still pass. This depends on #3, so check that issue first.

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

説明

area:core area:security size:m type:feature
Goal

Stop queries that are too expensive or too convoluted to be what the user asked for (docs/DESIGN.md#complexity-limits).

Acceptance criteria
  • max_joins, max_subquery_depth and forbid_cartesian policy options, all off by default
  • Joins are counted across all scopes; depth counts nested subqueries and CTEs
  • forbid_cartesian rejects joins without ON/USING whose tables aren't linked by an equality in WHERE, and explicit CROSS JOIN
  • New violation code too_complex with messages in English and Spanish
  • Corpus cases for each limit, plus comma joins with a linking WHERE that must keep working
Relevant files
  • src/sqlguardllm/rules/complexity.py
  • src/sqlguardllm/policy.py
  • tests/corpus/complexity.yaml
Size

M (1-2 days)

Notes
主要言語
Python
スター
0
フォーク
0
平均マージ
1分
マージ済み PR(30日)
2

環境構築

はじめの一歩

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

jmmana/sqlguardllm のほかの issue

jmmana/sqlguardllm の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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