fixing some typing issues, white space, etal...

This commit is contained in:
Dan 2022-12-01 15:01:25 -05:00
parent 64e30358aa
commit e0dc3d19b5
3 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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}"
)

View File

@ -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"<h2>Login to SpiffWorkflow</h2>" in response.data
assert b"<h2>Login</h2>" in response.data
assert b"bubblegum" in response.data
def test_get_token(