nc-py-api 0.20.0__tar.gz → 0.20.1__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 (54) hide show
  1. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/CHANGELOG.md +6 -0
  2. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/PKG-INFO +1 -1
  3. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_version.py +1 -1
  4. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/integration_fastapi.py +1 -1
  5. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/files/_files.py +13 -1
  6. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/pyproject.toml +0 -3
  7. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/.gitignore +0 -0
  8. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/AUTHORS +0 -0
  9. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/LICENSE.txt +0 -0
  10. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/README.md +0 -0
  11. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/__init__.py +0 -0
  12. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_deffered_error.py +0 -0
  13. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_exceptions.py +0 -0
  14. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_misc.py +0 -0
  15. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_preferences.py +0 -0
  16. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_preferences_ex.py +0 -0
  17. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_session.py +0 -0
  18. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_talk_api.py +0 -0
  19. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/_theming.py +0 -0
  20. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/activity.py +0 -0
  21. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/apps.py +0 -0
  22. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/calendar_api.py +0 -0
  23. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/__init__.py +0 -0
  24. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/defs.py +0 -0
  25. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/logger.py +0 -0
  26. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/misc.py +0 -0
  27. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/occ_commands.py +0 -0
  28. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/persist_transformers_cache.py +0 -0
  29. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/providers/__init__.py +0 -0
  30. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/providers/providers.py +0 -0
  31. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/providers/task_processing.py +0 -0
  32. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/ui/__init__.py +0 -0
  33. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/ui/files_actions.py +0 -0
  34. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/ui/resources.py +0 -0
  35. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/ui/settings.py +0 -0
  36. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/ui/top_menu.py +0 -0
  37. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/ui/ui.py +0 -0
  38. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/ex_app/uvicorn_fastapi.py +0 -0
  39. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/files/__init__.py +0 -0
  40. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/files/files.py +0 -0
  41. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/files/files_async.py +0 -0
  42. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/files/sharing.py +0 -0
  43. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/loginflow_v2.py +0 -0
  44. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/nextcloud.py +0 -0
  45. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/notes.py +0 -0
  46. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/notifications.py +0 -0
  47. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/options.py +0 -0
  48. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/talk.py +0 -0
  49. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/talk_bot.py +0 -0
  50. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/user_status.py +0 -0
  51. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/users.py +0 -0
  52. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/users_groups.py +0 -0
  53. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/weather_status.py +0 -0
  54. {nc_py_api-0.20.0 → nc_py_api-0.20.1}/nc_py_api/webhooks.py +0 -0
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.20.1 - 2025-05-06]
6
+
7
+ ### Fixed
8
+
9
+ - ExApps: `AppAPIAuthMiddleware`: correct handling of `disable_for` parameter. #357 Thanks to @BerengarWLehr
10
+
5
11
  ## [0.20.0 - 2025-04-28]
6
12
 
7
13
  ### Changed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nc-py-api
3
- Version: 0.20.0
3
+ Version: 0.20.1
4
4
  Summary: Nextcloud Python Framework
5
5
  Project-URL: Changelog, https://github.com/cloud-py-api/nc_py_api/blob/main/CHANGELOG.md
6
6
  Project-URL: Documentation, https://cloud-py-api.github.io/nc_py_api/
@@ -1,3 +1,3 @@
1
1
  """Version of nc_py_api."""
2
2
 
3
- __version__ = "0.20.0"
3
+ __version__ = "0.20.1"
@@ -247,7 +247,7 @@ class AppAPIAuthMiddleware:
247
247
 
248
248
  conn = HTTPConnection(scope)
249
249
  url_path = conn.url.path.lstrip("/")
250
- if not fnmatch.filter(self._disable_for, url_path):
250
+ if not any(fnmatch.fnmatch(url_path, i) for i in self._disable_for):
251
251
  try:
252
252
  scope["username"] = _request_sign_check(conn, AsyncNextcloudApp())
253
253
  except HTTPException as exc:
@@ -1,8 +1,10 @@
1
1
  """Helper functions for **FilesAPI** and **AsyncFilesAPI** classes."""
2
2
 
3
3
  import enum
4
+ from datetime import datetime, timezone
4
5
  from io import BytesIO
5
6
  from json import dumps, loads
7
+ from typing import Any
6
8
  from urllib.parse import unquote
7
9
  from xml.etree import ElementTree
8
10
 
@@ -69,6 +71,16 @@ def get_propfind_properties(capabilities: dict) -> list:
69
71
  return r
70
72
 
71
73
 
74
+ def _dav_literal(val: Any) -> str:
75
+ """Return a string suitable for <d:literal>."""
76
+ if isinstance(val, datetime):
77
+ # make timezone-aware, force UTC, second precision
78
+ dt = val if val.tzinfo else val.replace(tzinfo=timezone.utc)
79
+ dt = dt.astimezone(timezone.utc).replace(microsecond=0)
80
+ return dt.isoformat().replace("+00:00", "Z") # 2025-03-10T12:34:56Z
81
+ return str(val)
82
+
83
+
72
84
  def build_find_request(req: list, path: str | FsNode, user: str, capabilities: dict) -> ElementTree.Element:
73
85
  path = path.user_path if isinstance(path, FsNode) else path
74
86
  root = ElementTree.Element(
@@ -126,7 +138,7 @@ def build_search_req(xml_element_where, req: list) -> None:
126
138
  ElementTree.SubElement(_, SEARCH_PROPERTIES_MAP[req.pop(0)])
127
139
  _ = ElementTree.SubElement(_root, "d:literal")
128
140
  value = req.pop(0)
129
- _.text = value if isinstance(value, str) else str(value)
141
+ _.text = _dav_literal(value)
130
142
 
131
143
  while len(req):
132
144
  where_part = req.pop(0)
@@ -104,9 +104,6 @@ exclude = [
104
104
 
105
105
  [tool.black]
106
106
  line-length = 120
107
- target-versions = [
108
- "py310",
109
- ]
110
107
  preview = true
111
108
 
112
109
  [tool.ruff]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes