fix(bnf,schema): harmonize SecurityQueryFilter and add FILTERLIST#579
Open
aorzelskiGH wants to merge 1 commit into
Open
fix(bnf,schema): harmonize SecurityQueryFilter and add FILTERLIST#579aorzelskiGH wants to merge 1 commit into
aorzelskiGH wants to merge 1 commit into
Conversation
The API and Security specs gave two incompatible definitions for SecurityQueryFilter, and the API grammar lacked FILTERLIST entirely. BNF (partials/bnf/grammar.bnf): - <SecurityQueryFilter> now uses "FRAGMENT:" <FieldIdentifierFragment> instead of <FragmentObject>, aligning with aas-specs-security. - <AccessPermissionRule> now accepts an optional FILTERLIST block. - Added the <FieldIdentifierFragment> production family (AAS, SM, SME, CD, AAS Descriptor, SM Descriptor) together with the supporting *Fragment clauses (SpecificAssetIds, SemanticId, Reference, Endpoint, SmDescriptor). JSON Schema (partials/query-json-schema.json and pages/schema.adoc): - Added FragmentFieldIdentifier definition (regex sibling of modelStringPattern, restricted to fragment-legal fields). - SecurityQueryFilter.FRAGMENT now $refs FragmentFieldIdentifier (was: plain string). - AccessPermissionRule gains FILTERLIST (array of SecurityQueryFilter). Refs: Review Finding T-02 Made-with: Cursor
| }, | ||
| "FragmentFieldIdentifier": { | ||
| "type": "string", | ||
| "pattern": "^(?:\\$aas#(?:idShort|assetInformation\\.assetType|assetInformation\\.globalAssetId|assetInformation\\.specificAssetIds\\[[0-9]*\\](?:\\.externalSubjectId(?:\\.keys\\[[0-9]*\\])?)?|submodels\\[[0-9]*\\](?:\\.keys\\[[0-9]*\\])?)|\\$sm#(?:semanticId(?:\\.keys\\[[0-9]*\\])?|idShort|id)|\\$sme(?:\\.[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?(?:\\[[0-9]*\\])*(?:\\.[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?(?:\\[[0-9]*\\])*)*)?(?:#(?:semanticId(?:\\.keys\\[[0-9]*\\])?|idShort|value|valueType|language))?|\\$cd#idShort|\\$aasdesc#(?:idShort|description|displayName|extension|administration|assetKind|assetType|globalAssetId|specificAssetIds\\[[0-9]*\\](?:\\.externalSubjectId(?:\\.keys\\[[0-9]*\\])?)?|endpoints\\[[0-9]*\\]|submodelDescriptors\\[[0-9]*\\](?:\\.(?:semanticId(?:\\.keys\\[[0-9]*\\])?|idShort|endpoints\\[[0-9]*\\]))?)|\\$smdesc#(?:semanticId(?:\\.keys\\[[0-9]*\\])?|idShort|endpoints\\[[0-9]*\\]))$" |
| "$ref": "#/definitions/SecurityQueryFilter", | ||
| "additionalProperties": false | ||
| }, | ||
| "FILTERLIST": { |
This was referenced May 20, 2026
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
Harmonizes
SecurityQueryFilterbetweenaas-specs-apiandaas-specs-security, and adds the missingFILTERLISTconstruct tothe API grammar and JSON schemas. Pairs with the review-finding T-02
"incompatible FILTER definitions".
Problem
<SecurityQueryFilter>over<FragmentObject>(i.e.
"FRAGMENT" <RouteLiteral>), while the Security BNF uses"FRAGMENT:" <FieldIdentifierFragment>. These are syntacticallydistinct and describe different things.
AccessPermissionRulehad noFILTERLIST, whereas theSecurity spec has used
FILTERLISTfor some time.SecurityQueryFilter.FRAGMENTas a plainstring, losing all validation semantics of a field identifier.Consequence: Implementers cannot reuse one parser/validator for both
specs; rules valid under the security spec are not valid under the
API spec and vice versa.
Solution
The Security spec is taken as the canonical form.
BNF (
partials/bnf/grammar.bnf):<SecurityQueryFilter>is rewritten to"FRAGMENT:" <ws> <FieldIdentifierFragment>.<AccessPermissionRule>gains the optional"FILTERLIST:" ( <SecurityQueryFilter> )*block (sibling ofFILTER).<FieldIdentifierFragment>family (AAS, SM, SME, CD, AASDescriptor, SM Descriptor) and its supporting
*Fragmentclauses(
SpecificAssetIds,SemanticId,Reference,Endpoint,SmDescriptor) are ported fromaas-specs-security.JSON Schema (
partials/query-json-schema.jsonandpages/schema.adoc):FragmentFieldIdentifierdefinition (regex sibling ofmodelStringPattern, restricted to fragment-legal fields).SecurityQueryFilter.FRAGMENTbecomes$ref: "#/definitions/FragmentFieldIdentifier".AccessPermissionRule.properties.FILTERLISTadded (array ofSecurityQueryFilter).Impact
no change here; this PR aligns API to Security).
FILTER: FRAGMENT "..."(literal route form) werenever interoperable and are now explicitly invalid — recommended
migration:
FILTER: FRAGMENT: $sme("...").path#idShort.partial (single source of truth).
Review notes
<FieldIdentifierFragment>productionsis byte-identical to
aas-specs-security/partials/bnf/access-rules.bnflines 224–235.
FragmentFieldIdentifierregex is identical to the one inaas-specs-security/partials/json/aas-queries-and-access-rules-schema.jsonline 17.
FILTERLISTand the newFILTERfragment syntax are intentionally left for PR 11 to keep the diff
focused.
Related
Review Finding T-02: SecurityQueryFilter / FILTERLIST mismatch.
Depends on: T-04 (
aas-specs-securityPR #71) for schema validity.