https://github.com/cloudstek/scim-filter-parser
Parser for the SCIM (IETF RFC 7644, System for Cross-domain Identity Management) filter language.
https://github.com/cloudstek/scim-filter-parser
parser scim scim-filter
Last synced: 17 days ago
JSON representation
Parser for the SCIM (IETF RFC 7644, System for Cross-domain Identity Management) filter language.
- Host: GitHub
- URL: https://github.com/cloudstek/scim-filter-parser
- Owner: Cloudstek
- License: mit
- Created: 2020-05-08T00:01:42.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-30T13:37:06.000Z (11 months ago)
- Last Synced: 2025-03-20T01:42:04.137Z (about 1 month ago)
- Topics: parser, scim, scim-filter
- Language: PHP
- Homepage: https://cloudstek.github.io/scim-filter-parser-docs/index.html
- Size: 101 KB
- Stars: 8
- Watchers: 0
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SCIM Filter Parser
> Parser for the SCIM ([IETF RFC 7644, System for Cross-domain Identity Management](https://tools.ietf.org/html/rfc7644)) filter syntax.[](https://github.com/Cloudstek/scim-filter-parser/actions) [](https://coveralls.io/github/Cloudstek/scim-filter-parser?branch=master) [](https://scrutinizer-ci.com/g/Cloudstek/scim-filter-parser/?branch=master)  [](https://github.com/Cloudstek/scim-filter-parser/releases) [](https://packagist.org/packages/cloudstek/scim-filter-parser) [](https://packagist.org/packages/cloudstek/scim-filter-parser)
## Installation
This library is available as [composer](https://getcomposer.org/) package and this is the recommended way to install this library.
```sh
$ composer require cloudstek/scim-filter-parser
```#### Manual installation
If you don't use composer, you can install this library manually using the following steps:
1. Clone this repository or download the latest release from the [releases page](https://github.com/Cloudstek/scim-filter-parser/releases).
2. Require all files manually or use a PSR-4 autoloader (recommended).## Usage
As code often says more than a thousand words, a little code to get you started.
```php
parse('userName eq "foobar"'); // Cloudstek\SCIM\FilterParser\AST\Comparison ...// ... walk through the AST (abstract syntax tree) and do something with it.
// The parser is stateless so you can safely parse another filter if you like.
$secondFilterAst = $filterParser->parse('name[given eq "John" and family eq "Dough"]'); // Cloudstek\SCIM\FilterParser\AST\ValuePath ...// Create the path parser.
$pathParser = new PathParser();// Parse a path string, used in for example PATCH operations.
$pathAst = $pathParser->parse('name[given eq "John"].familyName'); // Cloudstek\SCIM\FilterParser\AST\ValuePath ...
```## Issues
Please report issues on the projects [GitHub issues page](https://github.com/Cloudstek/scim-filter-parser/issues) and be sure to include information about your PHP version, library version, filter string and resulting AST.
## Known limitations
At the moment there are a few limitations to be aware of, though in the future these may be addressed.
* Does not support SCIM v1.0 (only v2)
* Does not come with a "dumper" to provide a nice textual representation of the AST. Instead you can use [`var_dump`](https://www.php.net/manual/en/function.var-dump.php) or [`VarDumper`](https://symfony.com/doc/current/components/var_dumper.html).