I agree that in the particular case of IP addresses, it probably doesn't matter, because the '.' is going to match either a '.' or a single character of any value but that will almost always be a '.' anyway, since IP addresses have a more or less fixed format.
I guess my question is a bit more general than this particular regular expression -- IF the intent is to have a backslash appear in a regular expression that's given as a value to a property in cas.properties, shouldn't the backslash be doubled (in which case the default is "wrong")? --Dave -- DAVID A. CURRY, CISSP *DIRECTOR OF INFORMATION SECURITY* INFORMATION TECHNOLOGY 71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003 +1 212 229-5300 x4728 • [email protected] [image: The New School] On Tue, Nov 14, 2017 at 12:25 PM, Waldbieser, Carl <[email protected]> wrote: > > I just use: > > cas.adminPagesSecurity.ip=127\.0\.0\.1 > > Seems to work how I would expect. > > Thanks, > Carl Waldbieser > ITS Identity Management > Lafayette College > > ----- Original Message ----- > From: [email protected] > To: "cas-user" <[email protected]> > Sent: Tuesday, November 14, 2017 11:50:00 AM > Subject: [cas-user] Re: Dumb question > > Sorry, clicked "send" by mistake. Repeating the message (with the rest of > it) here > > I'm looking at the cas.adminPagesSecurity.ip property setting in the Maven > overlay, which comes set as follows: > > cas.adminPagesSecurity.ip=127\.0\.0\.1 > > But since the backslash is a special character in Java properties files, > shouldn't that be: > > cas.adminPagesSecurity.ip=127\\.0\\.0\\.1 > > so that the backslash makes it into the regular expression (making the '.' > match a '.' instead of any character)? > > I could've sworn it used to be that way in the overlay (and it jumped out > at me as a potential mistake in the regular expression I replaced it with), > but now, checking everything I can find, it seems that it was never that > way (or at least not any time recently). > > The only other example of a regular expression in the properties file I can > find in the documentation is this one: > > cas.authn.pm.policyPattern=^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)( > ?=.*[$@$!%*?&])[A-Za-z\\d$@$!%*?&]{8,10} > > which does indeed include double backslashes. > > Am I confused? Should the pattern for the IP address contain single > backslashes, or double? > > --Dave > > -- > - Website: https://apereo.github.io/cas > - Gitter Chatroom: https://gitter.im/apereo/cas > - List Guidelines: https://goo.gl/1VRrw7 > - Contributions: https://goo.gl/mh7qDG > --- > You received this message because you are subscribed to the Google Groups > "CAS Community" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/a/ > apereo.org/d/msgid/cas-user/9cedfe31-e2e1-4f5e-b8f0- > 14b84f0fcff6%40apereo.org. > > -- > - Website: https://apereo.github.io/cas > - Gitter Chatroom: https://gitter.im/apereo/cas > - List Guidelines: https://goo.gl/1VRrw7 > - Contributions: https://goo.gl/mh7qDG > --- > You received this message because you are subscribed to the Google Groups > "CAS Community" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/a/ > apereo.org/d/msgid/cas-user/1539672735.90113090. > 1510680316099.JavaMail.zimbra%40lafayette.edu. > -- - Website: https://apereo.github.io/cas - Gitter Chatroom: https://gitter.im/apereo/cas - List Guidelines: https://goo.gl/1VRrw7 - Contributions: https://goo.gl/mh7qDG --- You received this message because you are subscribed to the Google Groups "CAS Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CA%2Bd9XAMpnvNZWrHqvbPPHP4fq%3D5JUO7kn0bw-bqTcq-tzR4%3D3Q%40mail.gmail.com.
