Cloudstek / scim-filter-parser

Parser for the SCIM (IETF RFC 7644, System for Cross-domain Identity Management) filter language.
https://cloudstek.github.io/scim-filter-parser-docs/index.html
MIT License
8 stars 4 forks source link

Unexpected exception thrown for valid filter #4

Open philiprabbett opened 1 year ago

philiprabbett commented 1 year ago

Using https://scimvalidator.microsoft.com/, a filter request was sent with the following filter which throws an Exception from the Nette\Tokeniser

emails[type eq "work"].value eq "una@sipesbarton.info"

I would assume the above filter is valid however both FilterParser and PathParser are unable to handle this.

philiprabbett commented 1 year ago

@mdeboer would you consider the above filter to be a valid filter?

mdeboer commented 1 year ago

Would seem so, do you get an error or have any more info?

philiprabbett commented 1 year ago

Yeah, sure.

Request GET /scim/v2/Users?filter=emails%5btype+eq+"work"%5d.value+eq+"scotty%40corkery.uk"

Exception

[Nette\Tokenizer\Exception](file:///REDACTED/vendor/nette/tokenizer/src/Tokenizer/Exception.php#L16) {#3158 ▼
  #message: "Unexpected '.value eq ' on line 1, column 23."
  #code: 0
  #file: "[/REDACTED/vendor/nette/tokenizer/src/Tokenizer/Stream.php](file:///REDACTED/vendor/nette/tokenizer/src/Tokenizer/Stream.php#L123)"
  #line: 123
  trace: {▼
    [/REDACTED/vendor/nette/tokenizer/src/Tokenizer/Stream.php:123](file:///REDACTED/vendor/nette/tokenizer/src/Tokenizer/Stream.php#L123) {▶}
    [/REDACTED/vendor/cloudstek/scim-filter-parser/src/PathParser.php:70](file:///REDACTED/vendor/cloudstek/scim-filter-parser/src/PathParser.php#L70) {▶}
    [/REDACTED/vendor/cloudstek/scim-filter-parser/src/AbstractParser.php:217](file:///REDACTED/vendor/cloudstek/scim-filter-parser/src/AbstractParser.php#L217) {▶}
    [/REDACTED/vendor/cloudstek/scim-filter-parser/src/PathParser.php:37](file:///REDACTED/vendor/cloudstek/scim-filter-parser/src/PathParser.php#L37) {▶}
mdeboer commented 1 year ago

Thanks, will look into that :)

philiprabbett commented 1 year ago

Hi @mdeboer, have we any update on this?