From ea930c61160adb4f1de766ede84d28154ac548f3 Mon Sep 17 00:00:00 2001 From: Gartic99 Date: Mon, 18 Dec 2023 13:30:43 +0100 Subject: [PATCH] feat: changed qrcode handling --- pyeudiw/satosa/backend.py | 7 ++----- pyeudiw/tests/satosa/test_backend.py | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pyeudiw/satosa/backend.py b/pyeudiw/satosa/backend.py index 2cd3f245..7ee06800 100644 --- a/pyeudiw/satosa/backend.py +++ b/pyeudiw/satosa/backend.py @@ -203,14 +203,11 @@ def pre_request_endpoint(self, context: Context, internal_request, **kwargs) -> # Cross Device flow res_url = f'{self.client_id}?{url_params}' - encoded_res_url = base64.urlsafe_b64encode(res_url.encode()) - - # response = base64.b64encode(res_url.encode()) - qrcode = QRCode(encoded_res_url, **self.config['qrcode']) result = self.template.qrcode_page.render( { - 'qrcode_base64': qrcode.to_base64(), + "qrcode_color" : self.config["qrcode"]["color"], + "qrcode_text": res_url, "state": state, "status_endpoint": self.absolute_status_url } diff --git a/pyeudiw/tests/satosa/test_backend.py b/pyeudiw/tests/satosa/test_backend.py index bd8eb714..a348a4a4 100644 --- a/pyeudiw/tests/satosa/test_backend.py +++ b/pyeudiw/tests/satosa/test_backend.py @@ -123,11 +123,6 @@ def test_pre_request_endpoint(self, context): assert state_div assert state_div["value"] - svg = BeautifulSoup(decoded, features="xml") - assert svg - assert svg.find("svg") - assert svg.find_all("path") - def test_pre_request_endpoint_mobile(self, context): self.backend.register_endpoints() internal_data = InternalData()