Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace mapping for namespace wildcards in Metapath exhibit inconsistent behavior #291

Closed
aj-stein-gsa opened this issue Dec 12, 2024 · 0 comments · Fixed by #305
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@aj-stein-gsa
Copy link
Contributor

aj-stein-gsa commented Dec 12, 2024

Describe the bug

Given certain assemblies fields and flags, a developer way want to write constraints and use Metapath axes relative to the current location of a constraint @target or @test to evaluate the ancestor. If the ancestor:: axis element has no explicit name (it is implied, so the OSCAL modules have it and the Metapath references ancestor::authorization-boundary, for example) it will not be correctly evaluated in the predicated. Adding the wildcard, per this issue, will similarly fail (e.g. ancestor::*:authorization-boundary).

Who is the bug affecting

Developers who use metaschema-java for Metaschema processing of OSCAL and other models with implied and explicit namespace lookups. For this report, the specific issue was noticed in Metapath with predicates that look up a predicate of a node in the current context without the namespace, and did not properly filter, nor with a wildcard, and only worked once explicit with a namespace binding.

How do we replicate this issue

Use the metaschema command in oscal-cli or metaschema-cli independently to run the constraint with id="has-authorization-boundary-diagram-link-href-target" from this branch to reproduce the error. There is no stack trace given the nature of this issue.

https://github.com/aj-stein-gsa/fedramp-automation/tree/bug-metaschema-java-291-example-ancestor-repro

Expected behavior (i.e. solution)

Given external constraints and OSCAL Metaschema modules, a Metapath @test or @target must properly evaluate a target OSCAL document instance to find an ancestor::ancestor-element without explicit namespace declarate with a /metaschema-meta-constraints/namespace-binding.

Other comments

TBD

@aj-stein-gsa aj-stein-gsa added the bug Something isn't working label Dec 12, 2024
aj-stein-gsa pushed a commit to aj-stein-gsa/fedramp-automation that referenced this issue Dec 12, 2024
aj-stein-gsa added a commit to aj-stein-gsa/fedramp-automation that referenced this issue Dec 12, 2024
@david-waltermire david-waltermire moved this from To Triage to In review in Spec and Tooling Work Board Dec 19, 2024
@david-waltermire david-waltermire self-assigned this Dec 19, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in Spec and Tooling Work Board Dec 29, 2024
@david-waltermire david-waltermire added this to the v2.2.0 milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
2 participants