sendora 2.7.0__tar.gz → 2.7.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 (40) hide show
  1. {sendora-2.7.0 → sendora-2.7.1}/CHANGELOG.md +7 -0
  2. {sendora-2.7.0 → sendora-2.7.1}/PKG-INFO +1 -1
  3. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_version.py +1 -1
  4. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_webhooks.py +8 -1
  5. {sendora-2.7.0 → sendora-2.7.1}/.gitignore +0 -0
  6. {sendora-2.7.0 → sendora-2.7.1}/LICENSE +0 -0
  7. {sendora-2.7.0 → sendora-2.7.1}/README.md +0 -0
  8. {sendora-2.7.0 → sendora-2.7.1}/pyproject.toml +0 -0
  9. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/__init__.py +0 -0
  10. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_account.py +0 -0
  11. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_answers.py +0 -0
  12. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_client.py +0 -0
  13. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_errors.py +0 -0
  14. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_json.py +0 -0
  15. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_keys.py +0 -0
  16. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_model.py +0 -0
  17. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_options.py +0 -0
  18. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_pages.py +0 -0
  19. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_retry.py +0 -0
  20. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_transport.py +0 -0
  21. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/_wire.py +0 -0
  22. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/py.typed +0 -0
  23. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/__init__.py +0 -0
  24. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/broadcasts.py +0 -0
  25. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/domains.py +0 -0
  26. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/email.py +0 -0
  27. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/erasures.py +0 -0
  28. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/inbound.py +0 -0
  29. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/inbound_domains.py +0 -0
  30. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/messages.py +0 -0
  31. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/server.py +0 -0
  32. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/servers.py +0 -0
  33. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/streams.py +0 -0
  34. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/suppressions.py +0 -0
  35. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/tokens.py +0 -0
  36. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/tracking_domains.py +0 -0
  37. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/tracking_opt_outs.py +0 -0
  38. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/resources/webhooks.py +0 -0
  39. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/skills/sendora/SKILL.md +0 -0
  40. {sendora-2.7.0 → sendora-2.7.1}/src/sendora/types.py +0 -0
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.7.1
4
+
5
+ - `verify_webhook` takes the same whitespace around a part of the
6
+ `Sendora-Signature` header as the other SDKs do. It takes a byte order
7
+ mark, and no longer takes U+0085 or an ASCII separator. Every header
8
+ that Sendora sends verifies as before.
9
+
3
10
  ## 2.7.0
4
11
 
5
12
  - A new error code, `daily_cap_reached`. An account can have a daily cap,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: sendora
3
- Version: 2.7.0
3
+ Version: 2.7.1
4
4
  Summary: The Python client for Sendora's email API.
5
5
  Project-URL: Homepage, https://sendora.se/docs
6
6
  License-Expression: MIT
@@ -1,3 +1,3 @@
1
1
  """The package's version: the build reads it, and every request names it."""
2
2
 
3
- __version__ = "2.7.0"
3
+ __version__ = "2.7.1"
@@ -39,6 +39,13 @@ DEFAULT_TOLERANCE = 300
39
39
  _SECONDS = re.compile(r"[0-9]{1,18}", re.ASCII)
40
40
  _MAC = re.compile(r"[0-9a-fA-F]{64}", re.ASCII)
41
41
 
42
+ # What ECMAScript's trim() strips, as the TypeScript SDK does. A bare
43
+ # strip() also takes U+001C to U+001F and U+0085, and keeps U+FEFF.
44
+ _WHITESPACE = (
45
+ "\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006"
46
+ "\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff"
47
+ )
48
+
42
49
 
43
50
  def verify_webhook(
44
51
  body: bytes | str,
@@ -111,7 +118,7 @@ def _parsed(header: str | None) -> tuple[int, list[str]]:
111
118
  macs: list[str] = []
112
119
  for part in header.split(","):
113
120
  name, separator, value = part.partition("=")
114
- name, value = name.strip(), value.strip()
121
+ name, value = name.strip(_WHITESPACE), value.strip(_WHITESPACE)
115
122
  if not separator or not name:
116
123
  continue
117
124
  if name == "t":
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes