Subject: [scim] SCIM filters

From: Steve Moyer <[email-masked]>
Date: Tue, 10 May 2016 15:58:55 -0400 (EDT)

We've been working on an ANTLR grammar to lex and parse the SCIM filter and have a question about the "intent" of the specification.  This syntax is allowed:

attr[a eq b and attr[c eq d]]

but this syntax is not:

attr[attr[c eq d]]

Can someone explain why the first filter is valid but the second is not?  Our current guess is that it's an unintended side effect of valFilter's recursion back to FILTER (through logExp).  We'll be sharing this grammar (and the resulting library) with anyone interested as part of our OSS SCIM 2.0 implementation.

Thanks,

Steve

“All the easy stuff’s been done…. We’ve got the wheel, fire, the TV clicker—what else do you need?” - Dean Kamen

---

From: Phil Hunt <[email-masked]>
Date: Tue, 10 May 2016 13:13:37 -0700

Steve

Neither is allowed.  

The only filter allowed inside of [ ] is a “valFilter” which is defined as an attribute expression or logical expression.
 valuePath = attrPath "[" valFilter "]"
                 ; FILTER uses sub-attributes of a parent attrPath

     valFilter = attrExp / logExp / *1"not" "(" valFilter ")"

I don’t see your example listed anywhere.  Can you clarify where you got it?

Phil

@independentid
www.independentid.com <http://www.independentid.com/>[email-masked] <mailto:[email-masked]>

> On May 10, 2016, at 12:58 PM, Steve Moyer <[email-masked]> wrote:
> 
> _______________________________________________
> scim mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/scim

---

From: Steve Moyer <[email-masked]>
Date: Tue, 10 May 2016 16:33:49 -0400 (EDT)

Phil, 

Thanks for the quick answer! I agree with what you describe as the intent of the grammar in the specification, but the grammar *DOES* allow the first case since it has an "AND" or "OR" in it. Since the logExp is defined as: 

logExp = FILTER SP ("and" / "or") SP FILTER 

And since the FILTER definition is: 

FILTER = attrExp / logExp / valuePath / *1"not" "(" FILTER ")" 

So the grammar recurses when there's a logExp inside the valuePath, and you can therefore have a valuePath inside a valuePath so long as it's part of said logExp. The examples I gave are part of the test suite we wrote to make sure our lexer/parser was functional. We expected both to fail, then realized that one actually can succeed. 

Steve 

From: "Phil Hunt" <[email-masked]> 
To: "Steve Moyer" <[email-masked]> 
Cc: [email-masked] 
Sent: Tuesday, May 10, 2016 4:13:37 PM 
Subject: Re: [scim] SCIM filters 

Steve 

Neither is allowed. 

Phil 

@independentid 
www.independentid.com 
[email-masked] 

On May 10, 2016, at 12:58 PM, Steve Moyer < [email-masked] > wrote: 

but this syntax is not: 

attr[attr[c eq d]] 

Thanks, 

Steve

---

From: Phil Hunt <[email-masked]>
Date: Tue, 10 May 2016 15:36:57 -0700

Ok. I will likely have to submit an errata.

Phil

@independentid

www.independentid.com

[email-masked]

On May 10, 2016, at 1:33 PM, Steve Moyer <[email-masked]> wrote:

Phil,

Steve

Steve

Neither is allowed.

Phil

@independentid

www.independentid.com

[email-masked]

but this syntax is not:

attr[attr[c eq d]]

Thanks,

Steve