[JIRA] (JSATTR-12) Filter service implementation is mutating via an immutably-defined API

Scott Cantor (Jira) jira at shibboleth.atlassian.net
Thu Apr 20 19:44:34 UTC 2023


Scott Cantor ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A5b78efc9-1379-42cc-a3f6-56c6ea3a0007 ) *created* an issue

Shibboleth Attribute Library - Java ( https://shibboleth.atlassian.net/browse/JSATTR?atlOrigin=eyJpIjoiNzY5YmZkNTcwNGRlNGY5Mzk1MjNkZWFmMzViZGYzNjUiLCJwIjoiaiJ9 ) / Bug ( https://shibboleth.atlassian.net/browse/JSATTR-12?atlOrigin=eyJpIjoiNzY5YmZkNTcwNGRlNGY5Mzk1MjNkZWFmMzViZGYzNjUiLCJwIjoiaiJ9 ) JSATTR-12 ( https://shibboleth.atlassian.net/browse/JSATTR-12?atlOrigin=eyJpIjoiNzY5YmZkNTcwNGRlNGY5Mzk1MjNkZWFmMzViZGYzNjUiLCJwIjoiaiJ9 ) Filter service implementation is mutating via an immutably-defined API ( https://shibboleth.atlassian.net/browse/JSATTR-12?atlOrigin=eyJpIjoiNzY5YmZkNTcwNGRlNGY5Mzk1MjNkZWFmMzViZGYzNjUiLCJwIjoiaiJ9 )

Issue Type: Bug Assignee: Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 ) Components: Attribute Filter Created: 20/Apr/23 3:44 PM Fix Versions: 5.0.0 Priority: Trivial Reporter: Scott Cantor ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A5b78efc9-1379-42cc-a3f6-56c6ea3a0007 )

The AttributeFilterServiceImpl class is mutating the returned map from AttributeFilterContext.getFilteredIdPAttributes(), and this is both violating the constraint on the method definition but also only working because apparently we don’t first call setFilteredIdPAttributes ahead of it.

The underlying collections are mutable at c’tor time, but setFilteredIdPAttributes makes them immutable in both null and non-null cases.

It’s possible we need to make the API mutable but this is probably a pre-optimization thing.

I don’t know the filter service code well enough to change it without more review, but it’s definitely wrong right now.

( https://shibboleth.atlassian.net/browse/JSATTR-12#add-comment?atlOrigin=eyJpIjoiNzY5YmZkNTcwNGRlNGY5Mzk1MjNkZWFmMzViZGYzNjUiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/JSATTR-12#add-comment?atlOrigin=eyJpIjoiNzY5YmZkNTcwNGRlNGY5Mzk1MjNkZWFmMzViZGYzNjUiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100222- sha1:57eb20e )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20230420/3f29960d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-84a920e5-59da-4053-a69b-e5f7200b0df1
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230420/3f29960d/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-4c0be54a-4f3a-4546-9d59-a30660f98855
Type: image/png
Size: 446 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230420/3f29960d/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-afb4446f-2e90-4b24-9360-6ab0871cb9d7
Type: image/png
Size: 345 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230420/3f29960d/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-1445f1a9-0ee1-4683-acaa-90d3d11fa4ff
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230420/3f29960d/attachment-0007.png>


More information about the commits mailing list