Difference between revisions of "stoney core: Resellers Resource Mapping (REST - LDAP)"

From stoney cloud
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Resellers Collection Mapping)
(Resellers Resource Mapping)
Line 28: Line 28:
 
|-
 
|-
 
|| '''id''' || uid=4000000,ou=reseller || uid || Always read-only.
 
|| '''id''' || uid=4000000,ou=reseller || uid || Always read-only.
|-
 
|| organizationName || uid=4000000,ou=reseller || organizationName ||
 
|-
 
|| givenName || uid=4000000,ou=reseller || givenName ||
 
|-
 
|| surname || uid=4000000,ou=reseller || surname ||
 
|-
 
 
|-
 
|-
 
|| isCompany || uid=4000000,ou=reseller || sstIsCompany ||
 
|| isCompany || uid=4000000,ou=reseller || sstIsCompany ||
Line 43: Line 36:
 
|-
 
|-
 
|| (none) || uid=4000000,ou=reseller || sstBelongsToResellerUID || Set to uid on creation.
 
|| (none) || uid=4000000,ou=reseller || sstBelongsToResellerUID || Set to uid on creation.
|-
 
|| organizationName || ou=address,uid=4000000,ou=reseller || organizationName ||
 
 
|-
 
|-
 
|| address.sstGender || ou=address,uid=4000000,ou=reseller || gender ||  
 
|| address.sstGender || ou=address,uid=4000000,ou=reseller || gender ||  

Revision as of 15:33, 8 January 2014

Overview

The resellers resource mapping describes the business logic behind the LDAP to JSON transformation and visa versa for the request and response objects. The actual resellers resource REST API is located in the REST API category and is named stoney core: Resellers Resource - REST API.

Principles:

  • for the ressource objects there is most of the time a one-to-one mapping between LDAP attributes and JSON object
  • for collections only a subset of the ressource object attributes will be returned which may be also be merged or otherwise mangled

This specification puts together the Reseller frontend API and the LDAP Data Backend

Resellers Resource Mapping

If not specified otherwise, the following rules apply:

  • an attribut which exists in the LDAP object but has no corresponding entry in the API will never be exported
  • the mapping has always to be explicit for the API attributes: it is always considered an error if the client provides an attribute which is not listed below (aka no hidden attributes)
  • whether an attribute is mandatory or not is specified by the corresponding LDAP object specification
  • the attribute in bold letters is the REST API ressource identifier and can as such never be specified in a POST request but will always be generated on the server side
  • specifying a read-only attribut in a PUT or PATCH request is allowed as long as the value is the same as currently set
  • the mapping applies to create (POST), read (GET) and update (PATCH or PUT). For delete (DELETE) the REST principles apply

Base DN: dc=stoney-cloud,dc=org

API Attribute LDAP Object DN LDAP Attribute Details
id uid=4000000,ou=reseller uid Always read-only.
isCompany uid=4000000,ou=reseller sstIsCompany
isActive uid=4000000,ou=reseller sstIsActive
(none) uid=4000000,ou=reseller sstExternalID
(none) uid=4000000,ou=reseller sstBelongsToResellerUID Set to uid on creation.
address.sstGender ou=address,uid=4000000,ou=reseller gender
address.givenName ou=address,uid=4000000,ou=reseller givenName
address.surname ou=address,uid=4000000,ou=reseller surname
address.postalAddress ou=address,uid=4000000,ou=reseller postalAddress
address.postOfficeBox ou=address,uid=4000000,ou=reseller postOfficeBox
address.stateOrProvinceName ou=address,uid=4000000,ou=reseller stateOrProvinceName
address.countryName ou=address,uid=4000000,ou=reseller countryName
address.postalCode ou=address,uid=4000000,ou=reseller postalCode
address.localityName ou=address,uid=4000000,ou=reseller localityName
address.preferredLanguage ou=address,uid=4000000,ou=reseller preferredLanguage
address.mail ou=address,uid=4000000,ou=reseller mail
address.telephoneNumber ou=address,uid=4000000,ou=reseller telephoneNumber
address.mobileTelephoneNumber ou=address,uid=4000000,ou=reseller mobileTelephoneNumber
address.websiteURL ou=address,uid=4000000,ou=reseller sstWebsiteURL

Resellers Collection Mapping

If not specified otherwise, the following rules apply:

  • the table below lists one entry in the collection/array/list to be returned
  • additional attributes like pagination-headers, location attribute, etc. are not part of this spec but must be part of the final object, as per stoney core: Resellers Resource - REST API

Base DN: dc=stoney-cloud,dc=org

API Attribute LDAP Object DN LDAP Attribute Details
id uid=4000000,ou=reseller uid
descriptiveName uid=4000000,ou=reseller organizationName or surname, givenName $sstIsCompany == TRUE ? "$organizationName" : "$surname, $givenName"

Links