openapi.json 22 KB

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