Módosítások

Attribute Conversion for eduGAIN

4 bájt törölve, 2008. október 9., 07:52
a
Attribute conversion rule types: correct XML indentation at examples
<source lang="xml">
<BasicRule>
<Description>Create static attribute (or append to existing if attribute with this name already exists)</Description>
<Attribute attributeName="eduPersonScopedAffiliation" replaceValues="false">
<AttributeValue>staff@niif.hu</AttributeValue> <AttributeValue>member@href.hu</AttributeValue>
</Attribute>
</BasicRule>
</source>
<source lang="xml">
<BasicRule> <Description>Create static attribute for some remote providers</Description> <Condition>
<RemoteProviderMatch>^urn:geant:edugain:be:[^:]+\.hu$</RemoteProviderMatch>
</Condition> <Attribute attributeName="homeOrganization">
<AttributeValue>niif.hu</AttributeValue>
</Attribute> </BasicRule>
</source>
<source lang="xml">
<BasicRule>
<Description>Rename attribute uid to edupersonPrincipalName</Description>
<Condition>
<AttributeMatch attributeName="uid"/>
</Condition>
<Attribute attributeName="edupersonPrincipalName">
<AttributeValue>${uid}</AttributeValue>
</Attribute>
</BasicRule>
</source>
<source lang="xml">
<BasicRule>
<Decription>Transform 'o=org,c=country'-style OrgDN to DNS-based homeOrganization</Decription>
<Condition>
<AttributeMatch attributeName="edupersonOrgDN" id="regex">o=(.*),c=(.*)</AttributeMatch>
</Condition>
<Attribute attributeName="homeOrganization">
<AttributeValue>${regex[1]}.${regex[2]}</AttributeValue>
</Attribute>
</BasicRule>
</source>
This last example needs some more explanation. When you want to reference the regular expression matching groups (enclosed by parentheses), you must define the reference name with the 'id' parameter of <code>AttributeMatch</code>. Then, use <code>${id[0]}</code> to refer to the whole regular expression match (ie. the whole attribute value), and <code>${id[N]}</code> to refer to the Nth. matching group of the regular expression.
{{INFO_EN|You cannot reference other rule's regular expressionsfrom another rule.}}
=== MergeRule ===
<source lang="xml">
<MergeRule>
<Description>Merges the uid and homeOrganization to edupersonPrincipalName</Description>
<InputAttribute attributeName="homeOrganization" />
<InputAttribute attributeName="uid" />
<Attribute attributeName="edupersonPrincipalName" replaceValues="true">
<AttributeValue>${uid}@${homeOrganization}</AttributeValue>
</Attribute>
</MergeRule>
</source>
<source lang="xml">
<SplitRule>
<Description>Split the edupersonScopedAffiliation to edupersonAffiliation and homeOrganization</Description>
<InputAttribute attributeName="edupersonScopedAffiliation" id="scopedAffiliation" >^([^@]+)@(.+)$</InputAttribute>
<Attribute attributeName="edupersonAffiliation">
<AttributeValue>${scopedAffiliation[1]}</AttributeValue>
</Attribute>
<Attribute attributeName="homeOrganization">
<AttributeValue>${scopedAffiliation[2]}</AttributeValue>
</Attribute>
</SplitRule>
</source>
<source lang="xml">
<CustomRule className="org.test.MyCustomRuleImpl">
<Configuration>
<!-- any xml here -->
</Configuration>
</CustomRule>
</source>

Navigációs menü