include statements in xml configuration files?

Wessel, Keith kwessel at illinois.edu
Sat Feb 20 19:11:03 UTC 2021


Thanks, Scott. I should have figured that out; I've seen constructs similar to that before.

For a final sanity check and for the sake of the archives, the final solution looks like this.

In global.xml, add:
    <bean id="githubRegexPattern" class="java.util.regex.Pattern" factory-method="compile"
        c:_0="^https:\/\/github\.com\/orgs\/.*$" />

And inside the entity attribute filter after the attribute and value elements, add:
            <ConditionScript customObjectRef="githubRegexPattern">
                <Script>
                    <![CDATA[
                        custom.matcher(input.getEntityID()).matches();
                    ]]>
                </Script>
            </ConditionScript>

Keith


-----Original Message-----
From: users <users-bounces at shibboleth.net> On Behalf Of Cantor, Scott
Sent: Friday, February 19, 2021 2:23 PM
To: Shib Users <users at shibboleth.net>
Subject: Re: include statements in xml configuration files?

On 2/19/21, 3:14 PM, "users on behalf of Wessel, Keith" <users-bounces at shibboleth.net on behalf of kwessel at illinois.edu> wrote:

>    Compiling and building the regex into a custom object... This would essentially be baking it into a jar file added to
> idp.war, correct? If we choose to go this route, does anyone have any pointers on where to start with that?

No. Pattern is a Java class, you don't have to create it.

    <bean id="something" class="java.util.regex.Pattern" factory-method="compile" 
        c:_0="^prefix.*$" />

Calling String.matches() creates a Pattern and calls compile every time you call it.

-- Scott


-- 
For Consortium Member technical support, see https://urldefense.com/v3/__https://wiki.shibboleth.net/confluence/x/coFAAg__;!!DZ3fjg!sWNpZAVWD3S6Tmo-5LNsEBmCFxI5UWVWMhr6-fsyNz96LUTPD84QMb8AZ-O_e2r9Hg$ 
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


More information about the users mailing list