The directory's schema and the platforms' extensions
The directory is modelled on Active Directory: the schema is the directory's data. A class of objects (server, service, site, policy, domain, …) and an attribute (key, kind, whether it is required) are schema records. The schema is kept in the directory, reaches the replicas first, before the data it describes, and changes without a new directory release.
The base schema and the extensions
- The line's base schema — the classes every platform needs:
server,service,site,policy,address_list,authz,domain,identity_provider,scim_target, and the address books (address_book) and contacts (contact). They are built in and present in every installation. - Address books and contacts — the organisation's book, people's own books and their contacts
(CardDAV's too) — are directory objects as well, so the replicas see them. They are private
classes: no object door (
/control/objects,/scim/v2/Objects,/scim/v2/AddressBooks,/scim/v2/Contacts) shows or writes them; only the directory's and the calendar's address books read and write them, and a contact's content is sealed under the same key as before. A deleted contact is a tombstone without content; earlier versions are not kept. On the move to directory 1.5.69 the books were moved into objects at start; the directory drops the former book tables at start once the move is done. - A platform's extension — its own classes and attributes. SimpleTwo's brings room devices (
leg), trunks (trunk), mail connectors (mail_connector) and the attributes of SimpleTwo's services; SimpleOne's brings skills (skill); SimpleThree and SimpleZero bring their own.
An extension is one file in the platform's distribution, schema-extension.json. The coordinator hands it
to the directory whole when the platform is switched on, and again whenever a new distribution brings a
file with a higher version. A platform that brings a new version of its extension stores its new data with
no directory release.
The extension file
{
"platform": "simplethree", "prefix": "simplethree.", "version": 4,
"classes": [{
"name": "meeting_room", "label": {"en": "Meeting room", "ru": "Переговорная"},
"possSuperiors": ["cn-simplethree-devices"],
"mustContain": ["simplethree.capacity"], "mayContain": ["simplethree.floor"]
}],
"attributes": [
{"key": "simplethree.capacity", "syntax": "number", "rangeLower": 1, "rangeUpper": 500},
{"key": "simplethree.floor", "syntax": "text"}
]
}
- A class: its name, its place in the tree (
possSuperiors— the containers its objects lie in), its types (types— a closed list,openTypes— any), its required and optional attributes (mustContain,mayContain), its behaviours (behaviours— rules the directory carries out for its objects). The SCIM resource and collection come from the name:meeting_room→MeetingRoom,/MeetingRooms; the extension's author may name them (resource,endpoint). - An attribute: its key, kind (
syntax), one or many values (isSingleValued), range (rangeLower,rangeUpper), choices (choices), label and hint (label,hint). An attribute may also be added to a class of the base schema, throughclasses(for example["policy:tariff"]). - Namespace: the prefix is the platform's full name and a dot (
simpletwo.,simpleone.,simplethree.,simplezero.); every key of an extension starts with it (simplethree.capacity), as Exchange's attributes in AD start withmsExch. The base schema's keys (people's attributes, the directory's own policies, the base classes) have none. A key or a class that belongs to another platform is refused, its owner named. - A dot in a key: in a SCIM filter a prefixed key is one name (
simpletwo.main_number eq "+7…"), the next dot a sub-attribute (simpletwo.credentials.fingerprint eq "…"). In JSON a dotted key is an ordinary member name. A person's attribute of an extension is under the platform's URN in SCIM, without the prefix (…:SimpleOneUser:skills). - Secret attributes of classes declared in a file are not supported yet.
Versions and changes
- A version is a whole number that only grows. A file with a lower version than the registered one is refused and the directory keeps its own; the console shows «version mismatch» at the platform, with the reason. The same version with other content is refused too: raise the version.
- Only compatible changes are taken: label and hint, new choices, required → optional, one value → many, a wider range, new types of a class. A change of kind, a choice taken away, anything narrowed refuses the whole version, with every reason listed.
- A definition missing from a new version is retired (defunct): it takes no new values or objects; the data stays.
formerKeysrenames keys into the namespace: the directory moves the values itself — in the objects of the new definition's classes, in accounts' own policy layers and on people — when the file is registered and at every start until the move is done; running it again changes nothing. After the move a write naming the former key is refused, the new key named.
Where it shows
GET /scim/v2/ResourceTypesandGET /scim/v2/Schemas— standard SCIM (RFC 7643): the resources and attributes of every class, built-in and brought by extensions. What the RFC has no word for (place in the tree, type rules, behaviours, owning extension, range) is underurn:ietf:params:scim:schemas:extension:simple:2.0:SchemaRecord.- Console → Platforms: an enabled platform shows its registered schema extension version.
- On a replica a new class and its objects appear after the next replication pass (every minute); rows of a class whose schema has not arrived yet are kept and served once it does.