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

Fix handling of schema extensions when filtering coerced values in SCIMMY.Types.SchemaDefinition #38

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

sleelin
Copy link
Collaborator

@sleelin sleelin commented Aug 1, 2024

Currently, filtering of included or excluded attributes by the SchemaDefinition type class before return does not correctly handle namespaced extension attributes. This is due to the double handling of extension schema filtering, and insufficient evaluation of overall filter structure. A specific example of this is evident when making a request for a User resource, extended with the EnterpriseUser schema, and setting excludedAttributes to any attribute from the User schema.

The internal filter method of the SchemaDefinition class has been rewritten to first capture all excluded and included attribute filters. If no explicit inclusions were specified, and all supplied filters are exclusions, all attributes and extensions not explicitly excluded will instead be included (fixes #37). Double handling of extension schema filtering has also been resolved, as inclusions and exclusions will only be evaluated when the filter condition is not for a namespaced attribute. Test fixtures for the coerce method of the SchemaDefinition class have also been updated to verify attribute, extension, and namespaced attribute filtering is behaving as expected.

@sleelin sleelin added the bug Something isn't working label Aug 1, 2024
@sleelin sleelin added this to the 1.2.3 milestone Aug 1, 2024
@sleelin sleelin self-assigned this Aug 1, 2024
@sleelin sleelin linked an issue Aug 1, 2024 that may be closed by this pull request
@sleelin sleelin merged commit a5f1458 into main Aug 1, 2024
2 checks passed
@sleelin sleelin deleted the issue/37-extension-attribute-filtering branch August 1, 2024 07:08
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.

Extension attributes are filtered when there's excludedAttributes param
1 participant