openapi.json 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  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": "showPassword",
  139. "in": "query",
  140. "description": "Whether to show the password",
  141. "schema": {
  142. "type": "integer",
  143. "default": 0,
  144. "enum": [
  145. 0,
  146. 1
  147. ]
  148. }
  149. },
  150. {
  151. "name": "configID",
  152. "in": "path",
  153. "description": "ID of the config",
  154. "required": true,
  155. "schema": {
  156. "type": "string"
  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. "parameters": [
  250. {
  251. "name": "configData",
  252. "in": "query",
  253. "description": "New config",
  254. "required": true,
  255. "schema": {
  256. "type": "string"
  257. }
  258. },
  259. {
  260. "name": "configID",
  261. "in": "path",
  262. "description": "ID of the config",
  263. "required": true,
  264. "schema": {
  265. "type": "string"
  266. }
  267. },
  268. {
  269. "name": "OCS-APIRequest",
  270. "in": "header",
  271. "description": "Required to be true for the API request to pass",
  272. "required": true,
  273. "schema": {
  274. "type": "boolean",
  275. "default": true
  276. }
  277. }
  278. ],
  279. "responses": {
  280. "200": {
  281. "description": "Config returned",
  282. "content": {
  283. "application/json": {
  284. "schema": {
  285. "type": "object",
  286. "required": [
  287. "ocs"
  288. ],
  289. "properties": {
  290. "ocs": {
  291. "type": "object",
  292. "required": [
  293. "meta",
  294. "data"
  295. ],
  296. "properties": {
  297. "meta": {
  298. "$ref": "#/components/schemas/OCSMeta"
  299. },
  300. "data": {}
  301. }
  302. }
  303. }
  304. }
  305. }
  306. }
  307. },
  308. "400": {
  309. "description": "Modifying config is not possible",
  310. "content": {
  311. "application/json": {
  312. "schema": {
  313. "type": "object",
  314. "required": [
  315. "ocs"
  316. ],
  317. "properties": {
  318. "ocs": {
  319. "type": "object",
  320. "required": [
  321. "meta",
  322. "data"
  323. ],
  324. "properties": {
  325. "meta": {
  326. "$ref": "#/components/schemas/OCSMeta"
  327. },
  328. "data": {}
  329. }
  330. }
  331. }
  332. }
  333. }
  334. }
  335. },
  336. "404": {
  337. "description": "Config not found",
  338. "content": {
  339. "application/json": {
  340. "schema": {
  341. "type": "object",
  342. "required": [
  343. "ocs"
  344. ],
  345. "properties": {
  346. "ocs": {
  347. "type": "object",
  348. "required": [
  349. "meta",
  350. "data"
  351. ],
  352. "properties": {
  353. "meta": {
  354. "$ref": "#/components/schemas/OCSMeta"
  355. },
  356. "data": {}
  357. }
  358. }
  359. }
  360. }
  361. }
  362. }
  363. }
  364. }
  365. },
  366. "delete": {
  367. "operationId": "configapi-delete",
  368. "summary": "Delete a LDAP configuration",
  369. "description": "This endpoint requires admin access",
  370. "tags": [
  371. "configapi"
  372. ],
  373. "security": [
  374. {
  375. "bearer_auth": []
  376. },
  377. {
  378. "basic_auth": []
  379. }
  380. ],
  381. "parameters": [
  382. {
  383. "name": "configID",
  384. "in": "path",
  385. "description": "ID of the config",
  386. "required": true,
  387. "schema": {
  388. "type": "string"
  389. }
  390. },
  391. {
  392. "name": "OCS-APIRequest",
  393. "in": "header",
  394. "description": "Required to be true for the API request to pass",
  395. "required": true,
  396. "schema": {
  397. "type": "boolean",
  398. "default": true
  399. }
  400. }
  401. ],
  402. "responses": {
  403. "200": {
  404. "description": "Config deleted successfully",
  405. "content": {
  406. "application/json": {
  407. "schema": {
  408. "type": "object",
  409. "required": [
  410. "ocs"
  411. ],
  412. "properties": {
  413. "ocs": {
  414. "type": "object",
  415. "required": [
  416. "meta",
  417. "data"
  418. ],
  419. "properties": {
  420. "meta": {
  421. "$ref": "#/components/schemas/OCSMeta"
  422. },
  423. "data": {}
  424. }
  425. }
  426. }
  427. }
  428. }
  429. }
  430. },
  431. "404": {
  432. "description": "Config not found",
  433. "content": {
  434. "application/json": {
  435. "schema": {
  436. "type": "object",
  437. "required": [
  438. "ocs"
  439. ],
  440. "properties": {
  441. "ocs": {
  442. "type": "object",
  443. "required": [
  444. "meta",
  445. "data"
  446. ],
  447. "properties": {
  448. "meta": {
  449. "$ref": "#/components/schemas/OCSMeta"
  450. },
  451. "data": {}
  452. }
  453. }
  454. }
  455. }
  456. }
  457. }
  458. }
  459. }
  460. }
  461. }
  462. },
  463. "tags": []
  464. }