Harden enum-value-formatting meta:enum handling#821
Open
Mehrn0ush wants to merge 1 commit intoCycloneDX:2.0-devfrom
Open
Harden enum-value-formatting meta:enum handling#821Mehrn0ush wants to merge 1 commit intoCycloneDX:2.0-devfrom
Mehrn0ush wants to merge 1 commit intoCycloneDX:2.0-devfrom
Conversation
Use own-property checks and require meta:enum to be a plain object. Fix coverage check to test key presence, improve meta:enum paths, and de-duplicate enum value issues. Fixes CycloneDX#820. Signed-off-by: Mehrn0ush <mehrnoush.vaseghi@gmail.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.
Harden enum-value-formatting check
Fixes #820
Summary
Harden
meta:enumhandling to be deterministic and safe: use own-property checks, requiremeta:enumto be a plain object (emit explicit error when invalid), fix coverage to check key presence (not truthiness), improvemeta:enumpaths, and de-duplicate enum value issues. No API/config changes.Changes
meta:enumviaObject.prototype.hasOwnProperty.call(parent, 'meta:enum')(no prototype-chain lookup).meta:enumis a plain object; emit one ERROR when invalid type.hasOwnProperty) onmeta:enum(no truthiness false-positives, no inherited keys).meta:enumpath; fix extra-keys path derivation.