Skip to content

Check the uniqueness of sub-attributes, and let the storages choose new identifiers - #17

Merged
azmeuk merged 2 commits into
mainfrom
subattribute-uniqueness
Nov 28, 2026
Merged

azmeuk merged 2 commits into
mainfrom
subattribute-uniqueness

Conversation

@azmeuk

@azmeuk azmeuk commented Nov 28, 2026

Copy link
Copy Markdown
Member
  • The storage checks the uniqueness of sub-attributes, such as emails.value. Each value of a multi-valued attribute counts on its own.
  • Per RFC 7643 erratum 8279, a unique value is checked against every resource type whose schema holds the attribute.
  • A mapping refuses a unique attribute that clients never read back, because a 409 would tell that another resource holds the value.
  • Override generate_id to choose the identifier of a new resource. The asynchronous storage awaits it, so the identifier can come from another service. A taken identifier gets a 409.

The storages follow the uniqueness contract of scim2-server 0.10.0. A
unique sub-attribute, such as emails.value, is checked, and so is each
value of a unique multi-valued attribute. Per RFC 7643 erratum 8279, a
value is looked for in every resource type whose schema holds it.

A mapping refuses a unique attribute that clients never read back, as a
409 would tell that another resource holds the value.

An update deletes the old entries of a Many before it inserts the new
ones, so a unique index that the application adds to their table
accepts a resource keeping its value.
SqlAlchemyStorage.generate_id returns the identifier of a new resource,
or None to let the column give one. The asynchronous storage awaits it,
so it can take the identifier from another service. A chosen identifier
that another resource holds raises a 409.
@azmeuk
azmeuk enabled auto-merge November 28, 2026 07:54
@read-the-docs-community

Copy link
Copy Markdown

@azmeuk
azmeuk merged commit 3ba2808 into main Nov 28, 2026
11 checks passed
@azmeuk
azmeuk deleted the subattribute-uniqueness branch November 28, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant