New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'attribute-filter.xml.vm' template not 100% compatible in 3.1.4 #1312

Closed
mzico opened this Issue Oct 23, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@mzico
Contributor

mzico commented Oct 23, 2018

While creating new Trust relationship we getting below error in oxtrust.log:

2018-10-23 13:39:30,331 ERROR [qtp1744347043-467] [apache.velocity.runtime.parser.node.ASTComparisonNode] (ASTComparisonNode.java:100) - Left side ($trustParams.trustEntityIds.get($trustRelationship.inum).size()) of comparison operation has null value at attribute-filter.xml.vm[line 8, column 93]

@mzico mzico added the bug label Oct 23, 2018

@mzico mzico added this to the 3.1.5 milestone Oct 23, 2018

@syntrydy

This comment has been minimized.

Contributor

syntrydy commented Nov 12, 2018

@mzico you can the attribute-filter.xml.vm content to look like this:

<?xml version="1.0" encoding="UTF-8"?>
<AttributeFilterPolicyGroup id="ShibbolethFilterPolicy"
        xmlns="urn:mace:shibboleth:2.0:afp"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:mace:shibboleth:2.0:afp http://shibboleth.net/schema/idp/shibboleth-afp.xsd">

#foreach( $trustRelationship in $trustParams.trusts )
    #if ($trustParams.trustEntityIds.get($trustRelationship.inum))
      #set ($isFederation = ($trustParams.trustEntityIds.get($trustRelationship.inum).size() > 1))
    #else
    #end
    #if ($trustParams.trustIds.get($trustRelationship.inum))

    <!-- Release some attributes to an SP. -->
    <AttributeFilterPolicy id="SiteApp$trustParams.trustIds.get($trustRelationship.inum)">

        #if ($trustRelationship.isResearchBundle())
        <PolicyRequirementRule xsi:type="AND">
            <Rule xsi:type="EntityAttributeExactMatch"
                        attributeName="http://macedir.org/entity-category"
                        attributeValue="http://refeds.org/category/research-and-scholarship"/>
            <Rule xsi:type="EntityAttributeExactMatch"
                        attributeName="http://macedir.org/entity-category"
                        attributeValue="http://id.incommon.org/category/registered-by-incommon"/>
            #if ($isFederation)

                <Rule xsi:type="OR">
                    #foreach( $entityId in $trustParams.trustEntityIds.get($trustRelationship.inum) )
                        <Rule xsi:type="Requester" value="$entityId" />
                    #end
                </Rule>
            #else

                <Rule xsi:type="Requester" value="$trustParams.trustEntityIds.get($trustRelationship.inum).get(0)" />
            #end
        </PolicyRequirementRule>
        #else
            #if ($isFederation)

        <PolicyRequirementRule xsi:type="OR">
            #foreach( $entityId in $trustParams.trustEntityIds.get($trustRelationship.inum) )
                <Rule xsi:type="Requester" value="$entityId" />
            #end
        </PolicyRequirementRule>
            #else

        <PolicyRequirementRule xsi:type="Requester" value="$trustParams.trustEntityIds.get($trustRelationship.inum).get(0)" />
            #end
        #end

        #foreach( $attribute in $trustRelationship.releasedCustomAttributes )

        <AttributeRule attributeID="$attribute.name">
            <PermitValueRule xsi:type="ANY" />
        </AttributeRule>
        #end

    </AttributeFilterPolicy>
    #end
#end

#foreach( $trustRelationship in $trustParams.deconstructed )
    <AttributeFilterPolicy id="FederatedSiteApp$trustParams.deconstructedIds.get($trustRelationship.entityId)">

        <PolicyRequirementRule xsi:type="Requester" value="$trustRelationship.entityId" />
        #foreach( $attribute in $trustRelationship.releasedCustomAttributes )

        <AttributeRule attributeID="$attribute.name">
            <PermitValueRule xsi:type="ANY" />
        </AttributeRule>
        #end
    </AttributeFilterPolicy>
#end

</AttributeFilterPolicyGroup>
  • Restart idp

@syntrydy syntrydy assigned syntrydy and unassigned yurem Nov 12, 2018

syntrydy added a commit that referenced this issue Nov 12, 2018

Merge pull request #1336 from /issues/1312
template not 100% compatible in 3.1.4 #1312

@syntrydy syntrydy closed this Nov 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment