[JIRA] (IDP-2099) Change the idp-conf tests to rely on file system for idp.home

Rod Widdowson (Jira) jira at shibboleth.atlassian.net
Sun May 7 13:25:37 UTC 2023


Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 ) *commented* on IDP-2099 ( https://shibboleth.atlassian.net/browse/IDP-2099?atlOrigin=eyJpIjoiNDA1YjJjYjAyNTA1NGUzMGFhNDE0MzJiNmEwM2QwNWQiLCJwIjoiaiJ9 )

Re: Change the idp-conf tests to rely on file system for idp.home ( https://shibboleth.atlassian.net/browse/IDP-2099?atlOrigin=eyJpIjoiNDA1YjJjYjAyNTA1NGUzMGFhNDE0MzJiNmEwM2QwNWQiLCJwIjoiaiJ9 )

DefaultBeanDefinitionDocumentReader. importBeanDefinitionResource line 223

absoluteLocation = ResourcePatternUtils.isUrl(location) || ResourceUtils.toURI(location).isAbsolute();

For some reason this code doesn’t get called in a standard IdP. But basically we end up with Shroedingers resource:

* If we set idp.home to be a raw file path then this says “Its a relative open” and we open
{{% {idp.home}

\conf\global.xml}} relative to classpath:/net/shibboleth/idp/conf/global-system.xml and that doesn't end up well.

* If we set idp.home to be file:\dir\dir ( file:dirdir ) then we trip over our IdPPropertiesApplicationContextInitializer when we try to get the absolute path for idp.home and it throws a wobblu because there is already a file:\ ( file: ) prefix (on windows the woby involves the path containing another : but on unix it will be similar.

If we program around that in our initializer we then trip over resources that look like this conditional: file:\path\path\general-authn.xml ( file:pathpathgeneral-authn.xml )

So IdPHome can only start with a protocol if that is classpath: I don’t know why passing a raw filesystem path works on a proper IdP (I don’t see any logging from DefaultBeanDefinitionDocumentReader in the idp-process logs even with spring at TRACE, but I suspect that is where I will go next (probably to the jetty logs)

My head is now officially full so I’m going to walk away for a bit. I have pushed my code to a dev branch if anyone want to dive in. Instructions

* Edit net.shibboleth.idp.test.flows.AbstractFlowTest#setupIdPHome to contain the real absolute path of your idp-conf directory. (This is a short cut and is needed until we have a module for the basic configuration and test configuration so as to populate the *files* that are needed by the test).
the function

* Creates an empty install tree
* (for now) populates it from the folders you specified above
* Deploys any modules specified (“Hello” for now)
* There is an @AfterSuite to tidy up you might want to comment that out.

* Test that nothing is broken
* Go into net.shibboleth.idp.test.TestEnvironmentApplicationContextInitializer and flip the setup of idp.home to point to the one we created.
* Watch in awe as the idp-conf tests explodes into bits

( https://shibboleth.atlassian.net/browse/IDP-2099#add-comment?atlOrigin=eyJpIjoiNDA1YjJjYjAyNTA1NGUzMGFhNDE0MzJiNmEwM2QwNWQiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/IDP-2099#add-comment?atlOrigin=eyJpIjoiNDA1YjJjYjAyNTA1NGUzMGFhNDE0MzJiNmEwM2QwNWQiLCJwIjoiaiJ9 )

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#100225- sha1:7f918b6 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20230507/41139b5f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-f32ca54a-d6c7-48a3-9acf-142f16a8de33
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230507/41139b5f/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-1694eb7c-4604-4f52-ae8e-8ce7ec22f53b
Type: image/png
Size: 448 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230507/41139b5f/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-bfea59f8-24d1-4bf8-ad55-bcfb66d8272e
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20230507/41139b5f/attachment-0005.png>


More information about the commits mailing list