Reload current rehearsal attestation key at approval checks
ABSDEV Framework CI / framework-ci (push) Successful in 20s

This commit is contained in:
Mark Gregory
2026-11-30 11:57:09 +00:00
parent 2a001b1269
commit 054c546c8f
4 changed files with 70 additions and 28 deletions
+10 -1
View File
@@ -63,9 +63,10 @@ class ApprovalStoreTests(unittest.TestCase):
},
}
self.rehearsal_key = os.urandom(32)
self.trusted_rehearsal = TrustedRehearsal(
"fixture-runner", lambda _context: self.execution,
key=os.urandom(32), clock=lambda: self.now,
key_loader=lambda: self.rehearsal_key, clock=lambda: self.now,
)
self.rehearsal = self.trusted_rehearsal.run(self.base)
self.context = self.trusted_rehearsal.approval_context(
@@ -572,5 +573,13 @@ class ApprovalStoreTests(unittest.TestCase):
self.assertFalse(self.store.approval_path(self.approval["approval_id"]).exists())
def test_running_store_rejects_retired_rehearsal_key(self):
self.save()
self.rehearsal_key = os.urandom(32)
with self.assertRaises(ApprovalStoreError):
self.consume()
self.assertFalse(self.store.consumed_path(self.identifier).exists())
if __name__ == "__main__":
unittest.main()