Giter Site home page Giter Site logo

cloudstek / scim-filter-parser Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 4.0 103 KB

Parser for the SCIM (IETF RFC 7644, System for Cross-domain Identity Management) filter language.

Home Page: https://cloudstek.github.io/scim-filter-parser-docs/index.html

License: MIT License

PHP 100.00%
scim scim-filter parser

scim-filter-parser's Introduction

SCIM Filter Parser

Parser for the SCIM (IETF RFC 7644, System for Cross-domain Identity Management) filter syntax.

GitHub Workflow Status Coverage Status Scrutinizer Code Quality GitHub GitHub tag (latest SemVer) Packagist Downloads Packagist Stars

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:

  1. Clone this repository or download the latest release from the releases page.
  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

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.

  • 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 or VarDumper.

scim-filter-parser's People

Contributors

mdeboer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

scim-filter-parser's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.