<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.gmail-p1, li.gmail-p1, div.gmail-p1
{mso-style-name:gmail-p1;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.gmail-s1
{mso-style-name:gmail-s1;}
span.gmail-apple-converted-space
{mso-style-name:gmail-apple-converted-space;}
span.gmail-s2
{mso-style-name:gmail-s2;}
span.gmail-s3
{mso-style-name:gmail-s3;}
span.gmail-s4
{mso-style-name:gmail-s4;}
span.gmail-s5
{mso-style-name:gmail-s5;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Interesting suggestion, David. I had already coded a solution with a for loop, but your solution is probably much more efficient. I could make another attribute
that’s a mapped attribute and that does the regex mapping then use its results in my script. This would, I assume, be more efficient code as I assume the mapped attribute code behind the scenes is more efficient than iterating over all values of the attribute
to do regex matches. Is that assumption true, Scott?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Keith<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> users [mailto:users-bounces@shibboleth.net]
<b>On Behalf Of </b>IAM David Bantz<br>
<b>Sent:</b> Wednesday, February 21, 2018 12:12 PM<br>
<b>To:</b> Shib Users <users@shibboleth.net><br>
<b>Subject:</b> Re: Checking for regex match of attribute values in a script<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">We "ValueMap" memberOf values with regex to extract (possibly multiple) attribute values.*<o:p></o:p></p>
<div>
<p class="MsoNormal">Not exactly what you asked for but a possible alternative depending on your precise need(s).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">David Bantz<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">*e.g.,<br>
<br>
<o:p></o:p></p>
<p class="gmail-p1" style="margin:0in;margin-bottom:.0001pt"><span class="gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">
</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white"><</span></span><span class="gmail-s3"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">ValueMap</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">></span></span><span style="font-size:8.5pt;font-family:"Menlo",serif"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0in;margin-bottom:.0001pt;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">
</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white"><ReturnValue></span></span><span class="gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">arn:aws:iam::$1:role/$2,arn:aws:iam::$1:saml-provider/OITshibb</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white"></ReturnValue></span></span><span style="font-size:8.5pt;font-family:"Menlo",serif"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0in;margin-bottom:.0001pt;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">
</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white"><SourceValue
</span></span><span class="gmail-s4"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">ignoreCase</span></span><span class="gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">=</span></span><span class="gmail-s5"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">"true"</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">></span></span><span class="gmail-s1"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">cn=aws:([0-9]+):role:(.*?),ou=group,dc=alaska,dc=edu</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white"></SourceValue></span></span><span style="font-size:8.5pt;font-family:"Menlo",serif"><o:p></o:p></span></p>
<p class="gmail-p1" style="margin:0in;margin-bottom:.0001pt;font-stretch:normal">
<span class="gmail-apple-converted-space"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">
</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white"></</span></span><span class="gmail-s3"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">ValueMap</span></span><span class="gmail-s2"><span style="font-size:8.5pt;font-family:"Menlo",serif;color:black;background:white">></span></span><span style="font-size:8.5pt;font-family:"Menlo",serif"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Feb 21, 2018 at 7:23 AM, Wessel, Keith <<a href="mailto:kwessel@illinois.edu" target="_blank">kwessel@illinois.edu</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi, all,<br>
<br>
We've got a scripted attribute definition that checks for several values of memberOf with memberOf.getValues().contains(). I'd like to convert this to use a regex to match partial group names....<br>
Is there a way to do a regex match on attribute values with contains()? Or do I need to iterate through the attribute values with a loop to do this comparison? Or is there another method on collections that I should be using other than contains()?<br>
<br>
Thanks,<br>
Keith<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>