[JIRA] (IDP-1793) Use Suppliers for HttpRequest/Response
Scott Cantor (Jira)
jira at shibboleth.atlassian.net
Tue Jul 26 14:26:47 UTC 2022
Scott Cantor ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A5b78efc9-1379-42cc-a3f6-56c6ea3a0007 ) *commented* on IDP-1793 ( https://shibboleth.atlassian.net/browse/IDP-1793?atlOrigin=eyJpIjoiODRhMmRlMWVkOTM4NDUyZmJiMzA3MzZjNmFkNDA1ZWMiLCJwIjoiaiJ9 )
Re: Use Suppliers for HttpRequest/Response ( https://shibboleth.atlassian.net/browse/IDP-1793?atlOrigin=eyJpIjoiODRhMmRlMWVkOTM4NDUyZmJiMzA3MzZjNmFkNDA1ZWMiLCJwIjoiaiJ9 )
Originally I was thinking the end-game here was to have the beans we defined stop implementing HttpServletRequest/Response directly so they’d be typed as Supplier only. The problem is the scripts, because then everybody would have to change their scripts to invoke the supplier indirection method, which I don’t think we want.
So the fallback was just to change all our typed injection points to use Supplier<> so that directly injecting the interface would fail, but we would make our ThreadLocal proxies implement both the real interface and Supplier<> (I tested that, it appears to be fine), so nothing really changes, except any inadvertent injection of something that’s not Supplier into our typed beans fails.
I guess a bit more of a hack, but one that would let us stop exporting the real interface from the ThreadLocal beans, would be to actually check for the Supplier interface in our custom object injection points, and perform the indirection to get() when we inject the custom object into the script. That might be a defensible workaround, given that we get compile-time enforcement of detecting this anti-pattern.
( https://shibboleth.atlassian.net/browse/IDP-1793#add-comment?atlOrigin=eyJpIjoiODRhMmRlMWVkOTM4NDUyZmJiMzA3MzZjNmFkNDA1ZWMiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/IDP-1793#add-comment?atlOrigin=eyJpIjoiODRhMmRlMWVkOTM4NDUyZmJiMzA3MzZjNmFkNDA1ZWMiLCJwIjoiaiJ9 )
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#100202- sha1:9567c64 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220726/31a667b6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-ffa8f9d2-6f93-45e5-8377-a64d07c0e41a
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220726/31a667b6/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-85a47615-ff20-4b9b-8f8f-e8270164d7b9
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220726/31a667b6/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-3e3e19f5-429f-4025-a587-7dad7053cb91
Type: image/png
Size: 468 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220726/31a667b6/attachment-0005.png>
More information about the commits
mailing list