1
0

openapi.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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. "text/plain": {
  208. "schema": {
  209. "type": "string"
  210. }
  211. }
  212. }
  213. }
  214. }
  215. },
  216. "put": {
  217. "operationId": "configapi-modify",
  218. "summary": "Modify a configuration",
  219. "description": "This endpoint requires admin access",
  220. "tags": [
  221. "configapi"
  222. ],
  223. "security": [
  224. {
  225. "bearer_auth": []
  226. },
  227. {
  228. "basic_auth": []
  229. }
  230. ],
  231. "parameters": [
  232. {
  233. "name": "configData",
  234. "in": "query",
  235. "description": "New config",
  236. "required": true,
  237. "schema": {
  238. "type": "string"
  239. }
  240. },
  241. {
  242. "name": "configID",
  243. "in": "path",
  244. "description": "ID of the config",
  245. "required": true,
  246. "schema": {
  247. "type": "string"
  248. }
  249. },
  250. {
  251. "name": "OCS-APIRequest",
  252. "in": "header",
  253. "description": "Required to be true for the API request to pass",
  254. "required": true,
  255. "schema": {
  256. "type": "boolean",
  257. "default": true
  258. }
  259. }
  260. ],
  261. "responses": {
  262. "200": {
  263. "description": "Config returned",
  264. "content": {
  265. "application/json": {
  266. "schema": {
  267. "type": "object",
  268. "required": [
  269. "ocs"
  270. ],
  271. "properties": {
  272. "ocs": {
  273. "type": "object",
  274. "required": [
  275. "meta",
  276. "data"
  277. ],
  278. "properties": {
  279. "meta": {
  280. "$ref": "#/components/schemas/OCSMeta"
  281. },
  282. "data": {}
  283. }
  284. }
  285. }
  286. }
  287. }
  288. }
  289. },
  290. "400": {
  291. "description": "Modifying config is not possible",
  292. "content": {
  293. "text/plain": {
  294. "schema": {
  295. "type": "string"
  296. }
  297. }
  298. }
  299. },
  300. "404": {
  301. "description": "Config not found",
  302. "content": {
  303. "text/plain": {
  304. "schema": {
  305. "type": "string"
  306. }
  307. }
  308. }
  309. }
  310. }
  311. },
  312. "delete": {
  313. "operationId": "configapi-delete",
  314. "summary": "Delete a LDAP configuration",
  315. "description": "This endpoint requires admin access",
  316. "tags": [
  317. "configapi"
  318. ],
  319. "security": [
  320. {
  321. "bearer_auth": []
  322. },
  323. {
  324. "basic_auth": []
  325. }
  326. ],
  327. "parameters": [
  328. {
  329. "name": "configID",
  330. "in": "path",
  331. "description": "ID of the config",
  332. "required": true,
  333. "schema": {
  334. "type": "string"
  335. }
  336. },
  337. {
  338. "name": "OCS-APIRequest",
  339. "in": "header",
  340. "description": "Required to be true for the API request to pass",
  341. "required": true,
  342. "schema": {
  343. "type": "boolean",
  344. "default": true
  345. }
  346. }
  347. ],
  348. "responses": {
  349. "200": {
  350. "description": "Config deleted successfully",
  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. "404": {
  378. "description": "Config not found",
  379. "content": {
  380. "text/plain": {
  381. "schema": {
  382. "type": "string"
  383. }
  384. }
  385. }
  386. }
  387. }
  388. }
  389. }
  390. },
  391. "tags": []
  392. }