python-terminusgps 1.7.0__tar.gz → 1.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 (28) hide show
  1. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/PKG-INFO +1 -1
  2. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/pyproject.toml +1 -1
  3. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/utils.py +26 -16
  4. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/uv.lock +1 -1
  5. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/.gitignore +0 -0
  6. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/COPYING +0 -0
  7. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/README.md +0 -0
  8. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/requirements.txt +0 -0
  9. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/__init__.py +0 -0
  10. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/authorizenet/__init__.py +0 -0
  11. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/authorizenet/auth.py +0 -0
  12. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/aws/__init__.py +0 -0
  13. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/aws/secrets.py +0 -0
  14. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/settings.py +0 -0
  15. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/test.py +0 -0
  16. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/__init__.py +0 -0
  17. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/constants.py +0 -0
  18. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/errors.py +0 -0
  19. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/flags.py +0 -0
  20. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/__init__.py +0 -0
  21. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/base.py +0 -0
  22. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/resource.py +0 -0
  23. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/retranslator.py +0 -0
  24. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/route.py +0 -0
  25. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/unit.py +0 -0
  26. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/unit_group.py +0 -0
  27. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/items/user.py +0 -0
  28. {python_terminusgps-1.7.0 → python_terminusgps-1.7.1}/terminusgps/wialon/session.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
5
5
  Project-URL: Documentation, https://app.terminusgps.com/docs/apps/python-terminusgps/index.html
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-terminusgps"
3
- version = "1.7.0"
3
+ version = "1.7.1"
4
4
  description = "Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more."
5
5
  readme = "README.md"
6
6
  authors = [ {name = "Blake Nall", email = "blake@terminusgps.com" } ]
@@ -50,23 +50,33 @@ def is_unique(value: str, session: WialonSession, items_type: str = "avl_unit")
50
50
  return not bool(result)
51
51
 
52
52
 
53
- def gen_wialon_password(length: int = 16) -> str:
53
+ def gen_wialon_password(length: int = 32) -> str:
54
54
  """Generates a Wialon compliant password."""
55
- if length > 64:
56
- raise ValueError(f"Passwords cannot be greater than 64 chars. Got '{length}'.")
57
- if length < 4:
58
- raise ValueError(f"Password cannot be less than 4 chars. Got '{length}'.")
59
-
60
- symbols: str = "!@#$%^*()[]-_+"
61
- alphabet: str = string.ascii_letters + string.digits + symbols
62
- password: str = "".join(secrets.choice(alphabet) for _ in range(length - 4))
63
- return (
64
- password
65
- + secrets.choice(string.ascii_lowercase)
66
- + secrets.choice(string.ascii_uppercase)
67
- + secrets.choice(string.digits)
68
- + secrets.choice(symbols)
69
- )
55
+ min_length, max_length = 4, 64
56
+ if length > max_length:
57
+ raise ValueError(
58
+ f"Password cannot be greater than {max_length} characters in length. Got {length}."
59
+ )
60
+ elif length < min_length:
61
+ raise ValueError(
62
+ f"Password cannot be less than {min_length} characters in length. Got {length}."
63
+ )
64
+
65
+ s0 = list(string.ascii_uppercase)
66
+ s1 = list(string.ascii_lowercase)
67
+ s2 = list(string.digits)
68
+ s3 = list("!@#$%^*()[]-_+")
69
+
70
+ while True:
71
+ password = "".join([secrets.choice(s0 + s1 + s2 + s3) for _ in range(length)])
72
+ if (
73
+ any(c.islower() for c in password)
74
+ and any(c.isupper() for c in password)
75
+ and sum(c.isdigit() for c in password) >= 3
76
+ and any(c in s3 for c in password)
77
+ ):
78
+ break
79
+ return password
70
80
 
71
81
 
72
82
  def get_id_from_iccid(iccid: str, session: WialonSession) -> str | None:
@@ -285,7 +285,7 @@ wheels = [
285
285
 
286
286
  [[package]]
287
287
  name = "python-terminusgps"
288
- version = "1.6.0"
288
+ version = "1.7.0"
289
289
  source = { editable = "." }
290
290
  dependencies = [
291
291
  { name = "argparse" },