[JIRA] (IDP-1881) Failed TemplateAttribute should generate a runtime warning (or error)

Matthew Slowe (Jira) jira at shibboleth.atlassian.net
Wed Nov 24 15:47:19 UTC 2021


Matthew Slowe ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=5c45da4b23f5bf67262143c7 ) *created* an issue

Identity Provider ( https://shibboleth.atlassian.net/browse/IDP?atlOrigin=eyJpIjoiMGE5MWU4NjliMDg0NGFjMDliZTllYjJiMTZlOWUwYmYiLCJwIjoiaiJ9 ) / Improvement ( https://shibboleth.atlassian.net/browse/IDP-1881?atlOrigin=eyJpIjoiMGE5MWU4NjliMDg0NGFjMDliZTllYjJiMTZlOWUwYmYiLCJwIjoiaiJ9 ) IDP-1881 ( https://shibboleth.atlassian.net/browse/IDP-1881?atlOrigin=eyJpIjoiMGE5MWU4NjliMDg0NGFjMDliZTllYjJiMTZlOWUwYmYiLCJwIjoiaiJ9 ) Failed TemplateAttribute should generate a runtime warning (or error) ( https://shibboleth.atlassian.net/browse/IDP-1881?atlOrigin=eyJpIjoiMGE5MWU4NjliMDg0NGFjMDliZTllYjJiMTZlOWUwYmYiLCJwIjoiaiJ9 )

Issue Type: Improvement Affects Versions: 4.1.4 Assignee: Rod Widdowson ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=59fb32bbc24efb3c4ed3c977 ) Components: Attribute Resolver Created: 24/Nov/21 10:47 AM Priority: Trivial Reporter: Matthew Slowe ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=5c45da4b23f5bf67262143c7 )

When a Template attribute definition fails at runtime the plain text of the template is emitted to the consuming service. This case should be detected and either a warning or error raised as we should not be emitting values we know to the wrong to a consuming service.

For example:

<DataConnector id= "mydc" xsi:type= "Static" >
       <Attribute id= "dodgyattribute" >
               <Value> TEST </Value>
       </Attribute>
</DataConnector>

<AttributeDefinition id= "testattribute" xsi:type= "Template" >
       <InputDataConnector ref= "mydc" attributeNames= "dodgyattribute" />
       <Template> ${dodgyattribute.tolowerCase()} </Template>
</AttributeDefinition>

Produces a debug log:

Template is '${dodgyattribute.tolowerCase()}'
Adding value 'TEST' for attribute 'dodgyattribute' to the template context
Evaluating template
Result of template evaluating was '${dodgyattribute.tolowerCase()}'
produced an attribute with the following values [StringAttributeValue{value=${dodgyattribute.tolowerCase() }} ]

As the template has failed to run, this should generate a warning or, possibly, configurably, an error.

While this example template is obviously broken, could this potentially also occur when an unexpected object type is fed into the Template?

This appears to have been touched on in IDP-1497 ( https://shibboleth.atlassian.net/browse/IDP-1497 ) Closed but I'm suggesting that rather than silently swallow the error case, it should be surfaced somewhere and the failed template string should not be emitted to the consumer.

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

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#100183- sha1:8cd14d0 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20211124/ff4a5f2c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-d4e61627-7741-49be-ad4d-05a3d448cf92
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20211124/ff4a5f2c/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-18126abd-f210-4d93-a72d-ba027f5df978
Type: image/png
Size: 457 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20211124/ff4a5f2c/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-fed0c574-58cb-4731-9fcb-b9b8d5f49b60
Type: image/png
Size: 563 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20211124/ff4a5f2c/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-579fc16d-4339-459a-95f6-e7f92729f29c
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20211124/ff4a5f2c/attachment-0007.png>


More information about the commits mailing list