sqlguard-ninja 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. sqlguard_ninja/__init__.py +35 -0
  2. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/01_destructive.yaml +169 -0
  3. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/02_multi_statement_and_formatting.yaml +155 -0
  4. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/03_table_and_column_access.yaml +205 -0
  5. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/04_privacy.yaml +245 -0
  6. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/05_tenant_isolation.yaml +167 -0
  7. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/06_cte_nested_unicode.yaml +168 -0
  8. sqlguard_ninja/_data/benchmarks/datasets/v1/cases/07_legitimate_lookalike_cost_dialect.yaml +243 -0
  9. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/grant_matrix.yaml +573 -0
  10. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/label_matrix.yaml +403 -0
  11. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/tenant_matrix.yaml +684 -0
  12. sqlguard_ninja/_data/benchmarks/datasets/v1/generated/transforms.yaml +927 -0
  13. sqlguard_ninja/_data/benchmarks/datasets/v1/manifest.yaml +15 -0
  14. sqlguard_ninja/_data/benchmarks/policies/retail_saas.yaml +259 -0
  15. sqlguard_ninja/_version.py +1 -0
  16. sqlguard_ninja/benchmarking/__init__.py +1 -0
  17. sqlguard_ninja/benchmarking/adapters.py +303 -0
  18. sqlguard_ninja/benchmarking/builtin.py +39 -0
  19. sqlguard_ninja/benchmarking/compare.py +168 -0
  20. sqlguard_ninja/benchmarking/dataset.py +265 -0
  21. sqlguard_ninja/benchmarking/fixtures.py +274 -0
  22. sqlguard_ninja/benchmarking/metrics.py +114 -0
  23. sqlguard_ninja/benchmarking/runner.py +126 -0
  24. sqlguard_ninja/benchmarking/translate.py +64 -0
  25. sqlguard_ninja/benchmarking/workers/_protocol.py +53 -0
  26. sqlguard_ninja/benchmarking/workers/agent_sql_guard_worker.py +40 -0
  27. sqlguard_ninja/benchmarking/workers/krish_sqlguard_worker.py +25 -0
  28. sqlguard_ninja/benchmarking/workers/sql_guardrail_worker.py +48 -0
  29. sqlguard_ninja/cli/__init__.py +1 -0
  30. sqlguard_ninja/cli/config.py +76 -0
  31. sqlguard_ninja/cli/main.py +433 -0
  32. sqlguard_ninja/cli/templates.py +91 -0
  33. sqlguard_ninja/core/__init__.py +1 -0
  34. sqlguard_ninja/core/analysis.py +581 -0
  35. sqlguard_ninja/core/findings.py +133 -0
  36. sqlguard_ninja/core/guard.py +256 -0
  37. sqlguard_ninja/core/rules/__init__.py +1 -0
  38. sqlguard_ninja/core/rules/access.py +127 -0
  39. sqlguard_ninja/core/rules/base.py +40 -0
  40. sqlguard_ninja/core/rules/catalog.py +61 -0
  41. sqlguard_ninja/core/rules/functions.py +197 -0
  42. sqlguard_ninja/core/rules/statements.py +99 -0
  43. sqlguard_ninja/core/rules/structure.py +72 -0
  44. sqlguard_ninja/core/rules/tenant.py +196 -0
  45. sqlguard_ninja/integrations/__init__.py +43 -0
  46. sqlguard_ninja/integrations/audit.py +109 -0
  47. sqlguard_ninja/integrations/checkpoint.py +342 -0
  48. sqlguard_ninja/integrations/executors.py +64 -0
  49. sqlguard_ninja/integrations/fastapi.py +89 -0
  50. sqlguard_ninja/integrations/langchain.py +67 -0
  51. sqlguard_ninja/integrations/langgraph.py +87 -0
  52. sqlguard_ninja/policy/__init__.py +39 -0
  53. sqlguard_ninja/policy/model.py +370 -0
  54. sqlguard_ninja/privacy/__init__.py +9 -0
  55. sqlguard_ninja/privacy/rules.py +286 -0
  56. sqlguard_ninja/privacy/suggest.py +46 -0
  57. sqlguard_ninja/py.typed +0 -0
  58. sqlguard_ninja/query_cost/__init__.py +1 -0
  59. sqlguard_ninja/query_cost/postgres.py +226 -0
  60. sqlguard_ninja/query_cost/static.py +241 -0
  61. sqlguard_ninja/reporting/__init__.py +1 -0
  62. sqlguard_ninja/reporting/markdown.py +137 -0
  63. sqlguard_ninja-0.1.0.dist-info/METADATA +370 -0
  64. sqlguard_ninja-0.1.0.dist-info/RECORD +68 -0
  65. sqlguard_ninja-0.1.0.dist-info/WHEEL +4 -0
  66. sqlguard_ninja-0.1.0.dist-info/entry_points.txt +2 -0
  67. sqlguard_ninja-0.1.0.dist-info/licenses/LICENSE +202 -0
  68. sqlguard_ninja-0.1.0.dist-info/licenses/THIRD_PARTY_NOTICES.md +56 -0
@@ -0,0 +1,56 @@
1
+ # Third-party notices
2
+
3
+ SQLGuard Ninja is licensed under Apache-2.0. **It does not vendor or copy third-party source
4
+ code.** The projects below are used as ordinary dependencies, installed by the package
5
+ manager under their own licences. Licences were read from installed package metadata on
6
+ 2026-10-24. Always check the version you install.
7
+
8
+ ## Runtime dependencies (core install)
9
+
10
+ | Package | Version tested | Licence | Use |
11
+ |---|---|---|---|
12
+ | [sqlglot](https://github.com/tobymao/sqlglot) | 30.24.0 | MIT | SQL parsing, dialects, scope analysis, column qualification |
13
+ | [pydantic](https://github.com/pydantic/pydantic) (+ pydantic-core) | 2.14.1 | MIT | Policy/config schema validation |
14
+ | [PyYAML](https://pyyaml.org/) | 6.0.3 | MIT | Policy and dataset files |
15
+
16
+ ## Optional extras
17
+
18
+ | Extra | Package | Version tested | Licence |
19
+ |---|---|---|---|
20
+ | `langchain` | langchain-core | 1.7.0 | MIT |
21
+ | `langgraph` | langgraph | 1.2.17 | MIT |
22
+ | `fastapi` | fastapi / starlette | 0.162.0 / 1.9.0 | MIT / BSD-3-Clause |
23
+ | `postgres` | psycopg (+ psycopg-binary) | 3.3.6 | LGPL-3.0-only |
24
+
25
+ psycopg is LGPL-3.0. SQLGuard Ninja only imports it at runtime when the `postgres` extra is
26
+ installed. It is not modified or bundled, which is compatible with distributing SQLGuard Ninja
27
+ under Apache-2.0.
28
+
29
+ ## Development and test tools (not distributed)
30
+
31
+ pytest (MIT), pytest-cov (MIT), hypothesis (MPL-2.0), httpx (BSD-3-Clause), ruff (MIT),
32
+ mypy (MIT), build (MIT). `pgserver` is optionally used for local PostgreSQL tests. It is not a
33
+ declared dependency, and its package metadata on PyPI does not declare a licence. It bundles
34
+ PostgreSQL binaries (PostgreSQL License).
35
+
36
+ ## External validators used for benchmarking only
37
+
38
+ Installed into isolated virtual environments by `scripts/setup_external_adapters.py`, never
39
+ redistributed:
40
+
41
+ | Tool | Version | Licence | Source |
42
+ |---|---|---|---|
43
+ | sql-guardrail | 0.5.2 | MIT | https://github.com/nickusevich/sql-guardrail |
44
+ | agent-sql-guard | 0.2.0 | Apache-2.0 declared in `pyproject.toml`; the repository contains no LICENSE file | https://github.com/sakura-sky/sql-guard |
45
+ | sqlguard (krish2105) | git 62327f2 | MIT | https://github.com/krish2105/sqlguard |
46
+
47
+ ## GitHub Actions
48
+
49
+ `actions/checkout`, `actions/setup-python` and `actions/upload-artifact` (MIT, GitHub) are
50
+ referenced by commit SHA in the workflows and the composite action.
51
+
52
+ ## Data
53
+
54
+ All benchmark data and fixture rows are synthetic and were written for this project. Card
55
+ numbers are the published test PAN `4111111111111111`. Emails use the reserved
56
+ `example.com`/`example.org` domains. No third-party datasets were used.