From 45a33103206c07a9b38a6d371104a413348fea8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:30:38 +0100 Subject: [PATCH] core: bump goauthentik.io/api/v3 from 3.2023106.4 to 3.2023106.5 (#8302) * core: bump goauthentik.io/api/v3 from 3.2023106.4 to 3.2023106.5 Bumps [goauthentik.io/api/v3](https://github.com/goauthentik/client-go) from 3.2023106.4 to 3.2023106.5. - [Release notes](https://github.com/goauthentik/client-go/releases) - [Commits](https://github.com/goauthentik/client-go/compare/v3.2023106.4...v3.2023106.5) --- updated-dependencies: - dependency-name: goauthentik.io/api/v3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * fix flaky recovery tests Signed-off-by: Jens Langhammer * fix startup error with pk in outpost task Signed-off-by: Jens Langhammer * fix flaky user api tests Signed-off-by: Jens Langhammer --------- Signed-off-by: dependabot[bot] Signed-off-by: Jens Langhammer Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer --- authentik/core/tests/test_users_api.py | 9 ++++++++- authentik/outposts/tasks.py | 4 ++-- authentik/recovery/tests.py | 6 +++--- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/authentik/core/tests/test_users_api.py b/authentik/core/tests/test_users_api.py index 9f7b59a4dd..5b168caca4 100644 --- a/authentik/core/tests/test_users_api.py +++ b/authentik/core/tests/test_users_api.py @@ -261,7 +261,14 @@ class TestUsersAPI(APITestCase): reverse("authentik_api:user-paths"), ) self.assertEqual(response.status_code, 200) - self.assertJSONEqual(response.content.decode(), {"paths": ["users"]}) + expected = list( + User.objects.all() + .values("path") + .distinct() + .order_by("path") + .values_list("path", flat=True) + ) + self.assertJSONEqual(response.content.decode(), {"paths": expected}) def test_path_valid(self): """Test path""" diff --git a/authentik/outposts/tasks.py b/authentik/outposts/tasks.py index 72309a8e3d..3b085bad58 100644 --- a/authentik/outposts/tasks.py +++ b/authentik/outposts/tasks.py @@ -192,7 +192,7 @@ def outpost_post_save(model_class: str, model_pk: Any): if isinstance(instance, Outpost): LOGGER.debug("Trigger reconcile for outpost", instance=instance) - outpost_controller.delay(instance.pk) + outpost_controller.delay(str(instance.pk)) if isinstance(instance, (OutpostModel, Outpost)): LOGGER.debug("triggering outpost update from outpostmodel/outpost", instance=instance) @@ -200,7 +200,7 @@ def outpost_post_save(model_class: str, model_pk: Any): if isinstance(instance, OutpostServiceConnection): LOGGER.debug("triggering ServiceConnection state update", instance=instance) - outpost_service_connection_state.delay(instance.pk) + outpost_service_connection_state.delay(str(instance.pk)) for field in instance._meta.get_fields(): # Each field is checked if it has a `related_model` attribute (when ForeginKeys or M2Ms) diff --git a/authentik/recovery/tests.py b/authentik/recovery/tests.py index 0d886a5d7f..4255424582 100644 --- a/authentik/recovery/tests.py +++ b/authentik/recovery/tests.py @@ -18,7 +18,7 @@ class TestRecovery(TestCase): def test_create_key(self): """Test creation of a new key""" out = StringIO() - self.assertEqual(len(Token.objects.all()), 0) + self.assertEqual(len(Token.objects.filter(intent=TokenIntents.INTENT_RECOVERY)), 0) call_command( "create_recovery_key", "1", @@ -28,12 +28,12 @@ class TestRecovery(TestCase): ) token = Token.objects.get(intent=TokenIntents.INTENT_RECOVERY, user=self.user) self.assertIn(token.key, out.getvalue()) - self.assertEqual(len(Token.objects.all()), 1) + self.assertEqual(len(Token.objects.filter(intent=TokenIntents.INTENT_RECOVERY)), 1) def test_create_key_invalid(self): """Test creation of a new key (invalid)""" out = StringIO() - self.assertEqual(len(Token.objects.all()), 0) + self.assertEqual(len(Token.objects.filter(intent=TokenIntents.INTENT_RECOVERY)), 0) call_command("create_recovery_key", "1", "foo", schema=get_public_schema_name(), stderr=out) self.assertIn("not found", out.getvalue()) diff --git a/go.mod b/go.mod index 1d3481dea1..ab99e46fb8 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 github.com/wwt/guac v1.3.2 - goauthentik.io/api/v3 v3.2023106.4 + goauthentik.io/api/v3 v3.2023106.5 golang.org/x/exp v0.0.0-20230210204819-062eb4c674ab golang.org/x/oauth2 v0.16.0 golang.org/x/sync v0.6.0 diff --git a/go.sum b/go.sum index b8090ba274..9d9634fdcb 100644 --- a/go.sum +++ b/go.sum @@ -290,8 +290,8 @@ go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYO go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -goauthentik.io/api/v3 v3.2023106.4 h1:HYVgTdFIQzGvLkl0PugAkhdvRXOW1+0Dw5dHunlmf7Q= -goauthentik.io/api/v3 v3.2023106.4/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw= +goauthentik.io/api/v3 v3.2023106.5 h1:ogldINBGXP0J+8DALdqVtHvqhh5ePDMFe22WYczUIks= +goauthentik.io/api/v3 v3.2023106.5/go.mod h1:zz+mEZg8rY/7eEjkMGWJ2DnGqk+zqxuybGCGrR2O4Kw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=