[JIRA] (IDP-1793) Use Suppliers for HttpRequest/Response
Rod Widdowson (Jira)
jira at shibboleth.atlassian.net
Thu Jul 28 18:35:56 UTC 2022
Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 ) *commented* on IDP-1793 ( https://shibboleth.atlassian.net/browse/IDP-1793?atlOrigin=eyJpIjoiOTJiYjc1MmFhMjAzNDk3MzliYzI3YjQ3MTgxY2QzYjIiLCJwIjoiaiJ9 )
Re: Use Suppliers for HttpRequest/Response ( https://shibboleth.atlassian.net/browse/IDP-1793?atlOrigin=eyJpIjoiOTJiYjc1MmFhMjAzNDk3MzliYzI3YjQ3MTgxY2QzYjIiLCJwIjoiaiJ9 )
>
>
>
> I’m not sure how much our goal here is warnings to deployers, it was
> really more of a code hygiene issue for us.
>
>
Fair enough
>
>
>
> I think it’s still better if the property name fits the contract anyway
> though.
>
>
Agreed.
>
>
>
> . It can just check for instanceof Supplier and invoke a cast+get
> operation to inject the supplied object and the scripts won’t know the
> difference.
>
>
I’m not convinced that we can do that without a great deal of cumbersomeness and fragility. Remember that the injected customObject might be a map (or array or any arbitrary structure) I'm pretty sure we have told people to inject multiple values using a map and use custom ["HttpRequest"] type syntax to get at the thing they want. Worse still it might be immutable
I don't see a safe way of dealing with all of this that - but I may be missing something. But I really don't want to break scripts (and, thinking about it, I don't even want to make people change scripts - they tend to be fragile).
>
>
>
> change those 2 beans to implement only Supplier<> and not the servlet
> interfaces themselves.
>
>
I think we can do this (but my spring fu is weak at the moment) by saying something like
<bean id="shibboleth.HttpServletRequestSupplier"
class="net.shibboleth.utilities.java.support.net.ThreadLocalHttpServletRequestProxy" />
<bean id="shibboleth.HttpServletRequest" scope="prototype"
class="net.shibboleth.utilities.java.support.net.HttpServletRequestResponseContext"
factory-method="getRequest"/>
Actually that second bean definition would work now (I think),
What I was looking for was some sort of bean definition using SEL to say
{{ #
{getBean('shibboleth.HttpServletRequestSupplier').get}
}}
Either way I’ll push (to dev branches) what I’ve got so far (which answers the code hygiene thing) and if it looks OK to you make in mainline for both 4.3 and 5.0
( https://shibboleth.atlassian.net/browse/IDP-1793#add-comment?atlOrigin=eyJpIjoiOTJiYjc1MmFhMjAzNDk3MzliYzI3YjQ3MTgxY2QzYjIiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/IDP-1793#add-comment?atlOrigin=eyJpIjoiOTJiYjc1MmFhMjAzNDk3MzliYzI3YjQ3MTgxY2QzYjIiLCJwIjoiaiJ9 )
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#100203- sha1:db6c294 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20220728/18a4c295/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-9359d199-1df4-4a8b-84d0-56c413765b58
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220728/18a4c295/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-74846153-ac48-4b85-8002-645625f18d2d
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220728/18a4c295/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-3448573f-1f97-4e58-9760-02070151eb7c
Type: image/png
Size: 468 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20220728/18a4c295/attachment-0005.png>
More information about the commits
mailing list