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

Allow leading special characters for attribute names in filter strings #35

Merged
merged 5 commits into from
Jul 24, 2024

Conversation

sleelin
Copy link
Collaborator

@sleelin sleelin commented Jul 24, 2024

Currently, attribute naming rules are different between the SCIMMY.Types.Attribute class and the SCIMMY.Types.Filter class. For attributes, their name is allowed to begin with the $, -, and _ special characters. For filters, attribute names can only begin with the _ special character. This inconsistency causes filter expression parsing to fail when an attribute name begins with the $ or - special characters, as allowed in the attribute class. A specific example of this is when attempting to filter against the commonly used $ref attribute.

The tokenising method of Filter class has had its naming rules relaxed, now allowing for any leading special character in attribute names (fixes #33). This has been achieved by adding explicit logical operator and comparator detection, leaving only the detection of attribute names and potential unescaped string values in "word" tokens. In the Attribute class, a new check of attribute names in the class constructor has been implemented for invalid leading characters, which currently will not match, but is in place for the possible future addition of stricter, spec-compliant naming rules.

The test fixtures for the Attribute and Filter classes have also been updated to check that leading special characters are allowed, and correctly parsed.

@sleelin sleelin added the bug Something isn't working label Jul 24, 2024
@sleelin sleelin added this to the 1.2.3 milestone Jul 24, 2024
@sleelin sleelin self-assigned this Jul 24, 2024
@sleelin sleelin merged commit a8fa579 into main Jul 24, 2024
2 checks passed
@sleelin sleelin deleted the issue/33-filter-ref-attributes branch July 24, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

The SCIMMY filter does not support special character in the attribute name
1 participant