Repository navigation
Check the uniqueness of sub-attributes and multi-valued attributes - #59
Merged
Merged
Conversation
Each value of a unique attribute belongs to one resource, at any depth, and each value of a multi-valued attribute counts on its own. Values clients never read are not checked, and a mapping refuses them.
Documentation build overview
12 files changed ·
|
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.
A storage only checked the unique attributes at the top of a resource, and compared a multi-valued attribute as a whole. A unique value now belongs to one resource wherever it sits, such as
emails.valuein a model declaring it unique. Each value of a multi-valued attribute counts on its own, so["a", "b"]and["a"]now clash.hidden-uniqueerror.unique_valueslists the unique values of a resource, with the form they are compared in. The in-memory storage uses it._unique_attributesreplaces_unique_columns. It returns the unique attributes clients read, whether the storage writes them or not: in the record, in anEntry, in the entries of a collection, or as the value of aLink.holds_anybuilds the condition that a record holds one of some values.ScimStorageContractchecks these rules onMailboxresources, for a storage settingstores_mailboxes. The storage then serves theMailboxandSharedMailboxresource types, which share a schema. The test backend of the mapping core passes it, and shows how a backend checks the values across its mappings.