You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

701 lines
33 KiB

  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. "401": {
  118. "description": "Current user is not logged in",
  119. "content": {
  120. "application/json": {
  121. "schema": {
  122. "type": "object",
  123. "required": [
  124. "ocs"
  125. ],
  126. "properties": {
  127. "ocs": {
  128. "type": "object",
  129. "required": [
  130. "meta",
  131. "data"
  132. ],
  133. "properties": {
  134. "meta": {
  135. "$ref": "#/components/schemas/OCSMeta"
  136. },
  137. "data": {}
  138. }
  139. }
  140. }
  141. }
  142. }
  143. }
  144. },
  145. "403": {
  146. "description": "Logged in account must be an admin",
  147. "content": {
  148. "application/json": {
  149. "schema": {
  150. "type": "object",
  151. "required": [
  152. "ocs"
  153. ],
  154. "properties": {
  155. "ocs": {
  156. "type": "object",
  157. "required": [
  158. "meta",
  159. "data"
  160. ],
  161. "properties": {
  162. "meta": {
  163. "$ref": "#/components/schemas/OCSMeta"
  164. },
  165. "data": {}
  166. }
  167. }
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. }
  175. },
  176. "/ocs/v2.php/apps/user_ldap/api/v1/config/{configID}": {
  177. "get": {
  178. "operationId": "configapi-show",
  179. "summary": "Get a configuration",
  180. "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",
  181. "tags": [
  182. "configapi"
  183. ],
  184. "security": [
  185. {
  186. "bearer_auth": []
  187. },
  188. {
  189. "basic_auth": []
  190. }
  191. ],
  192. "parameters": [
  193. {
  194. "name": "configID",
  195. "in": "path",
  196. "description": "ID of the config",
  197. "required": true,
  198. "schema": {
  199. "type": "string"
  200. }
  201. },
  202. {
  203. "name": "showPassword",
  204. "in": "query",
  205. "description": "Whether to show the password",
  206. "schema": {
  207. "type": "integer",
  208. "default": 0,
  209. "enum": [
  210. 0,
  211. 1
  212. ]
  213. }
  214. },
  215. {
  216. "name": "OCS-APIRequest",
  217. "in": "header",
  218. "description": "Required to be true for the API request to pass",
  219. "required": true,
  220. "schema": {
  221. "type": "boolean",
  222. "default": true
  223. }
  224. }
  225. ],
  226. "responses": {
  227. "200": {
  228. "description": "Config returned",
  229. "content": {
  230. "application/json": {
  231. "schema": {
  232. "type": "object",
  233. "required": [
  234. "ocs"
  235. ],
  236. "properties": {
  237. "ocs": {
  238. "type": "object",
  239. "required": [
  240. "meta",
  241. "data"
  242. ],
  243. "properties": {
  244. "meta": {
  245. "$ref": "#/components/schemas/OCSMeta"
  246. },
  247. "data": {
  248. "type": "object",
  249. "additionalProperties": {
  250. "type": "object"
  251. }
  252. }
  253. }
  254. }
  255. }
  256. }
  257. }
  258. }
  259. },
  260. "404": {
  261. "description": "Config not found",
  262. "content": {
  263. "application/json": {
  264. "schema": {
  265. "type": "object",
  266. "required": [
  267. "ocs"
  268. ],
  269. "properties": {
  270. "ocs": {
  271. "type": "object",
  272. "required": [
  273. "meta",
  274. "data"
  275. ],
  276. "properties": {
  277. "meta": {
  278. "$ref": "#/components/schemas/OCSMeta"
  279. },
  280. "data": {}
  281. }
  282. }
  283. }
  284. }
  285. }
  286. }
  287. },
  288. "401": {
  289. "description": "Current user is not logged in",
  290. "content": {
  291. "application/json": {
  292. "schema": {
  293. "type": "object",
  294. "required": [
  295. "ocs"
  296. ],
  297. "properties": {
  298. "ocs": {
  299. "type": "object",
  300. "required": [
  301. "meta",
  302. "data"
  303. ],
  304. "properties": {
  305. "meta": {
  306. "$ref": "#/components/schemas/OCSMeta"
  307. },
  308. "data": {}
  309. }
  310. }
  311. }
  312. }
  313. }
  314. }
  315. },
  316. "403": {
  317. "description": "Logged in account must be an admin",
  318. "content": {
  319. "application/json": {
  320. "schema": {
  321. "type": "object",
  322. "required": [
  323. "ocs"
  324. ],
  325. "properties": {
  326. "ocs": {
  327. "type": "object",
  328. "required": [
  329. "meta",
  330. "data"
  331. ],
  332. "properties": {
  333. "meta": {
  334. "$ref": "#/components/schemas/OCSMeta"
  335. },
  336. "data": {}
  337. }
  338. }
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. },
  346. "put": {
  347. "operationId": "configapi-modify",
  348. "summary": "Modify a configuration",
  349. "description": "This endpoint requires admin access",
  350. "tags": [
  351. "configapi"
  352. ],
  353. "security": [
  354. {
  355. "bearer_auth": []
  356. },
  357. {
  358. "basic_auth": []
  359. }
  360. ],
  361. "requestBody": {
  362. "required": true,
  363. "content": {
  364. "application/json": {
  365. "schema": {
  366. "type": "object",
  367. "required": [
  368. "configData"
  369. ],
  370. "properties": {
  371. "configData": {
  372. "type": "object",
  373. "description": "New config",
  374. "additionalProperties": {
  375. "type": "object"
  376. }
  377. }
  378. }
  379. }
  380. }
  381. }
  382. },
  383. "parameters": [
  384. {
  385. "name": "configID",
  386. "in": "path",
  387. "description": "ID of the config",
  388. "required": true,
  389. "schema": {
  390. "type": "string"
  391. }
  392. },
  393. {
  394. "name": "OCS-APIRequest",
  395. "in": "header",
  396. "description": "Required to be true for the API request to pass",
  397. "required": true,
  398. "schema": {
  399. "type": "boolean",
  400. "default": true
  401. }
  402. }
  403. ],
  404. "responses": {
  405. "200": {
  406. "description": "Config returned",
  407. "content": {
  408. "application/json": {
  409. "schema": {
  410. "type": "object",
  411. "required": [
  412. "ocs"
  413. ],
  414. "properties": {
  415. "ocs": {
  416. "type": "object",
  417. "required": [
  418. "meta",
  419. "data"
  420. ],
  421. "properties": {
  422. "meta": {
  423. "$ref": "#/components/schemas/OCSMeta"
  424. },
  425. "data": {}
  426. }
  427. }
  428. }
  429. }
  430. }
  431. }
  432. },
  433. "400": {
  434. "description": "Modifying config is not possible",
  435. "content": {
  436. "application/json": {
  437. "schema": {
  438. "type": "object",
  439. "required": [
  440. "ocs"
  441. ],
  442. "properties": {
  443. "ocs": {
  444. "type": "object",
  445. "required": [
  446. "meta",
  447. "data"
  448. ],
  449. "properties": {
  450. "meta": {
  451. "$ref": "#/components/schemas/OCSMeta"
  452. },
  453. "data": {}
  454. }
  455. }
  456. }
  457. }
  458. }
  459. }
  460. },
  461. "404": {
  462. "description": "Config not found",
  463. "content": {
  464. "application/json": {
  465. "schema": {
  466. "type": "object",
  467. "required": [
  468. "ocs"
  469. ],
  470. "properties": {
  471. "ocs": {
  472. "type": "object",
  473. "required": [
  474. "meta",
  475. "data"
  476. ],
  477. "properties": {
  478. "meta": {
  479. "$ref": "#/components/schemas/OCSMeta"
  480. },
  481. "data": {}
  482. }
  483. }
  484. }
  485. }
  486. }
  487. }
  488. },
  489. "401": {
  490. "description": "Current user is not logged in",
  491. "content": {
  492. "application/json": {
  493. "schema": {
  494. "type": "object",
  495. "required": [
  496. "ocs"
  497. ],
  498. "properties": {
  499. "ocs": {
  500. "type": "object",
  501. "required": [
  502. "meta",
  503. "data"
  504. ],
  505. "properties": {
  506. "meta": {
  507. "$ref": "#/components/schemas/OCSMeta"
  508. },
  509. "data": {}
  510. }
  511. }
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "403": {
  518. "description": "Logged in account must be an admin",
  519. "content": {
  520. "application/json": {
  521. "schema": {
  522. "type": "object",
  523. "required": [
  524. "ocs"
  525. ],
  526. "properties": {
  527. "ocs": {
  528. "type": "object",
  529. "required": [
  530. "meta",
  531. "data"
  532. ],
  533. "properties": {
  534. "meta": {
  535. "$ref": "#/components/schemas/OCSMeta"
  536. },
  537. "data": {}
  538. }
  539. }
  540. }
  541. }
  542. }
  543. }
  544. }
  545. }
  546. },
  547. "delete": {
  548. "operationId": "configapi-delete",
  549. "summary": "Delete a LDAP configuration",
  550. "description": "This endpoint requires admin access",
  551. "tags": [
  552. "configapi"
  553. ],
  554. "security": [
  555. {
  556. "bearer_auth": []
  557. },
  558. {
  559. "basic_auth": []
  560. }
  561. ],
  562. "parameters": [
  563. {
  564. "name": "configID",
  565. "in": "path",
  566. "description": "ID of the config",
  567. "required": true,
  568. "schema": {
  569. "type": "string"
  570. }
  571. },
  572. {
  573. "name": "OCS-APIRequest",
  574. "in": "header",
  575. "description": "Required to be true for the API request to pass",
  576. "required": true,
  577. "schema": {
  578. "type": "boolean",
  579. "default": true
  580. }
  581. }
  582. ],
  583. "responses": {
  584. "200": {
  585. "description": "Config deleted successfully",
  586. "content": {
  587. "application/json": {
  588. "schema": {
  589. "type": "object",
  590. "required": [
  591. "ocs"
  592. ],
  593. "properties": {
  594. "ocs": {
  595. "type": "object",
  596. "required": [
  597. "meta",
  598. "data"
  599. ],
  600. "properties": {
  601. "meta": {
  602. "$ref": "#/components/schemas/OCSMeta"
  603. },
  604. "data": {}
  605. }
  606. }
  607. }
  608. }
  609. }
  610. }
  611. },
  612. "404": {
  613. "description": "Config not found",
  614. "content": {
  615. "application/json": {
  616. "schema": {
  617. "type": "object",
  618. "required": [
  619. "ocs"
  620. ],
  621. "properties": {
  622. "ocs": {
  623. "type": "object",
  624. "required": [
  625. "meta",
  626. "data"
  627. ],
  628. "properties": {
  629. "meta": {
  630. "$ref": "#/components/schemas/OCSMeta"
  631. },
  632. "data": {}
  633. }
  634. }
  635. }
  636. }
  637. }
  638. }
  639. },
  640. "401": {
  641. "description": "Current user is not logged in",
  642. "content": {
  643. "application/json": {
  644. "schema": {
  645. "type": "object",
  646. "required": [
  647. "ocs"
  648. ],
  649. "properties": {
  650. "ocs": {
  651. "type": "object",
  652. "required": [
  653. "meta",
  654. "data"
  655. ],
  656. "properties": {
  657. "meta": {
  658. "$ref": "#/components/schemas/OCSMeta"
  659. },
  660. "data": {}
  661. }
  662. }
  663. }
  664. }
  665. }
  666. }
  667. },
  668. "403": {
  669. "description": "Logged in account must be an admin",
  670. "content": {
  671. "application/json": {
  672. "schema": {
  673. "type": "object",
  674. "required": [
  675. "ocs"
  676. ],
  677. "properties": {
  678. "ocs": {
  679. "type": "object",
  680. "required": [
  681. "meta",
  682. "data"
  683. ],
  684. "properties": {
  685. "meta": {
  686. "$ref": "#/components/schemas/OCSMeta"
  687. },
  688. "data": {}
  689. }
  690. }
  691. }
  692. }
  693. }
  694. }
  695. }
  696. }
  697. }
  698. }
  699. },
  700. "tags": []
  701. }