docs(cmf): settle the extensions bag contract - #59
Open
mkoushni wants to merge 2 commits into
Open
Conversation
The twelve CMF slots had an implicit per-type empty/absent rule and a claims gap that only lived next to extractors. Document the contract, assert it in the bridge, and move present-empty sets into the PDP agreement subset so APL, CEL, cedar-direct, and OPA deny the same way. Signed-off-by: mkoushni <mkoushni@redhat.com>
Keep the praxis-proxy#18 changelog bullet and take the assertions entry from praxis-proxy#56. Signed-off-by: mkoushni <mkoushni@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
subject.claimsis not a bag key (docs/cmf-extensions.md).StringSets, omitted optionals, and paired original/flattened members.ppe-pdp-diffmoves present-empty sets into the agreement subset (APL, CEL, cedar-direct, OPA Deny together); unguarded omitted scalars stay on the allowlist.Closes #18
Changes
Added
docs/cmf-extensions.md— normative bag contract:StringSetpresent-empty; optional String/Int/Float omitted; flattened member bools presence-only; non-option scalars always written)role.*/perm.*/team.*/client.role.*(authors should use the original set; lastbag.setwins if they disagree)subject.claimsmap in the bag (would need a sixthAttributeValuevariant and would duplicate flattenedclaim.*)extract_extensionsslots, keys, and typesargs.*/result.*/data.*;raw_credentialsandcandidate_constraintstay out of the bag)ppe-apl-cmfsrc/lib.rs— rustdoc points atdocs/cmf-extensions.md.src/extensions_bridge.rs— rustdoc onextract_extensionsrestates the per-type contract.present_slots_follow_the_absent_value_contract— present empty slots emit empty sets, omit optionals, skip flattened bools, write non-option zeros/false, and never emit asubject.claimsparent key.original_set_and_flattened_bools_stay_paired— a member in the set also appears as the flattened bool, and both stay in lockstep.ppe-pdp-diffCargo.toml/Cargo.lock— dev-deps onpraxis-policy-apl-cmfandpraxis-policy-coreso cases can build bags throughextract_extensions.README.md— present-emptyStringSetis in the semantic subset; new allowlist rows for omitted claim scalars; pointer todocs/cmf-extensions.md.src/cases.rsCase.apl_rule+with_aplso agreement cases also run the native APL evaluator.alice_via_bridge()— bag fromextract_extensions, not a hand-built set.empty-set— recategorized from Diverge toAgreeDeny; APLrequire(subject.teams contains "eng").bridge-empty-teams— same intent, bag from the bridge.bridge-empty-roles— emptysubject.roles/ norole.*keys; Cedarprincipal.roles.contains("hr")vs CEL/OPA original set vs APLrequire(subject.roles contains "hr").missing-claim-string/missing-claim-int— unguarded omitted scalars (allowlisted).src/allowlist.rsempty-set(now subset).missing-claim-stringandmissing-claim-int.missing-collectionto point at the contract and the original-set cases.src/lib.rsassert_aplonAgreeAllow/AgreeDeny.absent_value_agreement_cases_check_apl—empty-set,bridge-empty-teams, andbridge-empty-rolesmust carry an APL rule.Changelog
CHANGELOG.md— Unreleased Added bullet for fix(cmf): settle the extensions model and document the extension types #18; feat(test): differential testing across cedar, cel, and opa #25 subset text updated (present-empty sets in subset; omitted claim scalars on the allowlist).Test plan
make lintcargo test -p praxis-policy-apl-cmfcargo test -p praxis-policy-pdp-diffmake coverage(95.74% lines, floor 95%)