cloudstek / scim-filter-parser
Parser for the SCIM (IETF RFC 7644, System for Cross-domain Identity Management) filter syntax.
Installs: 618 527
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 4
Open Issues: 5
Requires
- php: ^8.1
- nette/tokenizer: ^3.1
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.22
This package is auto-updated.
Last update: 2024-10-22 05:57:42 UTC
README
Parser for the SCIM (IETF RFC 7644, System for Cross-domain Identity Management) filter syntax.
Installation
This library is available as composer package and this is the recommended way to install this library.
$ composer require cloudstek/scim-filter-parser
Manual installation
If you don't use composer, you can install this library manually using the following steps:
- Clone this repository or download the latest release from the releases page.
- 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 use Cloudstek\SCIM\FilterParser\FilterParser; // Create the filter parser. $filterParser = new FilterParser(); // Parse a filter string $firstFilterAst = $filterParser->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 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.