Skip to content

cedarpy v4.8.7

Latest

Choose a tag to compare

@skuenzli skuenzli released this 10 Jul 14:25
· 2 commits to main since this release
4acb079

Added

  • A reusable, pre-parsed Schema handle, completing the handle trio alongside PolicySet and Entities. Parse a schema once with Schema.from_str(cedar_text) or Schema.from_json_str(json_text) and pass the handle to is_authorized, is_authorized_batch, is_authorized_partial, or validate_policies anywhere a schema string is accepted — skipping the per-call parse. The schema parameter widens from str | dict | None to str | dict | Schema | None; existing string/dict callers are unchanged, so this is a pure, opt-in addition. The handle is immutable, releases its memory when the last Python reference is dropped, supports str() (the schema rendered to Cedar schema syntax, whichever format it was constructed from), and raises ValueError at construction on unparseable schemas. On a successful evaluation the result metrics gain a schema_pre_parsed flag (1 for the handle path, 0 otherwise). Mirrors the PolicySet / Entities handle APIs (#103). Thanks @swenger!

Full Changelog: v4.8.6...v4.8.7