Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case study: SCIM query #45

Open
rmoorman opened this issue Sep 12, 2022 · 4 comments
Open

Case study: SCIM query #45

rmoorman opened this issue Sep 12, 2022 · 4 comments
Labels
case-study Real life examples

Comments

@rmoorman
Copy link

Hello,

I would like to use this library to generate parsers based on the the ABNF definitions for the SCIM (System for Cross-domain Identity Management) Protocol.
While I was trying to collect the ABNF definitions and use the library as described in the README file, I found that given that ABNF, a few example inputs yield no results.
Some inputs lead to only a part of the input to be parsed, while others seem to lead to a timeout when running the parser.

There is a small example repository that I created including the ABNF, the parser code, and some tests, and hope that it can demonstrate the problem as well as help a little while solving it.

There are two parser files within it's lib directory, a "path" and a "filter" parser.
What paths and filters do look like (hopefully truthfully according to the SCIM spec) is defined within priv/scim.abnf.
And then there are the tests in test/scim_parsers_test.exs. There is one test for each parser looping through a collection of matching collected examples. The examples are currently partially commented out starting from where the parser fails to parse the input. And as mentioned there are two kinds of failures some examples lead to: unparsed rest and timeouts

I don't really have a good idea where I would have to start in order to try solving this issue myself currently (or if the ABNF is wrong or indeed the generated parser code) so I hope that filing this issue can shed light on this and help solve a problem in the code (if any).

Best regards,
Rico Moorman

@princemaple
Copy link
Owner

I'll take a look 🙂

@princemaple
Copy link
Owner

@rmoorman I've sent a PR. The cause is complicated. It's a mixture of bad ABNF and limitations of auto generated parser.

rmoorman/2022-abnf-parsec-scim-filter-issue#1

@princemaple
Copy link
Owner

Can I pin this issue as a case study for other users to learn?

@rmoorman
Copy link
Author

@princemaple , thank you for taking the time to have a look and making it work! I merged the PR, and regarding pinning the issue the more material to learn from the better 👍🏻
Keep up the good work!

@princemaple princemaple pinned this issue Sep 15, 2022
@princemaple princemaple changed the title Generated parsers do not seem to work as expected when based on SCIM ABNF Case study: SCIM query Sep 15, 2022
@princemaple princemaple added the case-study Real life examples label Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
case-study Real life examples
Projects
None yet
Development

No branches or pull requests

2 participants