2017 © Pedro Peláez
 

library scim-schema

SCIM schema library

image

tmilos/scim-schema

SCIM schema library

  • Sunday, November 26, 2017
  • by tmilos
  • Repository
  • 1 Watchers
  • 2 Stars
  • 24 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 60 % Grown

The README.md

Scim Schema

SCIM schema PHP library with support for both v1 and v2., (*1)

Note: This library is still work in progress, and you are welcome to help and contribute, (*2)

It was made by the specs from SimpleCloud and by the example documents generated by PowerDMS/Owin.Scim, (*3)

Do not miss SCIM Filter Parser !, (*4)

Author Build Status Coverage Status Quality Score License Packagist Version, (*5)

Schema

Build default schema, (*6)

<?php
$schemaBuilder = new SchemaBuilderV2(); // or SchemaBuilderV1

$groupSchema = $schemaBuilder->getGroup();
$userSchema  = $schemaBuilder->getUser();
$enterpriseUserSchema = $schemaBuilder->getEnterpriseUser();
$schemaSchema = $schemaBuilder->getSchema();
$serviceProviderConfigSchema = $schemaBuilder->getServiceProviderConfig();
$resourceTypeSchema = $schemaBuilder->getResourceType();

Or build your own custom schema, (*7)

<?php
$schema = new Schema();
$schema->setName('CustomSchema);
$schema->addAttribute(
    AttributeBuilder::create('name', ScimConstants::ATTRIBUTE_TYPE_STRING, 'Name of the object')
        ->setMutability(false)
        ->getAttribute()
);

And serialize the scim schema object, (*8)

<?php
$schema = (new SchemaBuilderV2())->getUser();
$schema->serializeObject();

Schema validation

An object can be validated against a schema, (*9)

/** @var array $object */
$object = getTheObjectAsArray();

$validator = new SchemaValidator();
$objectSchema = getTheSchema();
$schemaExtensions = getSchemaExtensions();

$validationResult = $validator->validate(
    $object,
    $objectSchema,
    $schemaExtensions
);

if (!$validationResult->getErrors()) {
    // cool!
} else {
    print implode("\n", $validationResult->getErrorsAsStrings());
}

The Versions

26/11 2017

dev-master

9999999-dev https://github.com/tmilos/scim-schema

SCIM schema library

  Sources   Download

MIT

The Requires

  • php ^5.6|^7.0

 

The Development Requires

scim rfc7643 scim schema

25/11 2017

0.1

0.1.0.0

SCIM schema library

  Sources   Download

MIT

The Development Requires