python-terminusgps 1.7.0__py3-none-any.whl → 1.7.1__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.

Potentially problematic release.


This version of python-terminusgps might be problematic. Click here for more details.

@@ -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
@@ -10,7 +10,7 @@ terminusgps/wialon/constants.py,sha256=aybYcNcHyar2lz_6BlQbMWpbcHW6eyJeq05QwuiqZ
10
10
  terminusgps/wialon/errors.py,sha256=SV9pVwU6FZ_zGlGP6zJN6aLE2auF4TfHFISQLiPMKrI,1758
11
11
  terminusgps/wialon/flags.py,sha256=-OoH-eZM54yjRqxsAXL8VImdQu_7C0OAxCrFqaCEuko,13510
12
12
  terminusgps/wialon/session.py,sha256=segEjyt-K9AAlMq_OYLVtxFBp_jE5c3KL-AJQhOVa9U,9936
13
- terminusgps/wialon/utils.py,sha256=yBB3clo_wGPoLyhll7hJ_2vChMdeJV_KffeGq2PhxUY,3151
13
+ terminusgps/wialon/utils.py,sha256=9xJq5eAWm-vu0nJVJ7eUcwhJhMCrGjS1p__4CIBXYm4,3407
14
14
  terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
15
15
  terminusgps/wialon/items/base.py,sha256=Z6aGEC2_m5CPHYCa1rgAvkGtSegbrvZ68mifCqo-07A,6617
16
16
  terminusgps/wialon/items/resource.py,sha256=xElMYSMyKA5y8rIP0EeF429MBV2hbLZcS6SokftvrOs,5641
@@ -19,7 +19,7 @@ terminusgps/wialon/items/route.py,sha256=qOHPN_rejwiGqvwWzlwmUIAIyc3lKavCalf8ki6
19
19
  terminusgps/wialon/items/unit.py,sha256=wzcLa0adMTKX6rtO4Vz6ntaxgY50rLk2KK_VBXlW_lQ,4680
20
20
  terminusgps/wialon/items/unit_group.py,sha256=1yc7ldPIgGbtiTj0djRDWmt6Q9K_VT9sxOaioasbbLY,5212
21
21
  terminusgps/wialon/items/user.py,sha256=bkcMw_YiocaMuhP_pBfB7apjAZwnsOzGScnGkn8Ybbw,6107
22
- python_terminusgps-1.7.0.dist-info/METADATA,sha256=D5bRJDHDFZTiXDsHWU8QOn6_Zk4TaExZ2afP7MTsN2A,882
23
- python_terminusgps-1.7.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
- python_terminusgps-1.7.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
25
- python_terminusgps-1.7.0.dist-info/RECORD,,
22
+ python_terminusgps-1.7.1.dist-info/METADATA,sha256=-KAv1c71Uia0KYMDRSjEdmoINaVnCQM64WI-bdebMCA,882
23
+ python_terminusgps-1.7.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
+ python_terminusgps-1.7.1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
25
+ python_terminusgps-1.7.1.dist-info/RECORD,,
@@ -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: