<style>
/* Changing the layout to use less space for mobiles */
@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
    #email-body { min-width: 30em !important; }
    #email-page { padding: 8px !important; }
    #email-banner { padding: 8px 8px 0 8px !important; }
    #email-avatar { margin: 1px 8px 8px 0 !important; padding: 0 !important; }
    #email-fields { padding: 0 8px 8px 8px !important; }
    #email-gutter { width: 0 !important; }
}
</style>
<div id="email-body">
<table id="email-wrap" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#f0f0f0;color:#000000;width:100%;">
    <tr valign="top">
        <td id="email-page" style="padding:16px !important;">
            <table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border:1px solid #bbbbbb;color:#000000;width:100%;">
                <tr valign="top">
                    <td bgcolor="#ffffff" style="background-color:#ffffff;color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;line-height:1;"><img src="https://shibboleth.net/images/shib_240x83.png" alt="" style="vertical-align:top;" /></td>
                </tr><tr valign="top">
    <td id="email-banner" style="padding:32px 32px 0 32px;">

                
        
        
            <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="width:100%;">
    <tr valign="top">
        <td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;padding:0;">
                                        <img id="email-avatar" src="https://issues.shibboleth.net/jira/secure/useravatar?ownerId=rdw%40iay.org.uk&avatarId=10124" alt="" height="48" width="48" border="0" align="left" style="padding:0;margin: 0 16px 16px 0;" />
                        <div id="email-action" style="padding: 0 0 8px 0;font-size:12px;line-height:18px;">
                                    <a class="user-hover" rel="rdw@iay.org.uk" id="email_rdw@iay.org.uk" href="https://issues.shibboleth.net/jira/secure/ViewProfile.jspa?name=rdw%40iay.org.uk" style="color:#326ca6;">Rod Widdowson</a>
     commented on <img src="https://issues.shibboleth.net/jira/images/icons/issue_subtask.gif" height="16" width="16" border="0" align="absmiddle" alt="Sub-task"> <a style='color:#326ca6;text-decoration:none;' href='https://issues.shibboleth.net/jira/browse/IDP-265'>IDP-265</a>
            </div>
                        <div id="email-summary" style="font-size:16px;line-height:20px;padding:2px 0 16px 0;">
                <a style='color:#326ca6;text-decoration:none;' href='https://issues.shibboleth.net/jira/browse/IDP-265'><strong>Principal Connectors:  Define structure and APIs</strong></a>
            </div>
                    </td>
    </tr>
</table>
    </td>
</tr>
<tr valign="top">
    <td id="email-fields" style="padding:0 32px 32px 32px;">
        <table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
            <tr valign="top">
                <td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr valign="top">
    <td colspan="2" style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 16px 0;width:100%;">
        <div class="comment-block" style="background-color:#edf5ff;border:1px solid #dddddd;color:#000000;padding:12px;"><p>In V2 the Principal Connectors are part of the attribute resolution - because they sort of fit and because they are only ever used during Attribute Authority operations.  This is reflected in the schema for their configuration although a great deal of the config isn't used (for instance dependencies).</p>

<p>I initially decide that this would not be sensible to carry forward, but the code works well as it is and right now I want to do as much porting and as little new stuff as possible (anti-second system syndrome).</p>

<p>In V3 things are slightly confused since we have the Canonicalization step and as we noted in Columbus this is quite close in function to a principal connector.</p>

<p>So I introduced (checkin r4294) an interface:</p>

<p>PrincipalConnectorDefinition&lt;ConsumedContext extends BaseContext&gt; </p>

<p>with but one method </p>

<p>public Optional&lt;String&gt; resolve(@Nonnull final ConsumedContext messageContext) throws ResolutionException;</p>

<p>Which has the pleasant property that it fits exactly onto the BaseResolverPlugin, which is what the moral equivalent of what the principal connectors did in V2.  However, and critically, it provides us with the hook point to put the Canonicalizers (in their case the ConsumedContext would probably be a LoginContext, or a context which allows us to get there.</p>

<p>I did have to rename AttributeResolutionContext into ResolutionContext (and break the linkage to AttributeContext).  Checkin r4293.</p>

<p>This does leave us with the open question of where to put the code for the new interface.  Currently it is in along side the attribute resolvers.  However when we come to do the Canonicalizers we will need to find somewhere else.  Or of course we may decide that making the two the same doesn't work in which case the split is easily achieved.  </p>

<p>We could also/as well decide to remove the PrincipalConnectors from the Attribute resolver in its entirety.  However for now we should leave things as much like V2 as possible unless we have a good reason not to.</p>

<p>The PrincipalConnectors will pretty much be a port of the V2 ones, however I will move more function into the base class, and also put all responsibility for getting the IssuingEntityID and Format in there (in V2 this is part of the attribute resolver), my expectation is that these will be static methods when we have the contexts completely nailed (see below).</p>

<p>The Attribute resolver will gather setters and getters for the PrincipalConnectors and a new "resolvePrincipalName" method.</p>

<p>Since the OpenSAML contexts are not ready I have used the usual trick of adding a Function to naviagte from the resolutionContext to the (old style) SAMLMessageContext.  My assumption is that when they are done we will be able to just lookup the correct type in the parent of he passed in attributeResoltuonContext and then a helper functions used by the attribute resolver will become static which will make life easier.</p>

<p>The base class for the old style princial connectors (BaseSubjectNamePrincipalConnectorDefinition) plus tests are next up, then the additions to the attribute resolver.  </p>

<p>Finally the individual principal connectors will be checked in (to -impl)</p></div>
        <div style="color:#505050;padding:4px 0 0 0;">                </div>
    </td>
</tr>
                    </table>
                </td>
            </tr>
        </table>
    </td>
</tr>













            </table>
        </td><!-- End #email-page -->
    </tr>
    <tr valign="top">
        <td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:10px;line-height:14px;padding: 0 16px 16px 16px;text-align:center;">
            This message is automatically generated by JIRA.<br />
            If you think it was sent incorrectly, please contact your JIRA administrators<br />
            For more information on JIRA, see: <a style='color:#326ca6;' href='http://www.atlassian.com/software/jira'>http://www.atlassian.com/software/jira</a>
        </td>
    </tr>
</table><!-- End #email-wrap -->
</div><!-- End #email-body -->