Skip to content

Commit

Permalink
tidy up IDE complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlundberg committed Oct 23, 2023
1 parent af7cc6e commit 406a70d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/auth_server/proof/jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,9 @@ async def check_jwsd_proof(
# rebuilding the request as that was what was signed
assert isinstance(gnap_request_orig.client, Client) # please mypy
gnap_request_orig.client.key = key_reference
payload = base64url_encode(gnap_request_orig.json(exclude_unset=True))
else:
payload = base64url_encode(gnap_request_orig.json(exclude_unset=True))

logger.debug(f"gnap_request_orig: {gnap_request_orig.json(exclude_unset=True)}")
payload = base64url_encode(gnap_request_orig.json(exclude_unset=True))
raw_jws = f"{header}.{payload}.{signature}"
_jws = jws.JWS()

Expand Down
2 changes: 1 addition & 1 deletion src/auth_server/saml2.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ async def process_assertion(saml_response: str) -> Optional[AssertionData]:
logger.debug(f"authn response: {response}")

if authn_ref not in saml2_sp.authn_req_cache:
logger.info(f"Unknown response")
logger.info("Unknown response")
raise BadSAMLResponse("Unknown response")

session_info = SessionInfo.from_pysaml2(response.session_info())
Expand Down
4 changes: 2 additions & 2 deletions src/auth_server/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_transaction_jws(self):
data = _jws.serialize(compact=True)

client_header = {"Content-Type": "application/jose+json"}
response = self.client.post("/transaction", data=data, headers=client_header)
response = self.client.post("/transaction", content=data, headers=client_header)

assert response.status_code == 200
assert "access_token" in response.json()
Expand Down Expand Up @@ -309,7 +309,7 @@ def test_transaction_jwsd(self):
data = _jws.serialize(compact=True)

# Remove payload from serialized jws
header, payload, signature = data.split(".")
header, _, signature = data.split(".")
client_header = {"Detached-JWS": f"{header}..{signature}"}

response = self.client.post("/transaction", json=req.dict(exclude_unset=True), headers=client_header)
Expand Down

0 comments on commit 406a70d

Please sign in to comment.