diff --git a/authentik/policies/reputation/models.py b/authentik/policies/reputation/models.py index ac29fd8cd..305a33832 100644 --- a/authentik/policies/reputation/models.py +++ b/authentik/policies/reputation/models.py @@ -36,14 +36,17 @@ class ReputationPolicy(Policy): passing = True if self.check_ip: score = cache.get_or_set(CACHE_KEY_IP_PREFIX + remote_ip, 0) - LOGGER.debug("Score for IP", ip=remote_ip, score=score) passing = passing and score <= self.threshold + LOGGER.debug("Score for IP", ip=remote_ip, score=score, passing=passing) if self.check_username: score = cache.get_or_set(CACHE_KEY_USER_PREFIX + request.user.username, 0) - LOGGER.debug( - "Score for Username", username=request.user.username, score=score - ) passing = passing and score <= self.threshold + LOGGER.debug( + "Score for Username", + username=request.user.username, + score=score, + passing=passing, + ) return PolicyResult(passing) class Meta: diff --git a/authentik/policies/reputation/tests.py b/authentik/policies/reputation/tests.py index ebd606bb3..9e944c584 100644 --- a/authentik/policies/reputation/tests.py +++ b/authentik/policies/reputation/tests.py @@ -4,6 +4,7 @@ from django.core.cache import cache from django.test import RequestFactory, TestCase from authentik.core.models import User +from authentik.lib.utils.http import DEFAULT_IP from authentik.policies.reputation.models import ( CACHE_KEY_IP_PREFIX, CACHE_KEY_USER_PREFIX, @@ -24,6 +25,7 @@ class TestReputationPolicy(TestCase): self.test_ip = "127.0.0.1" self.test_username = "test" cache.delete(CACHE_KEY_IP_PREFIX + self.test_ip) + cache.delete(CACHE_KEY_IP_PREFIX + DEFAULT_IP) cache.delete(CACHE_KEY_USER_PREFIX + self.test_username) # We need a user for the one-to-one in userreputation self.user = User.objects.create(username=self.test_username) diff --git a/website/docs/integrations/services/nextcloud/index.md b/website/docs/integrations/services/nextcloud/index.md index ccc99b4bc..571123d92 100644 --- a/website/docs/integrations/services/nextcloud/index.md +++ b/website/docs/integrations/services/nextcloud/index.md @@ -38,7 +38,7 @@ You can of course use a custom signing certificate, and adjust durations. ## NextCloud -In NextCloud, ensure that the `SSO & SAML Authentication` extension is installed. Navigate to `Settings`, then `SSO & SAML Authentication`. +In NextCloud, ensure that the `SSO & SAML Authentication` app is installed. Navigate to `Settings`, then `SSO & SAML Authentication`. Set the following values: