docs(access-rules): add normative Evaluation Semantics clause - #79
docs(access-rules): add normative Evaluation Semantics clause#79aorzelskiGH wants to merge 2 commits into
Conversation
Specify how the Access Rule Model MUST be evaluated so that
implementations behave deterministically:
- Rule combination
permit-overrides; DISABLED rules are ignored at enforcement;
applicability requires OBJECT/RIGHT/field resolution plus a
FORMULA evaluating to true; no applicable ALLOW => deny.
- Error handling
missing CLAIM, failing cast, or Descriptor-based FieldIdentifier
in a non-Registry profile => rule is "not applicable" (neither
grants nor denies, MUST NOT fail evaluation);
unresolvable FieldIdentifier inside a comparison => false;
unresolved USEACL/USEOBJECTS/USEFORMULA/USEATTRIBUTES or
schema-invalid document => reject at load time.
- Filter combination
FILTERs on the same FRAGMENT across applicable ALLOW rules are
OR-combined; FILTERs on different FRAGMENTs are applied
independently; empty FILTERLIST is equivalent to no filter;
absence of FILTER/FILTERLIST exposes the full matched object.
- Interaction with the Query Language
fixed order (parse -> candidate set -> apply rules -> apply
FILTER/FILTERLIST); implementations may optimise as long as the
observable outcome is preserved.
Refs: Review Finding T-15
Made-with: Cursor
|
|
||
| === Filter Combination | ||
|
|
||
| * If several applicable ALLOW rules define a `FILTER` on the same `FRAGMENT`, the individual `CONDITION`s are combined with logical OR: the union of matching fragments is exposed. |
There was a problem hiding this comment.
This is only the case when implementaion supports combined access rules handling. make this more clear
There was a problem hiding this comment.
Also explain that multiple filters within a single access rule are handled as a logical AND. Correlating filters across multiple rules are handled as a logical OR.
| The following situations MUST NOT cause evaluation to fail; instead the referencing rule is classified as *inapplicable* and does not contribute to the ALLOW set: | ||
|
|
||
| * a required CLAIM is not present in the access token; | ||
| * a cast produces an invalid value (e.g. `dateTime("abc")`); |
There was a problem hiding this comment.
This is probably too strict. Incorrect casts on FieldIdentifier should not cause the operation to fail. Instead, only the casts that are valid should be applied, and the others should be ignored.
| * a required CLAIM is not present in the access token; | ||
| * a Descriptor-based FieldIdentifier is used in a non-Registry profile where descriptors are not available. | ||
|
|
||
| The following situations MUST produce a *comparison result of `false`*, so the containing formula continues to evaluate normally: |
There was a problem hiding this comment.
so the containing formula continues to evaluate normally
-> is self explainory
| * a cast cannot produce any valid value for the containing comparison, e.g. all values of a FieldIdentifier fail `dateTime(...)` conversion; | ||
| * a list-valued FieldIdentifier is evaluated against a comparison operator whose right-hand side is a scalar and no element matches. | ||
|
|
||
| The following situations MUST cause the access rule set to be *rejected at load time*; evaluation MUST NOT begin: |
Martin187187
left a comment
There was a problem hiding this comment.
this has to be inspected in detail
Summary
Add a normative
Evaluation Semanticsclause toaccess-rule-model.adocso that rule combination, error cases and filter combination behave deterministically across implementations.Problem
The current specification describes the syntax of access rules in detail, but leaves several evaluation questions implicit:
CLAIMis missing, a cast fails, or a FieldIdentifier does not resolve on the target?FILTER/FILTERLISTbe combined across matching rules?Without normative rules, implementations diverge (fail-open vs. fail-closed vs. error), blocking conformance testing.
Solution
Introduce
Evaluation Semantics (normative)covering:FORMULA=true.false; unresolved USEACL/USEOBJECTS/USEFORMULA/USEATTRIBUTES or schema-invalid document => reject at load time.Affected files
documentation/IDTA-01004/modules/ROOT/pages/access-rule-model.adocReview notes
admin-shell-io/aas-specs-api#585adds the matchingQuery Evaluation Semanticsclause.Descriptor FieldIdentifier Applicability(docs(access-rules): clarify Descriptor FieldIdentifier applicability #78) andXOR/Mix(PR fix(schema): use anyOf where BNF allows mixed inline and named groups #75).Refs: Review Finding T-15