mcp-dbutils 1.0.1__py3-none-any.whl → 1.0.2__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.
mcp_dbutils/base.py CHANGED
@@ -625,6 +625,9 @@ class ConnectionServer:
625
625
  # 没有细粒度权限控制,默认允许所有写操作
626
626
  return
627
627
 
628
+ # 将表名转换为小写,用于大小写不敏感的比较
629
+ table_name_lower = table_name.lower()
630
+
628
631
  # 检查表级权限
629
632
  tables = write_permissions.get("tables", {})
630
633
  if not tables:
@@ -638,9 +641,12 @@ class ConnectionServer:
638
641
  operation=operation_type, table=table_name
639
642
  ))
640
643
 
641
- # 检查特定表的权限
642
- if table_name in tables:
643
- table_config = tables[table_name]
644
+ # 创建表名到配置的映射,支持大小写不敏感的比较
645
+ tables_lower = {k.lower(): v for k, v in tables.items()}
646
+
647
+ # 检查特定表的权限(大小写不敏感)
648
+ if table_name_lower in tables_lower:
649
+ table_config = tables_lower[table_name_lower]
644
650
  operations = table_config.get("operations", ["INSERT", "UPDATE", "DELETE"])
645
651
  if operation_type in operations:
646
652
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-dbutils
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: MCP Database Utilities Service
5
5
  Author: Dong Hao
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  mcp_dbutils/__init__.py,sha256=6LLccQv7je2L4IpY_I3OzSJZcK32VUDJv2IY31y6eYg,1900
2
2
  mcp_dbutils/audit.py,sha256=U-Fd511HxOQH4BxfCXgd4KyaBLESEBnGsPkUNviSTwc,7294
3
- mcp_dbutils/base.py,sha256=y82luhDlBZbs1HC4V8jqULAl_LLaXwlMagW45Pwdi2M,61598
3
+ mcp_dbutils/base.py,sha256=2KhuovVvSUHV664ppLy1LO4a-CfN2rBF-BrP6eHzIb4,61907
4
4
  mcp_dbutils/config.py,sha256=zwN9yPKv4WvEPG3WIRT6uBVZSRxFniSmN2kEog7KPcI,5921
5
5
  mcp_dbutils/log.py,sha256=mqxi6I_IL-MF1F_pxBtnYZQKOHbGBJ74gsvZHVelr1w,823
6
6
  mcp_dbutils/stats.py,sha256=wMqWPfGnEOg9v5YBtTsARV-1YsFUMM_pKdzitzSU9x4,7137
@@ -16,8 +16,8 @@ mcp_dbutils/sqlite/__init__.py,sha256=fK_3-WylCBYpBAzwuopi8hlwoIGJm2TPAlwcPWG46I
16
16
  mcp_dbutils/sqlite/config.py,sha256=rsfAE8yaCVZC39ziXssqsi0EXUOEWA-MtKHvrO-6jG4,4933
17
17
  mcp_dbutils/sqlite/handler.py,sha256=vpkyCow26hpBqigNUNW0VGyWhsTz8uFflssM7K-FJi4,21882
18
18
  mcp_dbutils/sqlite/server.py,sha256=EBKNKz_wTvChwg6BZlvZIBA1H5mmE2NiNEMOgu_CMy4,7373
19
- mcp_dbutils-1.0.1.dist-info/METADATA,sha256=TwdVxwgEQgqSsMsKg0HglvScfwjlw5o6gRpN7HPu_4I,8440
20
- mcp_dbutils-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
- mcp_dbutils-1.0.1.dist-info/entry_points.txt,sha256=XTjt0QmYRgKOJQT6skR9bp1EMUfIrgpHeZJPZ3CJffs,49
22
- mcp_dbutils-1.0.1.dist-info/licenses/LICENSE,sha256=1A_CwpWVlbjrKdVEYO77vYfnXlW7oxcilZ8FpA_BzCI,1065
23
- mcp_dbutils-1.0.1.dist-info/RECORD,,
19
+ mcp_dbutils-1.0.2.dist-info/METADATA,sha256=hZm7hYfZKEzyNJmYCFNPvdXq0JNkJVOj4IJDbfOuihE,8440
20
+ mcp_dbutils-1.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
+ mcp_dbutils-1.0.2.dist-info/entry_points.txt,sha256=XTjt0QmYRgKOJQT6skR9bp1EMUfIrgpHeZJPZ3CJffs,49
22
+ mcp_dbutils-1.0.2.dist-info/licenses/LICENSE,sha256=1A_CwpWVlbjrKdVEYO77vYfnXlW7oxcilZ8FpA_BzCI,1065
23
+ mcp_dbutils-1.0.2.dist-info/RECORD,,