fastapi-authly 0.1.5__tar.gz → 0.1.7__tar.gz

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 (52) hide show
  1. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/PKG-INFO +2 -2
  2. fastapi_authly-0.1.7/ScienceClaw-master.zip +0 -0
  3. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/pyproject.toml +2 -2
  4. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/__about__.py +1 -1
  5. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/charts.py +32 -3
  6. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/docs.py +1 -1
  7. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/uv.lock +15 -15
  8. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/.gitignore +0 -0
  9. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/LICENSE +0 -0
  10. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/README.md +0 -0
  11. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/README.zh.md +0 -0
  12. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/docs//345/207/275/346/225/260/345/274/217/347/274/226/347/250/213/344/270/203/346/255/246/345/231/250.md" +0 -0
  13. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/examples/correct_usage.py +0 -0
  14. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/.gitignore +0 -0
  15. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/class_index.html +0 -0
  16. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/coverage_html_cb_dd2e7eb5.js +0 -0
  17. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/favicon_32_cb_c827f16f.png +0 -0
  18. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/function_index.html +0 -0
  19. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/index.html +0 -0
  20. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/keybd_closed_cb_900cfef5.png +0 -0
  21. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/status.json +0 -0
  22. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/style_cb_9ff733b0.css +0 -0
  23. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_af1bec017750c6fc___init___py.html +0 -0
  24. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_af1bec017750c6fc_user_py.html +0 -0
  25. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e___about___py.html +0 -0
  26. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e___init___py.html +0 -0
  27. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e_auth_py.html +0 -0
  28. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_b9d93864b1b0ad6e_interfaces_py.html +0 -0
  29. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_d015ea9b27b0258e___init___py.html +0 -0
  30. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_d015ea9b27b0258e_config_py.html +0 -0
  31. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_d015ea9b27b0258e_security_py.html +0 -0
  32. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_ddd01122054512b0___init___py.html +0 -0
  33. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_ddd01122054512b0_tortoise_pg_py.html +0 -0
  34. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_feee2d9ae7f7fd96___init___py.html +0 -0
  35. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/htmlcov/z_feee2d9ae7f7fd96_user_py.html +0 -0
  36. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/__init__.py +0 -0
  37. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/auth.py +0 -0
  38. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/contrib/__init__.py +0 -0
  39. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/contrib/tortoise_pg.py +0 -0
  40. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/core/__init__.py +0 -0
  41. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/core/config.py +0 -0
  42. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/core/security.py +0 -0
  43. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/deps.py +0 -0
  44. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/interfaces.py +0 -0
  45. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/models/__init__.py +0 -0
  46. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/models/user.py +0 -0
  47. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/schemas/__init__.py +0 -0
  48. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/schemas/user.py +0 -0
  49. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/static/echarts.min.js +0 -0
  50. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/static/favicon.svg +0 -0
  51. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/static/scalar/standalone.js +0 -0
  52. {fastapi_authly-0.1.5 → fastapi_authly-0.1.7}/src/fastapi_authly/static/scalar/style.css +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-authly
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: A modular authentication system for FastAPI with OAuth2, JWT, and password recovery
5
5
  Project-URL: Homepage, https://github.com/yourusername/fastapi-auth-module
6
6
  Project-URL: Documentation, https://yourusername.github.io/fastapi-auth-module/
@@ -29,10 +29,10 @@ Requires-Dist: asyncpg>=0.31.0
29
29
  Requires-Dist: emails>=0.6.0
30
30
  Requires-Dist: fastapi>=0.100.0
31
31
  Requires-Dist: jinja2>=3.0.0
32
- Requires-Dist: jwt>=1.3.1
33
32
  Requires-Dist: passlib[bcrypt]>=1.7.4
34
33
  Requires-Dist: pydantic-settings>=2.1.0
35
34
  Requires-Dist: pydantic[email]>=2.0.0
35
+ Requires-Dist: pyjwt>=2.12.1
36
36
  Requires-Dist: python-jose[cryptography]>=3.3.0
37
37
  Requires-Dist: python-multipart>=0.0.6
38
38
  Requires-Dist: tortoise-orm[psycopg]>=0.25.3
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "fastapi-authly"
7
- version = "0.1.5"
7
+ version = "0.1.7"
8
8
  description = "A modular authentication system for FastAPI with OAuth2, JWT, and password recovery"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -47,10 +47,10 @@ dependencies = [
47
47
  "passlib[bcrypt]>=1.7.4",
48
48
  "emails>=0.6.0",
49
49
  "jinja2>=3.0.0",
50
- "jwt>=1.3.1",
51
50
  "tortoise-orm[psycopg]>=0.25.3",
52
51
  "uvicorn>=0.40.0",
53
52
  "asyncpg>=0.31.0",
53
+ "pyjwt>=2.12.1",
54
54
  ]
55
55
 
56
56
  [project.optional-dependencies]
@@ -1,3 +1,3 @@
1
1
  """Version information."""
2
2
 
3
- __version__ = "0.1.5"
3
+ __version__ = "0.1.7"
@@ -105,7 +105,7 @@ def engine_make_snapshot(
105
105
  file_type: str,
106
106
  *,
107
107
  pixel_ratio: int = 2,
108
- delay: float = 2,
108
+ delay: float = 1,
109
109
  driver: Any = None,
110
110
  chrome_headless_path: str | Path | None = None,
111
111
  chromedriver_path: str | Path | None = None,
@@ -116,6 +116,7 @@ def engine_make_snapshot(
116
116
  """
117
117
  if delay < 0:
118
118
  raise ValueError("delay 不能为负数")
119
+ _external_driver = driver is not None
119
120
  if driver is None:
120
121
  driver = get_driver(
121
122
  chrome_headless_path=chrome_headless_path,
@@ -129,10 +130,33 @@ def engine_make_snapshot(
129
130
  html_path = "file://" + os.path.abspath(html_path)
130
131
  try:
131
132
  driver.get(html_path)
132
- time.sleep(delay)
133
+ if delay > 0:
134
+ # 优先用 JS 轮询等待 ECharts 实例就绪(最多等 delay 秒),避免无谓的固定等待
135
+ _wait_js = """
136
+ var done = arguments[arguments.length - 1];
137
+ var deadline = Date.now() + %d;
138
+ function check() {
139
+ var ele = document.querySelector('div[_echarts_instance_]');
140
+ if (ele && echarts.getInstanceByDom(ele)) {
141
+ done(true);
142
+ } else if (Date.now() < deadline) {
143
+ setTimeout(check, 50);
144
+ } else {
145
+ done(false);
146
+ }
147
+ }
148
+ check();
149
+ """ % int(delay * 1000)
150
+ try:
151
+ driver.set_script_timeout(delay + 1)
152
+ driver.execute_async_script(_wait_js)
153
+ except Exception:
154
+ time.sleep(delay)
133
155
  return driver.execute_script(snapshot_js)
134
156
  finally:
135
- driver.quit()
157
+ # 仅当 driver 由本函数内部创建时才 quit;外部传入的 driver 由调用方管理生命周期
158
+ if not _external_driver:
159
+ driver.quit()
136
160
 
137
161
 
138
162
  def echarts_option_to_html(
@@ -162,6 +186,11 @@ def echarts_option_to_html(
162
186
  var chartDom = document.getElementById("main");
163
187
  var myChart = echarts.init(chartDom);
164
188
  var option = {option_json};
189
+ // 强制关闭所有动画,确保截图时图表已完整渲染
190
+ if (option.animation === undefined) option.animation = false;
191
+ if (option.series) {{
192
+ option.series.forEach(function(s) {{ s.animation = false; }});
193
+ }}
165
194
  myChart.setOption(option);
166
195
  </script>
167
196
  </body>
@@ -13,12 +13,12 @@ def get_static_dir() -> Path:
13
13
  """获取包内静态文件目录路径"""
14
14
  return Path(__file__).parent / "static"
15
15
 
16
+ static_url = "/static"
16
17
 
17
18
  def setup_scalar_docs(
18
19
  app: FastAPI,
19
20
  *,
20
21
  docs_url: str = "/docs",
21
- static_url: str = "/static",
22
22
  title: Optional[str] = None,
23
23
  openapi_url: Optional[str] = None,
24
24
  favicon_url: Optional[str] = None,
@@ -643,17 +643,17 @@ wheels = [
643
643
 
644
644
  [[package]]
645
645
  name = "fastapi-authly"
646
- version = "0.1.4"
646
+ version = "0.1.6"
647
647
  source = { editable = "." }
648
648
  dependencies = [
649
649
  { name = "asyncpg" },
650
650
  { name = "emails" },
651
651
  { name = "fastapi" },
652
652
  { name = "jinja2" },
653
- { name = "jwt" },
654
653
  { name = "passlib", extra = ["bcrypt"] },
655
654
  { name = "pydantic", extra = ["email"] },
656
655
  { name = "pydantic-settings" },
656
+ { name = "pyjwt" },
657
657
  { name = "python-jose", extra = ["cryptography"] },
658
658
  { name = "python-multipart" },
659
659
  { name = "tortoise-orm", extra = ["psycopg"] },
@@ -691,12 +691,12 @@ requires-dist = [
691
691
  { name = "fastapi", specifier = ">=0.100.0" },
692
692
  { name = "httpx", marker = "extra == 'test'", specifier = ">=0.25.0" },
693
693
  { name = "jinja2", specifier = ">=3.0.0" },
694
- { name = "jwt", specifier = ">=1.3.1" },
695
694
  { name = "mkdocs", marker = "extra == 'docs'", specifier = ">=1.5.0" },
696
695
  { name = "mkdocs-material", marker = "extra == 'docs'", specifier = ">=9.0.0" },
697
696
  { name = "passlib", extras = ["bcrypt"], specifier = ">=1.7.4" },
698
697
  { name = "pydantic", extras = ["email"], specifier = ">=2.0.0" },
699
698
  { name = "pydantic-settings", specifier = ">=2.1.0" },
699
+ { name = "pyjwt", specifier = ">=2.12.1" },
700
700
  { name = "pytest", marker = "extra == 'test'", specifier = ">=7.0.0" },
701
701
  { name = "pytest-asyncio", marker = "extra == 'test'", specifier = ">=0.21.0" },
702
702
  { name = "python-jose", extras = ["cryptography"], specifier = ">=3.3.0" },
@@ -864,18 +864,6 @@ wheels = [
864
864
  { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
865
865
  ]
866
866
 
867
- [[package]]
868
- name = "jwt"
869
- version = "1.4.0"
870
- source = { registry = "https://pypi.org/simple" }
871
- dependencies = [
872
- { name = "cryptography" },
873
- ]
874
- sdist = { url = "https://files.pythonhosted.org/packages/7f/20/21254c9e601e6c29445d1e8854c2a81bdb554e07a82fb1f9846137a6965c/jwt-1.4.0.tar.gz", hash = "sha256:f6f789128ac247142c79ee10f3dba6e366ec4e77c9920d18c1592e28aa0a7952", size = 24911, upload-time = "2025-06-23T13:28:38.289Z" }
875
- wheels = [
876
- { url = "https://files.pythonhosted.org/packages/b9/80/34e3fae850adb0b7b8b9b1cf02b2d975fcb68e0e8eb7d56d6b4fc23f7433/jwt-1.4.0-py3-none-any.whl", hash = "sha256:7560a7f1de4f90de94ac645ee0303ac60c95b9e08e058fb69f6c330f71d71b11", size = 18248, upload-time = "2025-06-23T13:28:37.012Z" },
877
- ]
878
-
879
867
  [[package]]
880
868
  name = "lxml"
881
869
  version = "6.0.2"
@@ -1563,6 +1551,18 @@ wheels = [
1563
1551
  { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" },
1564
1552
  ]
1565
1553
 
1554
+ [[package]]
1555
+ name = "pyjwt"
1556
+ version = "2.12.1"
1557
+ source = { registry = "https://pypi.org/simple" }
1558
+ dependencies = [
1559
+ { name = "typing-extensions", marker = "python_full_version < '3.11'" },
1560
+ ]
1561
+ sdist = { url = "https://files.pythonhosted.org/packages/c2/27/a3b6e5bf6ff856d2509292e95c8f57f0df7017cf5394921fc4e4ef40308a/pyjwt-2.12.1.tar.gz", hash = "sha256:c74a7a2adf861c04d002db713dd85f84beb242228e671280bf709d765b03672b", size = 102564, upload-time = "2026-03-13T19:27:37.25Z" }
1562
+ wheels = [
1563
+ { url = "https://files.pythonhosted.org/packages/e5/7a/8dd906bd22e79e47397a61742927f6747fe93242ef86645ee9092e610244/pyjwt-2.12.1-py3-none-any.whl", hash = "sha256:28ca37c070cad8ba8cd9790cd940535d40274d22f80ab87f3ac6a713e6e8454c", size = 29726, upload-time = "2026-03-13T19:27:35.677Z" },
1564
+ ]
1565
+
1566
1566
  [[package]]
1567
1567
  name = "pymdown-extensions"
1568
1568
  version = "10.20"
File without changes
File without changes