python-terminusgps 28.3.0__py3-none-any.whl → 28.4.0__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: 28.3.0
3
+ Version: 28.4.0
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,5 +1,5 @@
1
1
  terminusgps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- terminusgps/settings.py,sha256=UBj2tvuBzQDEz05PeFqHG4_ise3Bl6Iu7pxcrtjNaYE,568
2
+ terminusgps/settings.py,sha256=vY5yNjyMu-7Ya0bIPWUvrrSLERtxHGdkfeoY4Ul6cP0,613
3
3
  terminusgps/authorizenet/__init__.py,sha256=LiGLlWNNiqS7RSOP4Apabx-b9EBYyNbxRY_a0mvJoaE,466
4
4
  terminusgps/authorizenet/auth.py,sha256=ICxPPzoUc64VbsIIemEWKrn8xjHGwbNdo2VbtaFCFss,1107
5
5
  terminusgps/authorizenet/errors.py,sha256=HG5NwVxQCtOYidVl30y49PC0Ovw5VYdsy9wTgUFMw9M,949
@@ -11,6 +11,7 @@ terminusgps/authorizenet/profiles/customers.py,sha256=-F8IsQEn2CyHpfxyVZjKayHSuV
11
11
  terminusgps/authorizenet/profiles/payments.py,sha256=ohhZrs9MB7GkCi7jQvPVvELNKnR9BwzMd607jJmT4n4,11316
12
12
  terminusgps/authorizenet/profiles/subscriptions.py,sha256=zqXc-Cge8-a7mGWsDf7n2wH_JolmSHnbPYWKGwFCA_k,13120
13
13
  terminusgps/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ terminusgps/aws/connect.py,sha256=jqx9czZ_QcH_HfovpySRzYRo2ZidNjQRVDXFN5m83Ww,722
14
15
  terminusgps/aws/secrets.py,sha256=MxQEmmBLpMUQ2tYAsHdCYf-7RZ84LiogdKcTsACX5dw,361
15
16
  terminusgps/twilio/__init__.py,sha256=dYo41F2jft_eHDWSUtSpKGSRG1bewq_qClqilUJZkYM,33
16
17
  terminusgps/twilio/caller.py,sha256=TiQ4f0TDDC35he1M1iSsBM2vutdGriwtV4pc17T--6I,3552
@@ -29,7 +30,7 @@ terminusgps/wialon/items/route.py,sha256=8SzlqNmpYVdt-ZAY--B_KHoDIHgN0Zb7KBsBWAz
29
30
  terminusgps/wialon/items/unit.py,sha256=i7sQiRu3N0XxyTHVN2RnmjYy9X48KdnZLSB18ic37w8,9363
30
31
  terminusgps/wialon/items/unit_group.py,sha256=YsYh34l2DjSKcv5SIZkEVi5FSjveGB1gxU2fwdLyvl4,4101
31
32
  terminusgps/wialon/items/user.py,sha256=PFYBie04F16YE2B5364PLxkmlTmQr4sZXpItvRBxsDc,7143
32
- python_terminusgps-28.3.0.dist-info/METADATA,sha256=cIMJIuKTBl9MXOEdRUBo7bA613l1pIZW-2TmfqmUBFE,946
33
- python_terminusgps-28.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- python_terminusgps-28.3.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
35
- python_terminusgps-28.3.0.dist-info/RECORD,,
33
+ python_terminusgps-28.4.0.dist-info/METADATA,sha256=Tw-hrdqiX9lKFPpd7x1ce5UqCA0SkCFrdyG6DCr_ZRU,946
34
+ python_terminusgps-28.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
+ python_terminusgps-28.4.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
36
+ python_terminusgps-28.4.0.dist-info/RECORD,,
@@ -0,0 +1,16 @@
1
+ import jwt
2
+ import datetime
3
+
4
+ from django.conf import settings
5
+
6
+ def get_aws_connect_jwt(widget_id: str, expires_in: int = 500) -> str:
7
+ payload = {
8
+ "sub": widget_id,
9
+ "iat": datetime.datetime.utcnow(),
10
+ "exp": datetime.datetime.utcnow() - datetime.timedelta(seconds=expires_in),
11
+ "customerId": "",
12
+ "segmentAttributes": {"connect:Subtype": {"ValueString" : "connect:Guide"}}, 'attributes': {"name": "Jane", "memberID": "123456789", "email": "Jane@example.com", "isPremiumUser": "true", "age": "45"} },
13
+ }
14
+ header = {"typ": "JWT", "alg": "HS256"}
15
+ encoded_token = jwt.encode((payload), settings.CONNECT_SECRET, algorithm=header["alg"], headers=header)
16
+ return encoded_token
terminusgps/settings.py CHANGED
@@ -12,3 +12,4 @@ TWILIO_SID = os.getenv("TWILIO_SID")
12
12
  TWILIO_TOKEN = os.getenv("TWILIO_TOKEN")
13
13
  WIALON_ADMIN_ID = os.getenv("WIALON_ADMIN_ID")
14
14
  WIALON_TOKEN = os.getenv("WIALON_TOKEN")
15
+ CONNECT_SECRET = os.getenv("CONNECT_SECRET")