Skip to content

Commit

Permalink
Constrict test_02_trust_anchor_intermediary even more (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaspc authored Apr 19, 2024
1 parent 5bda34e commit 159fb61
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions spid_cie_oidc/authority/tests/test_02_trust_anchor_intermediary.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,24 @@ def test_trust_chain_valid_with_intermediary(self, mocked):
_p2 = unpad_jwt_payload(tc_ser[2])
_p3 = unpad_jwt_payload(tc_ser[3])

# Entity configurations
self.assertEqual(_p0['iss'], _p0['sub'])
self.assertEqual(_p3['iss'], _p3['sub'])

# Entity statements
self.assertNotEqual(_p1['iss'], _p1['sub'])
self.assertNotEqual(_p2['iss'], _p2['sub'])

# Chain consistency (positive)
self.assertEqual(_p0['iss'], _p1['sub'])
self.assertEqual(_p1['iss'], _p2['sub'])
self.assertEqual(_p2['iss'], _p3['sub'])

# Chain consistency (negative)
self.assertNotEqual(_p1['iss'], _p0['sub'])
self.assertNotEqual(_p2['iss'], _p1['sub'])
self.assertNotEqual(_p2['iss'], _p2['sub'])
self.assertEqual(_p3['sub'], _p2['iss'])
self.assertEqual(_p3['iss'], _p3['sub'])

self.assertNotEqual(_p3['iss'], _p2['sub'])

dumps = dumps_statements_from_trust_chain_to_db(trust_chain)

self.assertTrue(isinstance(dumps, list) and len(dumps) == 5)
Expand Down

0 comments on commit 159fb61

Please sign in to comment.