Implement authenticated custody observations and durable root-grant baseline
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Container Image / build-and-push (push) Successful in 27s
Account journey acceptance / journeys (push) Failing after 6s

Assistant: codex
Assistant-Model: gpt-6.1-sol
Assistant-Session: 01a1029d-2c93-7500-a0e0-e3e089668b29
This commit is contained in:
tegwick 2026-10-03 19:50:15 +02:00
parent 1999a144c9
commit 0d0751d39d
18 changed files with 1129 additions and 14 deletions

View file

@ -62,8 +62,25 @@ class AccountAuthorityTests(unittest.TestCase):
self.store.find_identity = checked
with self.assertRaises(AuthorizationDenied): self.lookup()
def test_custody_mapping_only_after_independent_authorization(self):
calls = []
class Custody:
def observe(inner, **values):
calls.append(values)
return {"fixture": "observed-fact"} if values["tenant"] == "platform" else None
self.service.custody = Custody()
result = self.lookup(tenant="platform")
self.assertEqual(result.root_grant, {"fixture": "observed-fact"})
self.assertEqual(calls[-1], {"issuer": self.session.actor.issuer, "subject": self.session.actor.subject, "tenant": "platform"})
self.policy.effect = AuthorizationEffect.DENY
with self.assertRaises(AuthorizationDenied):
self.lookup(tenant="platform")
self.assertEqual(len(calls), 1)
def test_does_not_emit_root_grants_or_profile_details(self):
result = self.lookup()
self.assertIsNone(result.root_grant)
self.assertFalse(hasattr(result,'root_entitled'))
self.assertFalse(hasattr(result,'roles'))
self.assertFalse(hasattr(result,'primary_email'))