summaryrefslogtreecommitdiff
path: root/Architecture_and_Design/en-US/Administration_Panel.xml
blob: 9c413dfe955584addb873d32a17b1025a9e142ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Architecture_and_Design.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Architecture_and_Design-Administration_Panel">
    <title>Administration Panel</title>
    <para>
        The Kolab Groupware administration panel, a web interface to Kolab Groupware available for administrative purposes, will provide the functionality listed in this chapter.
    </para>
    <para>
        The Kolab Groupware Web Administration Panel is split in two parts;
    </para>
    <para>
        <orderedlist>
            <listitem>
                <para>
                    A web client interface,
                </para>

            </listitem>
            <listitem>
                <para>
                    An API backend interface.
                </para>

            </listitem>

        </orderedlist>

    </para>
    <para>
        The web client interface is nothing but a graphical representation of the API backend capabilities, allowing a user to navigate an interface to the administrative tasks the API backend exposes.
    </para>
    <para>
        This design allows other system management and corporate products to trigger Kolab Groupware administration tasks on an equal footing, and without the need to (re-)implement all of the Kolab Groupware logic.
    </para>
    <section id="sect-Architecture_and_Design-Administration_Panel-Configuration">
        <title>Configuration</title>
        <para>
            <itemizedlist>
                <listitem>
                    <para>
                        Configuration of the <xref linkend="form-Architecture_and_Design-Terminology-Kolab_Groupware_Primary_Domain" />
                    </para>

                </listitem>
                <listitem>
                    <para>
                        Configuration of the Kolab Groupware Administration Security Group
                    </para>

                </listitem>
                <listitem>
                    <para>
                        Configuration of Kolab Groupware Delegation Security Groups
                    </para>
                    <para>
                        Including the assignment of privileges delegated to delegation security groups, including;
                    </para>
                    <para>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    Reset Password
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create User, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Disable User, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    (Re-)enable User, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Alter user attributes (common name, display name, surname), if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete distribution lists and/or security groups, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete contact lists, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete contacts, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Review logfiles, if applicable.
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete domain aliases and/or domains
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Manage domain administrator groups
                                </para>

                            </listitem>

                        </itemizedlist>

                    </para>

                </listitem>

            </itemizedlist>

        </para>

    </section>

    <section id="sect-Architecture_and_Design-Administration_Panel-Deployment">
        <title>Deployment</title>
        <para>
            TODO
        </para>

    </section>

    <section id="sect-Architecture_and_Design-Administration_Panel-Web_Administration_Panel_API">
        <title>Web Administration Panel API</title>
        <!--        <para>

<programlisting language="Python">
<xi:include href="http://git.kolab.org/pykolab/plain/kolabd.py" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
        </para>    --> <para>
            The web administration panel comes with an API in order to allow different, third-party interfaces, as well as the Kolab tool-chain to Kolab Groupware, to execute tasks of an administrative nature. The API uses JSON to exchange information with the API client.
        </para>
        <para>
            The calls to the Web API are made to a service handler, for its methods handle the request. A call therefore looks like <emphasis>&lt;service&gt;.&lt;method&gt;</emphasis>, which is a location beneath the base URL for the API.
        </para>
        <para>
            Suppose <ulink url="https://kolab-admin.example.org/api/" /> is the API base URL, then a call to service method <literal>system.authenticate</literal> would be a POST HTTP/1.1 request to <ulink url="https://kolab-admin.example.org/api/system.authenticate" />.
        </para>
        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-HTTP_Method_Convention">
            <title>HTTP Method Convention</title>
            <para>
                Two HTTP methods are used: GET and POST. The GET method is generally(!) used for read-only operations, whereas the POST method is used for write operations.
            </para>
            <para>
                For GET requests, the parameters (the payload) are appended to the URI requested, <ulink url="https://kolab-admin.example.org/api/domain.info?domain=example.org" />.
            </para>
            <note>
                <para>
                    This restricts GET requests to specifying key-value pairs of payload information only, even though a GET parameter key can be specified more then one, creating a list of values.
                </para>

            </note>
            <para>
                Some read-only operations, such as <literal>user.find_by_attributes</literal> require the request to pass along multiple attributes with, potentially, multiple search parameters. These types read-only requests are the exception to the rule of using GET for read-only requests, and use POST instead.
            </para>
            <para>
                For POST requests, the payload is a JSON-encoded dictionary (array) of parameter keys and values. Only strings are allowed as keys. Values for the payload may contain lists, strings, dictionaries (arrays), integers, floats, etc.
            </para>

        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-Service_and_Method_Naming_Convention">
            <title>Service and Method Naming Convention</title>
            <para>
                In another rule-of-thumb we outline the naming convention for services and methods.
            </para>
            <para>
                Service names consist of an object name either in singular or plural form. The singular form depicts actions are placed against a single instance of an object, such as <literal>object.add</literal>, whereas the plural form depicts actions are placed against multiple instances of an object, such as <literal>objects.list</literal> or <literal>objects.search</literal>.
            </para>
            <para>
                Method names often imply an action is placed against one or more objects in one request. Certain actions may be confusing though. For these we have the following rules;
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <formalpara id="form-Architecture_and_Design-Service_and_Method_Naming_Convention-Finding_an_object">
                            <title>Finding an object</title>
                            <para>
                                The method <literal>find</literal> is always executed against the service with the singular form of the object name. The target of calling a <literal>find</literal> method is to obtain exactly one instance of an object. The method should fail if the result set contains any number of objects not one.
                            </para>

                        </formalpara>

                    </listitem>
                    <listitem>
                        <formalpara id="form-Architecture_and_Design-Service_and_Method_Naming_Convention-Searching_for_objects">
                            <title>Searching for objects</title>
                            <para>
                                The method <literal>search</literal> is always executed against the service with the plural form of the object name. The target of calling a <literal>search</literal> method is to obtain all matches, if any. The method should return any result set containing zero or more results.
                            </para>

                        </formalpara>

                    </listitem>

                </itemizedlist>

            </para>

        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-Standard_Response_Layout">
            <title>Standard Response Layout</title>
            <para>
                The standard response layout offers a location for the request status, an error code and the corresponding message, or a result.
            </para>
            <para>
                The status is the first item in the JSON object. It has two possible values: <literal>OK</literal> or <literal>ERROR</literal>. Depending on the status of the request, the rest of the JSON output contains a result (OK) or the error details (ERROR).
            </para>
            <para>
                The response to a successful request looks as follows:
            </para>
            <para>

<screen language="Python">{
    "status": "OK",
    "result": (...)
}</screen>

            </para>
            <para>
                The reponse to a successful request that is expected to return a list of zero, one or more items, such as <literal>list</literal> and <literal>search</literal> methods, includes a result layout as follows:
            </para>
            <para>

<screen language="Python">{
    "status": "OK",
    "result": {
        "list": (...),
        "count": &lt;integer&gt;
    }
}</screen>

            </para>
            <para>
                A failed result however looks like:
            </para>
            <para>

<screen language="Python">{
    "status": "ERROR",
    "code": &lt;integer&gt;,
    "reason": "&lt;string&gt;"
}</screen>

            </para>

        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_domain_Service">
            <title>The <literal>domain</literal> Service</title>
            <para>
                The <literal>domain</literal> service makes available actions against a single domain entity, for example 'add' or 'delete'. For actions against multiple domain entities, such as 'list' and 'search', see <xref linkend="sect-Architecture_and_Design-Web_Administration_Panel_API-The_domains_Service" />.
            </para>
            <section id="sect-Architecture_and_Design-The_domain_Service-domain.add_Method">
                <title><literal>domain.add</literal> Method</title>
                <para>
                    Depending on the technology used, quite the variety of things may need to happen when adding a domain to a Kolab Groupware deployment.
                </para>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters MUST be specified with the <literal>domain.add</literal> API call:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-domain.add_Method-domain">
                                <title><literal>domain</literal></title>
                                <para>
                                    The domain name space to be added.
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <!--
                <para>
                    The following parameters MAY be specified alongside the required parameters:
                </para>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-domain.add_Method-owner">
                                <title><literal>owner</literal></title>
                                <para>
                                    If specified, MUST refer to an existing domain name space.
                                </para>

                            </formalpara>
                            <remark> We need to verify owner is a valid attribute to an associated domain, and/or find a different mechanism for delegation between ISP, any level of resellers, and customers. Note that perhaps also the level of delegation can be tricky (@hotmail.com hosted style) </remark>

                        </listitem>

                    </itemizedlist>

                </para>
    --> <formalpara id="form-Architecture_and_Design-domain.add_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        <example id="exam-Architecture_and_Design-Example_Client_Implementation-Example_domain.add_API_call_in_Python">
                            <title>Example <literal>domain.add</literal> API call in Python</title>
                            <para>
                                The following is an example of a call to API service method <literal>domain.add</literal>:
                            </para>
                            <para>

<programlisting language="Python">import json
import httplib
import sys

from pykolab import utils

API_HOSTNAME = "kolab-admin.example.org"
API_PORT = "443"
API_SCHEME = "https"
API_BASE = "/api"

username = utils.ask_question("Login")
password = utils.ask_question("Password", password=True)

params = json.dumps({
                'username': username,
                'password': password
            })

if API_SCHEME == "http":
    conn = httplib.HTTPConnection(API_HOSTNAME, API_PORT)
elif API_SCHEME == "https":
    conn = httplib.HTTPSConnection(API_HOSTNAME, API_PORT)

conn.connect()
conn.request('POST', "%s/system.authenticate" %(API_BASE), params)
try:
    response_data = json.loads(conn.getresponse().read())
except ValueError, e:
    print e
    sys.exit(1)

# Check status here, using response_data['status']

if response_data.has_key('session_token'):
    session_id = response_data['session_token']

headers = { 'X-Session-Token': session_id }

params = json.dumps({
                'domain': utils.ask_question("Domain")
            })

conn.request('POST', "%s/domain.add" %(API_BASE), params, headers)
try:
    response_data = json.loads(conn.getresponse().read())
except ValueError, e:
    print e
    sys.exit(1)</programlisting>

                            </para>

                        </example>

                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Response">
                    <title>Response</title>
                    <para>

<screen language="Python">{
    "status":"OK"
}</screen>

                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Server_side_Implementation_Details">
                    <title>Server-side Implementation Details</title>
                    <para>
                        On the server-side, when a domain is added, an entry is added to the default authentication and authorization database, as configured through the setting <literal>auth_mechanism</literal> in the <literal>[kolab]</literal> section of <filename>/etc/kolab/kolab.conf</filename>.
                    </para>

                </formalpara>
                <para>
                    The authentication database technology referred to itself has the necessary settings to determine how a new domain can be added. The related settings for LDAP are <literal>domain_base_dn</literal>, <literal>domain_scope</literal>, <literal>domain_filter</literal>, <literal>domain_name_attribute</literal> (also used for the RDN).
                </para>
                <para>
                    After checking the domain does not already exist (using administrative credentials), the domain is added using the credentials for the logged in user. This is an access control verification step only; the logged in user must have 'add' rights on the domain base distinguished name.
                </para>
                <para>
                    Additional steps when adding a (primary) domain name space is to create the databases and populate the root dn. Below is a snippet of script doing just that for <literal>example.org</literal> against a 389 Directory Server.
                </para>

<programlisting language="Bash">#!/bin/bash

if [ $# -ne 1 ]; then
    read -p "Domain: " domain
else
    domain=$1
fi

domain_db=$(echo ${domain} | sed -e 's/\./_/g')
domain_dn=$(echo ${domain} | sed -e 's/\./,dc=/g')
domain_dn="dc=${domain_dn}"

. ./zzz-settings.sh

(
    echo "dn: associateddomain=${domain},cn=kolab,cn=config"
    echo "associateddomain: ${domain}"
    echo "objectClass: top"
    echo "objectClass: inetdomain"
    echo "objectClass: domainrelatedobject"
    echo "objectClass: organization"
    echo "o: ${domain}"
    echo ""
    echo "dn: cn=${domain_db},cn=ldbm database,cn=plugins,cn=config"
    echo "objectClass: top"
    echo "objectClass: extensibleObject"
    echo "objectClass: nsBackendInstance"
    echo "cn: ${domain_db}"
    echo "nsslapd-suffix: ${domain_dn}"
    echo "nsslapd-cachesize: -1"
    echo "nsslapd-cachememsize: 10485760"
    echo "nsslapd-readonly: off"
    echo "nsslapd-require-index: off"
    echo "nsslapd-directory: /var/lib/dirsrv/slapd-${instance}/db/${domain_db}"
    echo "nsslapd-dncachememsize: 10485760"
    echo ""
    echo "dn: cn=$(echo ${domain_dn} | sed -e 's/,/\\2C/g' -e 's/=/\\3D/g'),cn=mapping tree,cn=config"
    echo "objectClass: top"
    echo "objectClass: extensibleObject"
    echo "objectClass: nsMappingTree"
    echo "nsslapd-state: backend"
    echo "cn: ${domain_dn}"
    echo "nsslapd-backend: ${domain_db}"
    echo ""
    echo "dn: ${domain_dn}"
    echo "dc: $(echo ${domain} | cut -d'.' -f 1)"
    echo "objectClass: top"
    echo "objectClass: domain"
    echo "aci: (targetattr=\"carLicense || description || displayName || facsimileTelephoneNumber || homePhone || homePostalAddress || initials || jpegPhoto || labeledURI || mail || mobile || pager || photo || postOfficeBox || postalAddress || postalCode || preferredDeliveryMethod || preferredLanguage || registeredAddress || roomNumber || secretary || seeAlso || st || street || telephoneNumber || telexNumber || title || userCertificate || userPassword || userSMIMECertificate || x500UniqueIdentifier\")(version 3.0; acl \"Enable self write for common attributes\"; allow (write) userdn=\"ldap:///self\";)"
    echo "aci: (targetattr =\"*\")(version 3.0;acl \"Directory Administrators Group\";allow (all) (groupdn=\"ldap:///cn=Directory Administrators,${domain_dn}\");)"
    echo "aci: (targetattr=\"*\")(version 3.0; acl \"Configuration Administrators Group\"; allow (all) groupdn=\"ldap:///cn=Configuration Administrators,ou=Groups,ou=TopologyManagement,o=NetscapeRoot\";)"
    echo "aci: (targetattr=\"*\")(version 3.0; acl \"Configuration Administrator\"; allow (all) userdn=\"ldap:///uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot\";)"
    echo "aci: (targetattr = \"*\")(version 3.0; acl \"SIE Group\"; allow (all) groupdn = \"ldap:///cn=slapd-ldap01,cn=389 Directory Server,cn=Server Group,cn=hosted04.klab.cc,ou=klab.cc,o=NetscapeRoot\";)"
    echo ""
    echo "dn: cn=Directory Administrators,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: groupofuniquenames"
    echo "cn: Directory Administrators"
    echo "uniqueMember: cn=Directory Manager"
    echo ""

    echo "dn: ou=Groups,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: organizationalunit"
    echo "ou: Groups"
    echo ""

    echo "dn: ou=People,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: organizationalunit"
    echo "ou: People"
    echo ""

    echo "dn: ou=Special Users,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: organizationalUnit"
    echo "ou: Special Users"
    echo "description: Special Administrative Accounts"
    echo ""

    echo "dn: uid=kolab-service,ou=Special Users,${domain_dn}"
    echo "uid: kolab-service"
    echo "givenName: Kolab"
    echo "objectClass: top"
    echo "objectClass: person"
    echo "objectClass: inetOrgPerson"
    echo "objectClass: organizationalPerson"
    echo "sn: Service Account"
    echo "cn: Kolab Service Account"
    echo "userPassword: ${kolab_service_pass}"
    echo ""

    echo "dn: uid=cyrus-murder,ou=Special Users,${domain_dn}"
    echo "uid: cyrus-murder"
    echo "givenName: Cyrus"
    echo "objectClass: top"
    echo "objectClass: person"
    echo "objectClass: inetOrgPerson"
    echo "objectClass: organizationalPerson"
    echo "sn: Murder"
    echo "cn: Cyrus Murder"
    echo "userPassword: ${cyrus_murder_pass}"
    echo ""

    echo "dn: uid=cyrus-admin,ou=Special Users,${domain_dn}"
    echo "uid: cyrus-admin"
    echo "givenName: Cyrus"
    echo "objectClass: top"
    echo "objectClass: person"
    echo "objectClass: inetOrgPerson"
    echo "objectClass: organizationalPerson"
    echo "sn: Administrator"
    echo "cn: Cyrus Administrator"
    echo "userPassword: ${cyrus_admin_pass}"
    echo ""

) | ldapadd -x -h ${ldap_server} -D "cn=Directory Manager" -w "${dirmgr_pass_plain}" -c</programlisting>
                <section id="sect-Architecture_and_Design-domain.add_Method-TODO">
                    <title>TODO</title>
                    <para>
                        The following is a list of things that still need to be designed and/or implemented.
                    </para>
                    <para>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    Adding an alias for a domain name space, such that "company.nl" can be specified as an alias domain name space for "company.com".
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Designating an "owner" of a domain name space, possibly through nesting (LDAP) or assigning a owner_id (SQL).
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Determining access to a domain name space for any particular set of credentials.
                                </para>
                                <para>
                                    It seems, for LDAP, the server-side getEffectiveRights control is not supported. An alternative may be to probe the root dn for the domain name space using the current session bind credentials, but this may not scale. Exceptions to the probing would need to be established to make sure the known DNs are not subjected to the extensive operation(s) (such as <emphasis>cn=Directory Manager</emphasis>).
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Once a domain is added, we have to implement access control on top of it.
                                </para>

                            </listitem>

                        </itemizedlist>

                    </para>

                </section>


            </section>

            <section id="sect-Architecture_and_Design-The_domain_Service-domain.delete_Method">
                <title><literal>domain.delete</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_domain_Service-domain.edit_Method">
                <title><literal>domain.edit</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_domains_Service">
            <title>The <literal>domains</literal> Service</title>
            <section id="sect-Architecture_and_Design-The_domains_Service-domains.list_Method">
                <title><literal>domains.list</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_group_Service">
            <title>The <literal>group</literal> Service</title>
            <section id="sect-Architecture_and_Design-The_group_Service-group.info_Method">
                <title><literal>group.info</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-group.info_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters are required:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-group.info_Method-group">
                                <title><literal>group</literal></title>
                                <para>
                                    The group to return information for.
                                </para>

                            </formalpara>
                            <remark> Currently, we only allow the group to be searched by the email address associated with the group. </remark>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-group.info_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.info_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.info_Method-Response">
                    <title>Response</title>
                    <para>

<screen language="Python">{
    "status":"OK",
    "result": [
        "uid=vanmeeuwen,ou=People,dc=klab,dc=cc",
        "uid=greve,ou=People,dc=klab,dc=cc",
        "uid=adams,ou=People,dc=klab,dc=cc",
        "uid=wickert,ou=People,dc=klab,dc=cc",
        "uid=machniak,ou=People,dc=klab,dc=cc",
        "uid=bruederli,ou=People,dc=klab,dc=cc",
        "uid=mollekopf,ou=People,dc=klab,dc=cc",
        "uid=beecher,ou=People,dc=klab,dc=cc",
        "uid=ayres,ou=People,dc=klab,dc=cc",
        (...snip...)
    ]
}</screen>

                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_group_Service-group.members_list_Method">
                <title><literal>group.members_list</literal> Method</title>
                <para>
                    The <literal>group.members_list</literal> service method lists the members of a group.
                </para>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters are required:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-group.members_list_Method-group">
                                <title><literal>group</literal></title>
                                <para>
                                    The group to list the members for.
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_system_Service">
            <title>The <literal>system</literal> Service</title>
            <section id="sect-Architecture_and_Design-The_system_Service-system.authenticate_Method">
                <title><literal>system.authenticate</literal> Method</title>
                <para>
                    Successful authentication is a prerequisite in order to be able to execute any other action against the system. Upon success, the <literal>system.authenticate</literal> API call returns a session token that MUST be supplied with all subsequent requests for the session, through the HTTP header <literal>X-Session-Token</literal>.
                </para>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters MUST be supplied with a call to <literal>system.authenticate</literal>:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-system.authenticate_Method-username">
                                <title><literal>username</literal></title>
                                <para>
                                    The username.
                                </para>

                            </formalpara>
                            <note>
                                <para>
                                    Currently, only the 'entryDN' and 'mail' attribute values are allowed as the username for an authentication request.
                                </para>

                            </note>
                            <para>
                                See also: <xref linkend="sect-Architecture_and_Design-Authentication_amp_Authorization-The_User_Supplied_Login" />
                            </para>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-system.authenticate_Method-password">
                                <title><literal>password</literal></title>
                                <para>
                                    para
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <para>
                    The following parameters MAY be supplied with a call to <literal>system.authenticate</literal>:
                </para>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-system.authenticate_Method-domain">
                                <title><literal>domain</literal></title>
                                <para>
                                    With supplying the <literal>domain</literal> parameter in an authentication request,
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        <example id="exam-Architecture_and_Design-Example_Client_Implementation-Example_system.authenticate_API_call_in_Python">
                            <title>Example <literal>system.authenticate</literal> API call in Python</title>
                            <para>
                                The following is an example of authentication against the API in Python:
                            </para>
                            <para>

<programlisting language="Python">import json
import httplib
import sys

from pykolab import utils

API_HOSTNAME = "kolab-admin.example.org"
API_PORT = "443"
API_SCHEME = "https"
API_BASE = "/api"

username = utils.ask_question("Login")
password = utils.ask_question("Password", password=True)

params = json.dumps({
                'username': username,
                'password': password
            })

if API_SCHEME == "http":
    conn = httplib.HTTPConnection(API_HOSTNAME, API_PORT)
elif API_SCHEME == "https":
    conn = httplib.HTTPSConnection(API_HOSTNAME, API_PORT)

conn.connect()
conn.request('POST', "%s/system.authenticate" %(API_BASE), params)
try:
    response_data = json.loads(conn.getresponse().read())
except ValueError, e:
    print e
    sys.exit(1)

# Check status here, using response_data['status']

if response_data.has_key('result'):
    if response_data['result'].has_key('session_token'):
        session_id = response_data['result']['session_token']</programlisting>

                            </para>

                        </example>

                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-Response">
                    <title>Response</title>
                    <para>
                        The following is a response to a successful authentication request (with inserted line-breaks for readability):
                    </para>

                </formalpara>
                <para>

<screen language="Python">{
    "status":"OK",
    "result": {
        "user":"cn=Directory Manager",
        "domain":"klab.cc",
        "session_token":"ndgu4ennb6t51i4b0dvkulhvk6"
    }
}</screen>

                </para>
                <para>
                    The following is a reponse to an unsuccessful call to <literal>system.authenticate</literal> (with inserted line-breaks for readability):
                </para>
                <para>

<screen language="Python">{
    "status":"ERROR",
    "code":500,
    "reason":"Internal error"
}</screen>

                </para>

            </section>

            <section id="sect-Architecture_and_Design-The_system_Service-system.capabilities_Method">
                <title><literal>system.capabilities</literal> Method</title>
                <para>
                    For all service handlers registered, a method <literal>capabilities</literal> can be executed listing the methods available and access to them. The <literal>system.capabilities</literal> API call lists all of the registered service handlers' methods and access.
                </para>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_system_Service-system.quit_Method">
                <title><literal>system.quit</literal> Method</title>
                <para>
                    The quit method ends the session.
                </para>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        GET, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_system_Service-system.select_domain_Method">
                <title><literal>system.select_domain</literal> Method</title>
                <para>
                    Select the domain supplied as the current working domain. By default, users are logged in and have access to what they are authorized for in their own domain name space only. Certain users, such as <emphasis>cn=Directory Manager</emphasis>, have access to all domains. This API call allows such users to select the domain name space they are currently working on.
                </para>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params: domain name
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Server_side_Implementation_Details">
                    <title>Server-side Implementation Details</title>
                    <para>
                        On the server-side, when <literal>system.select_domain</literal> is called successfully, the selected domain is stored in <code>$_SESSION['user']-&gt;current_domain</code>. This is a private property, however, and the rest of the code is to use the public function <code>$_SESSION['user']-&gt;get_domain()</code>:
                    </para>

                </formalpara>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_user_Service">
            <title>The <literal>user</literal> Service</title>
            <para>
                The <literal>user</literal> service ...
            </para>
            <section id="sect-Architecture_and_Design-The_user_Service-user.add_Method">
                <title><literal>user.add</literal> Method</title>
                <formalpara id="form-Architecture_and_Design-user.add_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params: user_type_id (obtain from <literal>user_types.list</literal>)
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.add_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.add_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.add_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.delete_Method">
                <title><literal>user.delete</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.disable_Method">
                <title><literal>user.disable</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.edit_Method">
                <title><literal>user.edit</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.enable_Method">
                <title><literal>user.enable</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.info_Method">
                <title><literal>user.info</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.info_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameter(s) MUST be supplied with a call to <literal>user.info</literal>:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-user.info_Method-user">
                                <title><literal>user</literal></title>
                                <para>
                                    A string allowing the user the information needs to be obtained for to be uniquely identified.
                                </para>

                            </formalpara>
                            <note>
                                <para>
                                    Currently, only the 'entryDN' and 'mail' attribute values are allowed as the username for an authentication request.
                                </para>

                            </note>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-user.info_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        GET, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.info_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.info_Method-Response">
                    <title>Response</title>
                    <para>
                        The response to a <literal>user.info</literal> API call contains all information to a particular entry in the authentication and authorization database technology, that can be obtained using the bind credentials for the session user.
                    </para>

                </formalpara>
                <para>
                    The output is normalized for abstraction, and looks as follows, with added line-breaks for clarity:
                </para>
                <para>

<screen language="Python">{
    u'status': 'OK',
    u'uid=vanmeeuwen,ou=People,dc=klab,dc=cc': {
            u'mailalternateaddress': [
                    u'vanmeeuwen@klab.cc',
                    u'j.vanmeeuwen@klab.cc'
                ],
            u'displayname': u'van Meeuwen, Jeroen',
            u'uid': u'vanmeeuwen',
            u'mailhost': u'imap.klab.cc',
            u'objectclass': [
                    u'top',
                    u'person',
                    u'inetOrgPerson',
                    u'organizationalPerson',
                    u'mailrecipient',
                    u'kolabInetOrgPerson',
                    u'posixAccount'
                ],
            u'loginshell': u'/bin/bash',
            u'userpassword': u'{SSHA}yGEm7rdOSrTDCd/h4F5q1fx5GTvSynHU',
            u'uidnumber': u'500',
            u'modifiersname': u'cn=directory manager',
            u'modifytimestamp': u'20111206153131Z',
            u'preferredlanguage': u'en_US',
            u'gidnumber': u'500',
            u'createtimestamp': u'20111119171559Z',
            u'sn': u'van Meeuwen',
            u'homedirectory': u'/home/vanmeeuwen',
            u'mail': u'jeroen.vanmeeuwen@klab.cc',
            u'givenname': u'Jeroen',
            u'creatorsname': u'cn=directory manager',
            u'cn': u'Jeroen van Meeuwen'
        }
}</screen>

                </para>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.search_Method">
                <title><literal>user.search</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.search_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.search_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        GET, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.search_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.search_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_user_types_Service">
            <title>The <literal>user_types</literal> Service</title>
            <para>
                The <literal>user_types</literal> service ...
            </para>
            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.add_Method">
                <title><literal>user_types.add</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.delete_Method">
                <title><literal>user_types.delete</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.edit_Method">
                <title><literal>user_types.edit</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.list_Method">
                <title><literal>user_types.list</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_users_Service">
            <title>The <literal>users</literal> Service</title>
            <para>
                The <literal>users</literal> service ...
            </para>
            <section id="sect-Architecture_and_Design-The_users_Service-users.list_Method">
                <title><literal>users.list</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-users.list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>

            <section id="sect-Architecture_and_Design-The_users_Service-users.search_Method">
                <title><literal>users.search</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-users.search_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.search_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.search_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.search_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>


        </section>


    </section>


</chapter>