port-ocean 0.14.5__py3-none-any.whl → 0.14.6__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 port-ocean might be problematic. Click here for more details.

@@ -1,3 +1,4 @@
1
+ import re
1
2
  from typing import Any
2
3
 
3
4
  import httpx
@@ -46,7 +47,11 @@ class PortAuthentication:
46
47
 
47
48
  async def _get_token(self, client_id: str, client_secret: str) -> TokenResponse:
48
49
  logger.info(f"Fetching access token for clientId: {client_id}")
49
-
50
+ if self._is_personal_token(client_id):
51
+ logger.warning(
52
+ "Integration is using personal credentials, make sure to use machine credentials. "
53
+ "Usage of personal credentials might impose unexpected integration behavior."
54
+ )
50
55
  credentials = {"clientId": client_id, "clientSecret": client_secret}
51
56
  response = await self.client.post(
52
57
  f"{self.api_url}/auth/access_token",
@@ -82,3 +87,8 @@ class PortAuthentication:
82
87
  self.client_id, self.client_secret
83
88
  )
84
89
  return self.last_token_object.full_token
90
+
91
+ @staticmethod
92
+ def _is_personal_token(client_id: str) -> bool:
93
+ email_regex = r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"
94
+ return re.match(email_regex, client_id) is not None
@@ -50,7 +50,7 @@ def test_serialize_record_exc_info_group_exception() -> None:
50
50
 
51
51
  def assert_extra(extra: dict[str, Any]) -> str:
52
52
  exc_info = extra.get("exc_info", None)
53
- assert type(exc_info) is str
53
+ assert isinstance(exc_info, str)
54
54
  return exc_info
55
55
 
56
56
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: port-ocean
3
- Version: 0.14.5
3
+ Version: 0.14.6
4
4
  Summary: Port Ocean is a CLI tool for managing your Port projects.
5
5
  Home-page: https://app.getport.io
6
6
  Keywords: ocean,port-ocean,port
@@ -45,7 +45,7 @@ port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.
45
45
  port_ocean/cli/utils.py,sha256=IUK2UbWqjci-lrcDdynZXqVP5B5TcjF0w5CpEVUks-k,54
46
46
  port_ocean/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  port_ocean/clients/port/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- port_ocean/clients/port/authentication.py,sha256=t3z6h4vld-Tzkpth15sstaMJg0rccX-pXXjNtOa-nCY,2949
48
+ port_ocean/clients/port/authentication.py,sha256=BEcSosMi8B2pD70yFaunQvxYWRJZ030PFbHEs_MAGw0,3446
49
49
  port_ocean/clients/port/client.py,sha256=Xd8Jk25Uh4WXY_WW-z1Qbv6F3ZTBFPoOolsxHMfozKw,3366
50
50
  port_ocean/clients/port/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  port_ocean/clients/port/mixins/blueprints.py,sha256=POBl4uDocrgJBw4rvCAzwRcD4jk-uBL6pDAuKMTajdg,4633
@@ -136,7 +136,7 @@ port_ocean/tests/helpers/integration.py,sha256=_RxS-RHpu11lrbhUXYPZp862HLWx8AoD7
136
136
  port_ocean/tests/helpers/ocean_app.py,sha256=8BysIhNqtTwhjnya5rr0AtrjulfJnJJMFz5cPUxIpLk,2167
137
137
  port_ocean/tests/helpers/port_client.py,sha256=5d6GNr8vNNSOkrz1AdOhxBUKuusr_-UPDP7AVpHasQw,599
138
138
  port_ocean/tests/helpers/smoke_test.py,sha256=_9aJJFRfuGJEg2D2YQJVJRmpreS6gEPHHQq8Q01x4aQ,2697
139
- port_ocean/tests/log/test_handlers.py,sha256=bTOGnuj8fMIEXepwYblRvcg0FKqApCdyCBtAQZ2BlXM,2115
139
+ port_ocean/tests/log/test_handlers.py,sha256=uxgYCEQLP9U5qf-zUN9SgWFogMbYdnBeOVzXZ7E_yFw,2119
140
140
  port_ocean/tests/test_smoke.py,sha256=uix2uIg_yOm8BHDgHw2hTFPy1fiIyxBGW3ENU_KoFlo,2557
141
141
  port_ocean/tests/utils/test_async_iterators.py,sha256=3PLk1emEXekb8LcC5GgVh3OicaX15i5WyaJT_eFnu_4,1336
142
142
  port_ocean/tests/utils/test_cache.py,sha256=GzoS8xGCBDbBcPwSDbdimsMMkRvJATrBC7UmFhdW3fw,4906
@@ -150,8 +150,8 @@ port_ocean/utils/repeat.py,sha256=0EFWM9d8lLXAhZmAyczY20LAnijw6UbIECf5lpGbOas,32
150
150
  port_ocean/utils/signal.py,sha256=K-6kKFQTltcmKDhtyZAcn0IMa3sUpOHGOAUdWKgx0_E,1369
151
151
  port_ocean/utils/time.py,sha256=pufAOH5ZQI7gXvOvJoQXZXZJV-Dqktoj9Qp9eiRwmJ4,1939
152
152
  port_ocean/version.py,sha256=UsuJdvdQlazzKGD3Hd5-U7N69STh8Dq9ggJzQFnu9fU,177
153
- port_ocean-0.14.5.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
154
- port_ocean-0.14.5.dist-info/METADATA,sha256=MW3BLnPGXE2LtquS4-4M46zCiMfpuczwko2Q2of44F0,6673
155
- port_ocean-0.14.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
156
- port_ocean-0.14.5.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
157
- port_ocean-0.14.5.dist-info/RECORD,,
153
+ port_ocean-0.14.6.dist-info/LICENSE.md,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
154
+ port_ocean-0.14.6.dist-info/METADATA,sha256=KTjM9cT2YRaEy1XsgkKN8uAlzVfCE9pxm4KGMTVvzN0,6673
155
+ port_ocean-0.14.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
156
+ port_ocean-0.14.6.dist-info/entry_points.txt,sha256=F_DNUmGZU2Kme-8NsWM5LLE8piGMafYZygRYhOVtcjA,54
157
+ port_ocean-0.14.6.dist-info/RECORD,,