openapi.json 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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. "description": "Required to be true for the API request to pass",
  71. "required": true,
  72. "schema": {
  73. "type": "boolean",
  74. "default": true
  75. }
  76. }
  77. ],
  78. "responses": {
  79. "200": {
  80. "description": "Config created successfully",
  81. "content": {
  82. "application/json": {
  83. "schema": {
  84. "type": "object",
  85. "required": [
  86. "ocs"
  87. ],
  88. "properties": {
  89. "ocs": {
  90. "type": "object",
  91. "required": [
  92. "meta",
  93. "data"
  94. ],
  95. "properties": {
  96. "meta": {
  97. "$ref": "#/components/schemas/OCSMeta"
  98. },
  99. "data": {
  100. "type": "object",
  101. "required": [
  102. "configID"
  103. ],
  104. "properties": {
  105. "configID": {
  106. "type": "string"
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. },
  120. "/ocs/v2.php/apps/user_ldap/api/v1/config/{configID}": {
  121. "get": {
  122. "operationId": "configapi-show",
  123. "summary": "Get a configuration",
  124. "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",
  125. "tags": [
  126. "configapi"
  127. ],
  128. "security": [
  129. {
  130. "bearer_auth": []
  131. },
  132. {
  133. "basic_auth": []
  134. }
  135. ],
  136. "requestBody": {
  137. "required": false,
  138. "content": {
  139. "application/json": {
  140. "schema": {
  141. "type": "object",
  142. "properties": {
  143. "showPassword": {
  144. "type": "boolean",
  145. "default": false,
  146. "description": "Whether to show the password"
  147. }
  148. }
  149. }
  150. }
  151. }
  152. },
  153. "parameters": [
  154. {
  155. "name": "configID",
  156. "in": "path",
  157. "description": "ID of the config",
  158. "required": true,
  159. "schema": {
  160. "type": "string"
  161. }
  162. },
  163. {
  164. "name": "OCS-APIRequest",
  165. "in": "header",
  166. "description": "Required to be true for the API request to pass",
  167. "required": true,
  168. "schema": {
  169. "type": "boolean",
  170. "default": true
  171. }
  172. }
  173. ],
  174. "responses": {
  175. "200": {
  176. "description": "Config returned",
  177. "content": {
  178. "application/json": {
  179. "schema": {
  180. "type": "object",
  181. "required": [
  182. "ocs"
  183. ],
  184. "properties": {
  185. "ocs": {
  186. "type": "object",
  187. "required": [
  188. "meta",
  189. "data"
  190. ],
  191. "properties": {
  192. "meta": {
  193. "$ref": "#/components/schemas/OCSMeta"
  194. },
  195. "data": {
  196. "type": "object",
  197. "additionalProperties": {
  198. "type": "object"
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. }
  207. },
  208. "404": {
  209. "description": "Config not found",
  210. "content": {
  211. "application/json": {
  212. "schema": {
  213. "type": "object",
  214. "required": [
  215. "ocs"
  216. ],
  217. "properties": {
  218. "ocs": {
  219. "type": "object",
  220. "required": [
  221. "meta",
  222. "data"
  223. ],
  224. "properties": {
  225. "meta": {
  226. "$ref": "#/components/schemas/OCSMeta"
  227. },
  228. "data": {}
  229. }
  230. }
  231. }
  232. }
  233. }
  234. }
  235. }
  236. }
  237. },
  238. "put": {
  239. "operationId": "configapi-modify",
  240. "summary": "Modify a configuration",
  241. "description": "This endpoint requires admin access",
  242. "tags": [
  243. "configapi"
  244. ],
  245. "security": [
  246. {
  247. "bearer_auth": []
  248. },
  249. {
  250. "basic_auth": []
  251. }
  252. ],
  253. "requestBody": {
  254. "required": true,
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "type": "object",
  259. "required": [
  260. "configData"
  261. ],
  262. "properties": {
  263. "configData": {
  264. "type": "object",
  265. "description": "New config",
  266. "additionalProperties": {
  267. "type": "object"
  268. }
  269. }
  270. }
  271. }
  272. }
  273. }
  274. },
  275. "parameters": [
  276. {
  277. "name": "configID",
  278. "in": "path",
  279. "description": "ID of the config",
  280. "required": true,
  281. "schema": {
  282. "type": "string"
  283. }
  284. },
  285. {
  286. "name": "OCS-APIRequest",
  287. "in": "header",
  288. "description": "Required to be true for the API request to pass",
  289. "required": true,
  290. "schema": {
  291. "type": "boolean",
  292. "default": true
  293. }
  294. }
  295. ],
  296. "responses": {
  297. "200": {
  298. "description": "Config returned",
  299. "content": {
  300. "application/json": {
  301. "schema": {
  302. "type": "object",
  303. "required": [
  304. "ocs"
  305. ],
  306. "properties": {
  307. "ocs": {
  308. "type": "object",
  309. "required": [
  310. "meta",
  311. "data"
  312. ],
  313. "properties": {
  314. "meta": {
  315. "$ref": "#/components/schemas/OCSMeta"
  316. },
  317. "data": {}
  318. }
  319. }
  320. }
  321. }
  322. }
  323. }
  324. },
  325. "400": {
  326. "description": "Modifying config is not possible",
  327. "content": {
  328. "application/json": {
  329. "schema": {
  330. "type": "object",
  331. "required": [
  332. "ocs"
  333. ],
  334. "properties": {
  335. "ocs": {
  336. "type": "object",
  337. "required": [
  338. "meta",
  339. "data"
  340. ],
  341. "properties": {
  342. "meta": {
  343. "$ref": "#/components/schemas/OCSMeta"
  344. },
  345. "data": {}
  346. }
  347. }
  348. }
  349. }
  350. }
  351. }
  352. },
  353. "404": {
  354. "description": "Config not found",
  355. "content": {
  356. "application/json": {
  357. "schema": {
  358. "type": "object",
  359. "required": [
  360. "ocs"
  361. ],
  362. "properties": {
  363. "ocs": {
  364. "type": "object",
  365. "required": [
  366. "meta",
  367. "data"
  368. ],
  369. "properties": {
  370. "meta": {
  371. "$ref": "#/components/schemas/OCSMeta"
  372. },
  373. "data": {}
  374. }
  375. }
  376. }
  377. }
  378. }
  379. }
  380. }
  381. }
  382. },
  383. "delete": {
  384. "operationId": "configapi-delete",
  385. "summary": "Delete a LDAP configuration",
  386. "description": "This endpoint requires admin access",
  387. "tags": [
  388. "configapi"
  389. ],
  390. "security": [
  391. {
  392. "bearer_auth": []
  393. },
  394. {
  395. "basic_auth": []
  396. }
  397. ],
  398. "parameters": [
  399. {
  400. "name": "configID",
  401. "in": "path",
  402. "description": "ID of the config",
  403. "required": true,
  404. "schema": {
  405. "type": "string"
  406. }
  407. },
  408. {
  409. "name": "OCS-APIRequest",
  410. "in": "header",
  411. "description": "Required to be true for the API request to pass",
  412. "required": true,
  413. "schema": {
  414. "type": "boolean",
  415. "default": true
  416. }
  417. }
  418. ],
  419. "responses": {
  420. "200": {
  421. "description": "Config deleted successfully",
  422. "content": {
  423. "application/json": {
  424. "schema": {
  425. "type": "object",
  426. "required": [
  427. "ocs"
  428. ],
  429. "properties": {
  430. "ocs": {
  431. "type": "object",
  432. "required": [
  433. "meta",
  434. "data"
  435. ],
  436. "properties": {
  437. "meta": {
  438. "$ref": "#/components/schemas/OCSMeta"
  439. },
  440. "data": {}
  441. }
  442. }
  443. }
  444. }
  445. }
  446. }
  447. },
  448. "404": {
  449. "description": "Config not found",
  450. "content": {
  451. "application/json": {
  452. "schema": {
  453. "type": "object",
  454. "required": [
  455. "ocs"
  456. ],
  457. "properties": {
  458. "ocs": {
  459. "type": "object",
  460. "required": [
  461. "meta",
  462. "data"
  463. ],
  464. "properties": {
  465. "meta": {
  466. "$ref": "#/components/schemas/OCSMeta"
  467. },
  468. "data": {}
  469. }
  470. }
  471. }
  472. }
  473. }
  474. }
  475. }
  476. }
  477. }
  478. }
  479. },
  480. "tags": []
  481. }