diff --git a/authentik/crypto/api.py b/authentik/crypto/api.py index fc62285fa..08bbf86f8 100644 --- a/authentik/crypto/api.py +++ b/authentik/crypto/api.py @@ -192,7 +192,7 @@ class CertificateKeyPairViewSet(UsedByMixin, ModelViewSet): secret=certificate, type="certificate", ).from_http(request) - if "download" in request._request.GET: + if "download" in request.query_params: # Mime type from https://pki-tutorial.readthedocs.io/en/latest/mime.html response = HttpResponse( certificate.certificate_data, content_type="application/x-pem-file" @@ -223,7 +223,7 @@ class CertificateKeyPairViewSet(UsedByMixin, ModelViewSet): secret=certificate, type="private_key", ).from_http(request) - if "download" in request._request.GET: + if "download" in request.query_params: # Mime type from https://pki-tutorial.readthedocs.io/en/latest/mime.html response = HttpResponse(certificate.key_data, content_type="application/x-pem-file") response[ diff --git a/authentik/providers/saml/api.py b/authentik/providers/saml/api.py index 8c3bc7257..deda0400c 100644 --- a/authentik/providers/saml/api.py +++ b/authentik/providers/saml/api.py @@ -123,7 +123,7 @@ class SAMLProviderViewSet(UsedByMixin, ModelViewSet): raise Http404 try: metadata = MetadataProcessor(provider, request).build_entity_descriptor() - if "download" in request._request.GET: + if "download" in request.query_params: response = HttpResponse(metadata, content_type="application/xml") response[ "Content-Disposition" diff --git a/authentik/providers/saml/processors/assertion.py b/authentik/providers/saml/processors/assertion.py index 01e0b9b5f..fff3b7b67 100644 --- a/authentik/providers/saml/processors/assertion.py +++ b/authentik/providers/saml/processors/assertion.py @@ -10,7 +10,6 @@ from structlog.stdlib import get_logger from authentik.core.exceptions import PropertyMappingExpressionException from authentik.events.models import Event, EventAction -from authentik.lib.utils.errors import exception_to_string from authentik.lib.utils.time import timedelta_from_string from authentik.providers.saml.models import SAMLPropertyMapping, SAMLProvider from authentik.providers.saml.processors.request_parser import AuthNRequest @@ -106,7 +105,7 @@ class AssertionProcessor: # Value error can be raised when assigning invalid data to an attribute Event.new( EventAction.CONFIGURATION_ERROR, - message=f"Failed to evaluate property-mapping: {exception_to_string(exc)}", + message=f"Failed to evaluate property-mapping: {str(exc)}", mapping=mapping, ).from_http(self.http_request) continue