Skip to main content

A validator for System for Cross-domain Identity Management (SCIM) responses given predefine schemas

Project description

scimschema-logo

ScimSchema

https://travis-ci.org/GordonSo/scimschema.svg?branch=master

Validate JSon content given a predefined set of SCIM Schemas (in JSON representation format) as specified in SCIM (supporting Python 3+).

Example use case

Check out this test_scim_schema.py.

from scimschema import validate
from . import extension

# A sample schema, like what we'd get from response.get(<scim entity url>).json()
content = {
    "schemas": ["urn:ietf:params:scim:schemas:core2:2.0:User", "urn:ietf:params:scim:schemas:extension:2.0:User"],
    "id": "2819c223-7f76-453a-919d-413861904646",
    "externalId": 9,
    "meta": {
        "resourceType": "User",
        "created": "2011-08-01T18:29:49.793Z",
        "lastModified": "Invalid date",
        "location": "https://example.com/v2/Users/2819c223...",
        "version": "W\/\"f250dd84f0671c3\""
    }
}
validate(
    data=content,
    extension_schema_definitions=extension.schema
)

>>>    E   _scimschema._model.scim_exceptions.AggregatedScimMultValueAttributeValidationExceptions: Found 1 aggregated exceptions at Scim response:
>>>    E    ScimAttributeValueNotFoundException:
>>>    E             'Single-value attribute:ipRestrictionsEnabled' is required at the following location '['urn:huddle:params:scim:schemas:extension:2.0:Account', 'ipRestrictionsEnabled']' but found '{}'
>>>    !!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!

Features

Support for SCIM 2.0,
  • Validate SCIM Schema definition
    • Validate Model (schema) Id, Name, description, attributes

    • Validate Attribute (schema) Name, Type, Required, Canonical Values, Mutability, Returned, Uniqueness

  • Validate JSON Content against SCIM Schema
    • Validate significant value against Type (Binary, Boolean, Datetime, Decimal, Integer, Reference, String, Complex, MultiValued)

    • Characteristics Required, Canonical Values, Uniqueness

Upcoming features

  • Validate JSON Content for characteristics below:
    • Mutability, Returned

Running the Test Suite

The project requires pytest to discover tests, and it integrates with travis to run on commit. If you use a Windows machine, there are helpful commands in the go.bat to get you started…

Contributing

This project is powered by the QA department at Huddle

The source code is available on GitHub.

Get in touch, via GitHub or otherwise, contributors are also welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scimschema-0.0.13.tar.gz (21.4 kB view details)

Uploaded Source

File details

Details for the file scimschema-0.0.13.tar.gz.

File metadata

  • Download URL: scimschema-0.0.13.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for scimschema-0.0.13.tar.gz
Algorithm Hash digest
SHA256 cf5adf37698a431d3bcae94f07081d57bf5765716f11ac08c4238a895e4da9fa
MD5 ee68deb0c38624fe7724d954baf3e6e6
BLAKE2b-256 effdc78268de09bc044c4ceb507704063457883c51576aabc8b23daeda894fc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page