Compare commits

..

2 Commits

Author SHA1 Message Date
dependabot[bot]
06dcf9b874 docker(deps): bump astral-sh/uv
Bumps [astral-sh/uv](https://github.com/astral-sh/uv) from 0.9.14-python3.12-trixie-slim to 0.9.15-python3.12-trixie-slim.
- [Release notes](https://github.com/astral-sh/uv/releases)
- [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/uv/compare/0.9.14...0.9.15)

---
updated-dependencies:
- dependency-name: astral-sh/uv
  dependency-version: 0.9.15-python3.12-trixie-slim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-03 19:05:33 +00:00
shamoon
ce642409e8 Chore: add some output of social login errors (#11527) 2025-12-03 18:52:49 +00:00
5 changed files with 42 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ RUN set -eux \
# Purpose: Installs s6-overlay and rootfs
# Comments:
# - Don't leave anything extra in here either
FROM ghcr.io/astral-sh/uv:0.9.14-python3.12-trixie-slim AS s6-overlay-base
FROM ghcr.io/astral-sh/uv:0.9.15-python3.12-trixie-slim AS s6-overlay-base
WORKDIR /usr/src/s6

View File

@@ -45,7 +45,7 @@ dependencies = [
"drf-writable-nested~=0.7.1",
"filelock~=3.20.0",
"flower~=2.0.1",
"gotenberg-client~=0.13.0",
"gotenberg-client~=0.12.0",
"httpx-oauth~=0.16",
"imap-tools~=1.11.0",
"inotifyrecursive~=0.3",

View File

@@ -137,3 +137,25 @@ class CustomSocialAccountAdapter(DefaultSocialAccountAdapter):
user.save()
handle_social_account_updated(None, request, sociallogin)
return user
def on_authentication_error(
self,
request,
provider,
error=None,
exception=None,
extra_context=None,
):
"""
Just log errors and pass them along.
"""
logger.warning(
f"Social authentication error for provider `{provider!s}`: {error!s} ({exception!s})",
)
return super().on_authentication_error(
request,
provider,
error,
exception,
extra_context,
)

View File

@@ -167,3 +167,17 @@ class TestCustomSocialAccountAdapter(TestCase):
self.assertEqual(user.groups.count(), 1)
self.assertTrue(user.groups.filter(name="group1").exists())
self.assertFalse(user.groups.filter(name="group2").exists())
def test_error_logged_on_authentication_error(self):
adapter = get_social_adapter()
request = HttpRequest()
with self.assertLogs("paperless.auth", level="INFO") as log_cm:
adapter.on_authentication_error(
request,
provider="test-provider",
error="Error",
exception="Test authentication error",
)
self.assertTrue(
any("Test authentication error" in message for message in log_cm.output),
)

8
uv.lock generated
View File

@@ -1073,15 +1073,15 @@ wheels = [
[[package]]
name = "gotenberg-client"
version = "0.13.0"
version = "0.12.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "httpx", extra = ["http2"], marker = "sys_platform == 'darwin' or sys_platform == 'linux'" },
{ name = "typing-extensions", marker = "(python_full_version < '3.11' and sys_platform == 'darwin') or (python_full_version < '3.11' and sys_platform == 'linux')" },
]
sdist = { url = "https://files.pythonhosted.org/packages/ef/ad/a8ae34ad79918ee2691498e36882a8275603362316be1a57f26911f01d87/gotenberg_client-0.13.0.tar.gz", hash = "sha256:0fb2425d0e1e4f143285ecde90f7687f4d234d2b23316f5d42015337d336a4ab", size = 1211055, upload-time = "2025-11-18T16:15:33.735Z" }
sdist = { url = "https://files.pythonhosted.org/packages/61/6d/07ea213c146bbe91dffebff2d8f4dc61e7076d3dd34d4fd1467f9163e752/gotenberg_client-0.12.0.tar.gz", hash = "sha256:1ab50878024469fc003c414ee9810ceeb00d4d7d7c36bd2fb75318fbff139e9b", size = 1210884, upload-time = "2025-10-15T15:32:37.669Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ce/7b/8b301f097027403d9b66fad83e2fd5a5b2bcccb592832473db895671a0ee/gotenberg_client-0.13.0-py3-none-any.whl", hash = "sha256:e787ee39d1d222629b2e2e153402853e84a1a76758b261859b0c81384cdec4e5", size = 51054, upload-time = "2025-11-18T16:15:32.294Z" },
{ url = "https://files.pythonhosted.org/packages/12/39/fcb24ff053b1be7e5124f56c3d358706a23a328f685c6db33bc9dbc5472d/gotenberg_client-0.12.0-py3-none-any.whl", hash = "sha256:a540b35ac518e902c2860a88fbe448c15fe5a56fe8ec8604e6a2c8c2228fd0cb", size = 51051, upload-time = "2025-10-15T15:32:36.32Z" },
]
[[package]]
@@ -2281,7 +2281,7 @@ requires-dist = [
{ name = "drf-writable-nested", specifier = "~=0.7.1" },
{ name = "filelock", specifier = "~=3.20.0" },
{ name = "flower", specifier = "~=2.0.1" },
{ name = "gotenberg-client", specifier = "~=0.13.0" },
{ name = "gotenberg-client", specifier = "~=0.12.0" },
{ name = "granian", extras = ["uvloop"], marker = "extra == 'webserver'", specifier = "~=2.5.1" },
{ name = "httpx-oauth", specifier = "~=0.16" },
{ name = "imap-tools", specifier = "~=1.11.0" },