openapi.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "user_ldap",
  5. "version": "0.0.1",
  6. "description": "This application enables administrators to connect Nextcloud to an LDAP-based user directory.",
  7. "license": {
  8. "name": "agpl"
  9. }
  10. },
  11. "components": {
  12. "securitySchemes": {
  13. "basic_auth": {
  14. "type": "http",
  15. "scheme": "basic"
  16. },
  17. "bearer_auth": {
  18. "type": "http",
  19. "scheme": "bearer"
  20. }
  21. },
  22. "schemas": {
  23. "OCSMeta": {
  24. "type": "object",
  25. "required": [
  26. "status",
  27. "statuscode"
  28. ],
  29. "properties": {
  30. "status": {
  31. "type": "string"
  32. },
  33. "statuscode": {
  34. "type": "integer"
  35. },
  36. "message": {
  37. "type": "string"
  38. },
  39. "totalitems": {
  40. "type": "string"
  41. },
  42. "itemsperpage": {
  43. "type": "string"
  44. }
  45. }
  46. }
  47. }
  48. },
  49. "paths": {
  50. "/ocs/v2.php/apps/user_ldap/api/v1/config": {
  51. "post": {
  52. "operationId": "configapi-create",
  53. "summary": "Create a new (empty) configuration and return the resulting prefix",
  54. "description": "This endpoint requires admin access",
  55. "tags": [
  56. "configapi"
  57. ],
  58. "security": [
  59. {
  60. "bearer_auth": []
  61. },
  62. {
  63. "basic_auth": []
  64. }
  65. ],
  66. "parameters": [
  67. {
  68. "name": "OCS-APIRequest",
  69. "in": "header",
  70. "required": true,
  71. "schema": {
  72. "type": "string",
  73. "default": "true"
  74. }
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "",
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "object",
  84. "required": [
  85. "ocs"
  86. ],
  87. "properties": {
  88. "ocs": {
  89. "type": "object",
  90. "required": [
  91. "meta",
  92. "data"
  93. ],
  94. "properties": {
  95. "meta": {
  96. "$ref": "#/components/schemas/OCSMeta"
  97. },
  98. "data": {
  99. "type": "object",
  100. "required": [
  101. "configID"
  102. ],
  103. "properties": {
  104. "configID": {
  105. "type": "string"
  106. }
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. },
  119. "/ocs/v2.php/apps/user_ldap/api/v1/config/{configID}": {
  120. "get": {
  121. "operationId": "configapi-show",
  122. "summary": "Get a configuration",
  123. "description": "Output can look like this: <?xml version=\"1.0\"?> <ocs> <meta> <status>ok</status> <statuscode>200</statuscode> <message>OK</message> </meta> <data> <ldapHost>ldaps://my.ldap.server</ldapHost> <ldapPort>7770</ldapPort> <ldapBackupHost></ldapBackupHost> <ldapBackupPort></ldapBackupPort> <ldapBase>ou=small,dc=my,dc=ldap,dc=server</ldapBase> <ldapBaseUsers>ou=users,ou=small,dc=my,dc=ldap,dc=server</ldapBaseUsers> <ldapBaseGroups>ou=small,dc=my,dc=ldap,dc=server</ldapBaseGroups> <ldapAgentName>cn=root,dc=my,dc=ldap,dc=server</ldapAgentName> <ldapAgentPassword>clearTextWithShowPassword=1</ldapAgentPassword> <ldapTLS>1</ldapTLS> <turnOffCertCheck>0</turnOffCertCheck> <ldapIgnoreNamingRules/> <ldapUserDisplayName>displayname</ldapUserDisplayName> <ldapUserDisplayName2>uid</ldapUserDisplayName2> <ldapUserFilterObjectclass>inetOrgPerson</ldapUserFilterObjectclass> <ldapUserFilterGroups></ldapUserFilterGroups> <ldapUserFilter>(&amp;(objectclass=nextcloudUser)(nextcloudEnabled=TRUE))</ldapUserFilter> <ldapUserFilterMode>1</ldapUserFilterMode> <ldapGroupFilter>(&amp;(|(objectclass=nextcloudGroup)))</ldapGroupFilter> <ldapGroupFilterMode>0</ldapGroupFilterMode> <ldapGroupFilterObjectclass>nextcloudGroup</ldapGroupFilterObjectclass> <ldapGroupFilterGroups></ldapGroupFilterGroups> <ldapGroupDisplayName>cn</ldapGroupDisplayName> <ldapGroupMemberAssocAttr>memberUid</ldapGroupMemberAssocAttr> <ldapLoginFilter>(&amp;(|(objectclass=inetOrgPerson))(uid=%uid))</ldapLoginFilter> <ldapLoginFilterMode>0</ldapLoginFilterMode> <ldapLoginFilterEmail>0</ldapLoginFilterEmail> <ldapLoginFilterUsername>1</ldapLoginFilterUsername> <ldapLoginFilterAttributes></ldapLoginFilterAttributes> <ldapQuotaAttribute></ldapQuotaAttribute> <ldapQuotaDefault></ldapQuotaDefault> <ldapEmailAttribute>mail</ldapEmailAttribute> <ldapCacheTTL>20</ldapCacheTTL> <ldapUuidUserAttribute>auto</ldapUuidUserAttribute> <ldapUuidGroupAttribute>auto</ldapUuidGroupAttribute> <ldapOverrideMainServer></ldapOverrideMainServer> <ldapConfigurationActive>1</ldapConfigurationActive> <ldapAttributesForUserSearch>uid;sn;givenname</ldapAttributesForUserSearch> <ldapAttributesForGroupSearch></ldapAttributesForGroupSearch> <ldapExperiencedAdmin>0</ldapExperiencedAdmin> <homeFolderNamingRule></homeFolderNamingRule> <hasMemberOfFilterSupport></hasMemberOfFilterSupport> <useMemberOfToDetectMembership>1</useMemberOfToDetectMembership> <ldapExpertUsernameAttr>uid</ldapExpertUsernameAttr> <ldapExpertUUIDUserAttr>uid</ldapExpertUUIDUserAttr> <ldapExpertUUIDGroupAttr></ldapExpertUUIDGroupAttr> <lastJpegPhotoLookup>0</lastJpegPhotoLookup> <ldapNestedGroups>0</ldapNestedGroups> <ldapPagingSize>500</ldapPagingSize> <turnOnPasswordChange>1</turnOnPasswordChange> <ldapDynamicGroupMemberURL></ldapDynamicGroupMemberURL> </data> </ocs>\nThis endpoint requires admin access",
  124. "tags": [
  125. "configapi"
  126. ],
  127. "security": [
  128. {
  129. "bearer_auth": []
  130. },
  131. {
  132. "basic_auth": []
  133. }
  134. ],
  135. "parameters": [
  136. {
  137. "name": "showPassword",
  138. "in": "query",
  139. "description": "Whether to show the password",
  140. "schema": {
  141. "type": "integer",
  142. "default": 0
  143. }
  144. },
  145. {
  146. "name": "configID",
  147. "in": "path",
  148. "description": "ID of the config",
  149. "required": true,
  150. "schema": {
  151. "type": "string"
  152. }
  153. },
  154. {
  155. "name": "OCS-APIRequest",
  156. "in": "header",
  157. "required": true,
  158. "schema": {
  159. "type": "string",
  160. "default": "true"
  161. }
  162. }
  163. ],
  164. "responses": {
  165. "200": {
  166. "description": "Config returned",
  167. "content": {
  168. "application/json": {
  169. "schema": {
  170. "type": "object",
  171. "required": [
  172. "ocs"
  173. ],
  174. "properties": {
  175. "ocs": {
  176. "type": "object",
  177. "required": [
  178. "meta",
  179. "data"
  180. ],
  181. "properties": {
  182. "meta": {
  183. "$ref": "#/components/schemas/OCSMeta"
  184. },
  185. "data": {
  186. "type": "object",
  187. "additionalProperties": {
  188. "type": "object"
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. }
  196. }
  197. },
  198. "404": {
  199. "description": "Config not found",
  200. "content": {
  201. "text/plain": {
  202. "schema": {
  203. "type": "string"
  204. }
  205. }
  206. }
  207. }
  208. }
  209. },
  210. "put": {
  211. "operationId": "configapi-modify",
  212. "summary": "Modify a configuration",
  213. "description": "This endpoint requires admin access",
  214. "tags": [
  215. "configapi"
  216. ],
  217. "security": [
  218. {
  219. "bearer_auth": []
  220. },
  221. {
  222. "basic_auth": []
  223. }
  224. ],
  225. "parameters": [
  226. {
  227. "name": "configData",
  228. "in": "query",
  229. "description": "New config",
  230. "required": true,
  231. "schema": {
  232. "type": "string"
  233. }
  234. },
  235. {
  236. "name": "configID",
  237. "in": "path",
  238. "description": "ID of the config",
  239. "required": true,
  240. "schema": {
  241. "type": "string"
  242. }
  243. },
  244. {
  245. "name": "OCS-APIRequest",
  246. "in": "header",
  247. "required": true,
  248. "schema": {
  249. "type": "string",
  250. "default": "true"
  251. }
  252. }
  253. ],
  254. "responses": {
  255. "200": {
  256. "description": "Config returned",
  257. "content": {
  258. "application/json": {
  259. "schema": {
  260. "type": "object",
  261. "required": [
  262. "ocs"
  263. ],
  264. "properties": {
  265. "ocs": {
  266. "type": "object",
  267. "required": [
  268. "meta",
  269. "data"
  270. ],
  271. "properties": {
  272. "meta": {
  273. "$ref": "#/components/schemas/OCSMeta"
  274. },
  275. "data": {}
  276. }
  277. }
  278. }
  279. }
  280. }
  281. }
  282. },
  283. "400": {
  284. "description": "Modifying config is not possible",
  285. "content": {
  286. "text/plain": {
  287. "schema": {
  288. "type": "string"
  289. }
  290. }
  291. }
  292. },
  293. "404": {
  294. "description": "Config not found",
  295. "content": {
  296. "text/plain": {
  297. "schema": {
  298. "type": "string"
  299. }
  300. }
  301. }
  302. }
  303. }
  304. },
  305. "delete": {
  306. "operationId": "configapi-delete",
  307. "summary": "Delete a LDAP configuration",
  308. "description": "This endpoint requires admin access",
  309. "tags": [
  310. "configapi"
  311. ],
  312. "security": [
  313. {
  314. "bearer_auth": []
  315. },
  316. {
  317. "basic_auth": []
  318. }
  319. ],
  320. "parameters": [
  321. {
  322. "name": "configID",
  323. "in": "path",
  324. "description": "ID of the config",
  325. "required": true,
  326. "schema": {
  327. "type": "string"
  328. }
  329. },
  330. {
  331. "name": "OCS-APIRequest",
  332. "in": "header",
  333. "required": true,
  334. "schema": {
  335. "type": "string",
  336. "default": "true"
  337. }
  338. }
  339. ],
  340. "responses": {
  341. "200": {
  342. "description": "Config deleted successfully",
  343. "content": {
  344. "application/json": {
  345. "schema": {
  346. "type": "object",
  347. "required": [
  348. "ocs"
  349. ],
  350. "properties": {
  351. "ocs": {
  352. "type": "object",
  353. "required": [
  354. "meta",
  355. "data"
  356. ],
  357. "properties": {
  358. "meta": {
  359. "$ref": "#/components/schemas/OCSMeta"
  360. },
  361. "data": {}
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. },
  369. "404": {
  370. "description": "Config not found",
  371. "content": {
  372. "text/plain": {
  373. "schema": {
  374. "type": "string"
  375. }
  376. }
  377. }
  378. }
  379. }
  380. }
  381. }
  382. },
  383. "tags": []
  384. }