From 48be27d367942ea6f4c7c20e12a4470fcaa24a78 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 1 Dec 2022 15:01:25 -0500 Subject: [PATCH] fixing some typing issues, white space, etal... --- .../routes/openid_blueprint/openid_blueprint.py | 2 +- .../services/authentication_service.py | 7 +++---- .../integration/test_openid_blueprint.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py index e2be4cb0e..136da75ad 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py @@ -53,7 +53,7 @@ def auth() -> str: @openid_blueprint.route("/form_submit", methods=["POST"]) -def form_submit() -> Response | str: +def form_submit() -> Any: users = get_users() if ( request.values["Uname"] in users diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py index 8087cc693..6f59f7663 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py @@ -36,7 +36,7 @@ class AuthenticationService: @staticmethod def server_url() -> str: - return current_app.config.get("OPEN_ID_SERVER_URL","") + return current_app.config.get("OPEN_ID_SERVER_URL", "") @staticmethod def secret_key() -> str: @@ -61,11 +61,10 @@ class AuthenticationService: def logout(self, id_token: str, redirect_url: Optional[str] = None) -> Response: """Logout.""" if redirect_url is None: - redirect_url = "/" - return_redirect_url = f"{self.get_backend_url()}/v1.0/logout_return" + redirect_url = f"{self.get_backend_url()}/v1.0/logout_return" request_url = ( self.open_id_endpoint_for_name("end_session_endpoint") - + f"?post_logout_redirect_uri={return_redirect_url}&" + + f"?post_logout_redirect_uri={redirect_url}&" + f"id_token_hint={id_token}" ) diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_openid_blueprint.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_openid_blueprint.py index af158cefc..11beb3826 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_openid_blueprint.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_openid_blueprint.py @@ -32,7 +32,7 @@ class TestFaskOpenId(BaseTest): # It should be possible to get to a login page data = {"state": {"bubblegum": 1, "daydream": 2}} response = client.get("/openid/auth", query_string=data) - assert b"

Login to SpiffWorkflow

" in response.data + assert b"

Login

" in response.data assert b"bubblegum" in response.data def test_get_token(