Changes

stoney core: Search Resource Mapping (REST - LDAP)

2,372 bytes added, 12:03, 25 May 2014
/* Global Search Response Object (stoney core: Customers Resource) */
== Global Search Response Object (stoney core: Customers Resource) ==
All the resellers are stored under the sub tree [[stoney_core:_OpenLDAP_directory_data_organisation#Customers | ou=customers,dc=stoney-cloud,dc=org]]. The actual LDIF of a reseller is described under [[stoney_core:_OpenLDAP_directory_data_organisation#Customers_uid_.28per_customer.29 | Customer uid (per Customer)]]. The following LDAP attributes must be included in the search:* uid (id)* organizationName (Company customer: This is the normal case, as we target companies (customerName = organizationName)).* givenName (Private customer: A private customer does not have a company/organisation name (customerName = givenName surname)).* surname (Private customer: A private customer does not have a company/organisation name (customerName = givenName surname)). The following LDAP attributes must be returned:* uid (id)* sstIsCompany (isCompany)* sstIsActive (isActive)* organizationName (customerName) or givenName and surname (customerName)* countryName (countryCode)* postalCode (postalCode)* localityName (localityName)* sstBelongsToResellerUID (belongsToResellerID) === Sequence ===The following sequence describes the resellers search. ==== Search for the entered string ====We presume, that the string to be searched for is '''res''' (scope is one, size limit is set to 5):<pre>ldapsearch -H ldaps://ldapm.stoney-cloud.org \ -b "ou=customers ,dc=stoney-cloud,dc=org" \ -s one \ -D "cn=Manager,dc=stoney-cloud,dc=org" \ -z 5 \ -W -x -LLL \ "(|(uid=*cus*)(organizationName=*cus*))" uid sstIsCompany sstIsActive organizationName givenName surname sstBelongsToResellerUID</pre> The possible answer could look as follows:<pre>dn: uid=4000001,ou=customers,dc=stoney-cloud,dc=orguid: 4000001o: Customer Ltd.sstIsCompany: TRUEsstIsActive: TRUEsstBelongsToResellerUID: 4000000</pre> ==== Create a second searchfor each result ====As some of the attributes we're interested in are in the address sub tree, we need to execute a second search (scope is base):<pre>ldapsearch -H ldaps://ldapm.stoney-cloud.org \ -b "ou=address,uid=4000001,ou=customers,dc=stoney-cloud,dc=org" \ -s base \ -D "cn=Manager,dc=stoney-cloud,dc=org" \ -z 5 \ -W -x -LLL \ "(objectclass=*)" countryName postalCode localityName</pre> The possible answer could look as follows:<pre>dn: ou=address,uid=4000001,ou=customers,dc=stoney-cloud,dc=orgc: CHpostalCode: Postal Codel:Locality</pre>
|}
 
== People Search (GET) ==
SLB, editor, reviewer
3,376
edits