Fit Coulomb archive policy within native statement limit
Assistant: codex Assistant-Model: gpt-6.1-sol Assistant-Session: 01a17f16-d99c-7ea3-95f0-8212897fba6b
This commit is contained in:
parent
12f2056272
commit
61a82ac74c
2 changed files with 18 additions and 2 deletions
|
|
@ -61,6 +61,14 @@ class ResourcesTests(unittest.TestCase):
|
|||
self.assertEqual(p["Statement"][0]["Principal"], {"SCW": "user_id:o"})
|
||||
self.assertTrue(all(s["Effect"] == "Allow" for s in p["Statement"]))
|
||||
|
||||
def test_archive_policy_respects_native_ten_statement_limit(self):
|
||||
p = m.policy("b", "archives", self.apps, "o")
|
||||
self.assertLessEqual(len(p["Statement"]), 10)
|
||||
shared = next(s for s in p["Statement"] if s["Sid"] == "ArchiveMetadata")
|
||||
self.assertEqual(set(shared["Principal"]["SCW"]),
|
||||
{"application_id:" + self.apps[r] for r in ("reader", "custodian", "publisher")})
|
||||
self.assertTrue(all(a.startswith("s3:Get") and "Object" not in a for a in shared["Action"]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue