fix(sdk): Fix possible panic for AttributeValueFQN.Prefix()
#1472
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.
This commit adds additional checks to validate that Attribute Name / Values are not empty or contain a slash. This fixes a panic condition where
NewAttributeValueFQNwould return without error butPrefix()would then fail when the prefix is attempted to be parsed byNewAttributeNameFQN.This commit includes unit testing, and the fuzz testing that initially discovered this issue. See there for possibly dangerous values.
An alternative or additional solution that we may want to consider:
If
Prefix()is a common or frequent operation we could proactively invoke theNewAttributeNameFQNfrom withinNewAttributeValueFQN. That way any future validation added toNewAttributeNameFQNwould be proactively checked rather than needingPrefix()to be invoked to be tested.Also included are some minor doc changes, spelling fixes, and some other fuzz testing that was co-located with these changes.
PR closes #1468