gagahhag
08/02/2023, 7:47 AMcaveat attributes_match(expected map<any>, provided map<any>) {
expected.isSubtreeOf(provided)
}
So how can I write the assertion to include maps?
... with {"attributes_match": ????}
Can you give me an example? Many thanks!ecordell
08/02/2023, 11:41 AMdefinition platform {
relation administrator: user with attributes_match
permission super_admin = administrator
}
then you can write an assertion like this:
platform:demo#super_admin@user:bob with {"session": {"active": true, "iss": "google"}}gagahhag
08/02/2023, 11:54 AMgagahhag
08/02/2023, 11:57 AMplatform:demo#super_admin@user:bob with {"attributes_match": {"expected": {"key1": "value1"},"provided": {"key1": "value1","key2": "value2"}}}
matches?ecordell
08/02/2023, 12:07 PMgagahhag
08/02/2023, 12:07 PMecordell
08/02/2023, 12:08 PMgagahhag
08/02/2023, 12:10 PMgagahhag
08/02/2023, 12:10 PMecordell
08/02/2023, 12:11 PMrelation administrator: user with caveat1 | user with caveat2