Repository navigation
Share the mapping core of the ORM storages - #58
Merged
Merged
Conversation
Documentation build overview
10 files changed ·
|
scim2_server.mapping is the base of the storages that map SCIM resources to the records of an ORM: the declaration of a mapping and its checks, the translation of the filters and of the sorts into the conditions of the ORM, the reading of the records, and the checks of the writes. A backend gives the primitives of its ORM through hooks and the Predicates protocol. scim2-django and scim2-sqlalchemy build on it. Its API follows the needs of these backends, and may change in any minor version.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scim2-django and scim2-sqlalchemy store SCIM resources in the records of an ORM, and they shared most of their code by copy.
scim2_server.mappingnow holds that code, and each backend only gives the primitives of its ORM.Attribute,Many,EntryorLink, whose targets the core does not read. The core checks the paths, then the backend resolves the targets into columns and collections, and reports the problems in its own way.Predicatesprotocol, which each backend implements. The SCIM rules stay in the core:neon a multi-valued attribute, missing values, substrings, strings the policy cannot prepare. The constants of anEntryare compared in Python.ResourceMappingand implements its hooks. The reference page lists them, with the order of the calls.The tests run the core on a backend that keeps its records in dicts and builds its conditions as Python predicates. It passes
ScimStorageContractwith a counter and dates, with a hash and no date, and with anEntry, so its filters and sorts are checked againstScimFilter.matchandSearchRequest.sort.scim2-django and scim2-sqlalchemy have a
mapping-corebranch that builds on this one. scim2-django only changes some messages of its system checks, and scim2-sqlalchemy gainsEntry, optional dates and versions by hash.