karrio-server-core 2025.5rc28__py3-none-any.whl → 2025.5rc30__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 karrio-server-core might be problematic. Click here for more details.

@@ -241,18 +241,34 @@ def authenticate_user(request):
241
241
  def authenticate(request, authenticator):
242
242
  # Check if user exists and is not authenticated
243
243
  if not hasattr(request, 'user') or request.user is None or not getattr(request.user, 'is_authenticated', False):
244
- auth = pydoc.locate(authenticator)().authenticate(request)
245
-
246
- if auth is not None:
247
- user, token = auth
248
- request.user = user
249
- request.token = token
244
+ logger.debug(f"Trying authenticator: {authenticator}")
245
+ try:
246
+ auth_instance = pydoc.locate(authenticator)()
247
+ auth = auth_instance.authenticate(request)
248
+
249
+ if auth is not None:
250
+ user, token = auth
251
+ request.user = user
252
+ request.token = token
253
+ logger.info(f"Authentication successful with: {authenticator}")
254
+ except AttributeError as e:
255
+ # Skip SessionAuthentication if it fails with _request attribute error
256
+ if "'WSGIRequest' object has no attribute '_request'" in str(e):
257
+ logger.debug(f"Skipping {authenticator} - incompatible with middleware context")
258
+ else:
259
+ raise
260
+ except exceptions.AuthenticationFailed:
261
+ # Silently skip authentication failures - let the next authenticator try
262
+ logger.debug(f"Authentication failed with {authenticator}, trying next")
263
+ pass
250
264
 
251
265
  return request
252
266
 
253
267
  try:
268
+ logger.debug(f"Auth classes to try: {AUTHENTICATION_CLASSES}")
254
269
  return functools.reduce(authenticate, AUTHENTICATION_CLASSES, request)
255
- except Exception:
270
+ except Exception as e:
271
+ logger.debug(f"Authentication error: {e}")
256
272
  return request
257
273
 
258
274
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: karrio_server_core
3
- Version: 2025.5rc28
3
+ Version: 2025.5rc30
4
4
  Summary: Multi-carrier shipping API Core module
5
5
  Author-email: karrio <hello@karrio.io>
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ karrio/server/samples.py,sha256=2BAImCmIrmqhFad08GkPreeTlt04cc4ucn3Nf2HXR8w,9220
4
4
  karrio/server/core/__init__.py,sha256=CxNflBwGLO7AIGWybF61j7Mk9-a3iCxSjz2nRaER6BM,140
5
5
  karrio/server/core/admin.py,sha256=2h43pTXd3NKV8-_fkUEkzkS4zqih0qBLE8q6Yj7fpEg,33
6
6
  karrio/server/core/apps.py,sha256=VKRPRoB2YY1JlEpCe2AE6k57M1qkPADfq5RYZuLjEOw,211
7
- karrio/server/core/authentication.py,sha256=NiXbfcz3SJjYSKBGLT9-HRYATZXfPRuyALS5bzpNT9U,10555
7
+ karrio/server/core/authentication.py,sha256=RwJzW4b4WGMgBdnjhEmi85P-qd1l3t4dVEZCL17X3-o,11524
8
8
  karrio/server/core/context_processors.py,sha256=B80cJ_7-uviNRYyrfsCcOaUQFBf_eAgQ0hHZPtM5Olw,323
9
9
  karrio/server/core/datatypes.py,sha256=lM0kKKcEoULrEvpJajbBfiz0xAU4OgOQoiAvalKllNg,10085
10
10
  karrio/server/core/dataunits.py,sha256=myuZ0BNJ-EZPbf3hsi7JP7nlRqGcUYh_TOQUEQOhlD4,5602
@@ -199,7 +199,7 @@ karrio/server/user/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
199
199
  karrio/server/user/templates/registration/login.html,sha256=3_tj-0rKfwkCk-fp_GT8xFQhLqjGcJs3uZzOAaI40Sw,3690
200
200
  karrio/server/user/templates/registration/registration_confirm_email.html,sha256=haJ1DVM27umaxegACs4tNAj296HxVZfWCSTyD0Nt5I8,279
201
201
  karrio/server/user/templates/registration/registration_confirm_email.txt,sha256=I_zN_pJTRigfyiYbyQK0wFfrI5Zq1JG8lf0TyLA9fN0,94
202
- karrio_server_core-2025.5rc28.dist-info/METADATA,sha256=t2EaY8t5NX1GJBNFUboeHo7qK_FDGB0vcVk52viecgQ,797
203
- karrio_server_core-2025.5rc28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
204
- karrio_server_core-2025.5rc28.dist-info/top_level.txt,sha256=D1D7x8R3cTfjF_15mfiO7wCQ5QMtuM4x8GaPr7z5i78,12
205
- karrio_server_core-2025.5rc28.dist-info/RECORD,,
202
+ karrio_server_core-2025.5rc30.dist-info/METADATA,sha256=RWXv6nXtn5-31JBQiBv-KUw7p4AzDnIZkk6Yqtz-cpU,797
203
+ karrio_server_core-2025.5rc30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
204
+ karrio_server_core-2025.5rc30.dist-info/top_level.txt,sha256=D1D7x8R3cTfjF_15mfiO7wCQ5QMtuM4x8GaPr7z5i78,12
205
+ karrio_server_core-2025.5rc30.dist-info/RECORD,,