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.

599 lines
27 KiB

  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "federation-administration",
  5. "version": "0.0.1",
  6. "description": "Federation allows you to connect with other trusted servers to exchange the account 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/federation/trusted-servers": {
  51. "post": {
  52. "operationId": "settings-add-server",
  53. "summary": "Add server to the list of trusted Nextcloud servers",
  54. "description": "This endpoint requires admin access",
  55. "tags": [
  56. "settings"
  57. ],
  58. "security": [
  59. {
  60. "bearer_auth": []
  61. },
  62. {
  63. "basic_auth": []
  64. }
  65. ],
  66. "requestBody": {
  67. "required": true,
  68. "content": {
  69. "application/json": {
  70. "schema": {
  71. "type": "object",
  72. "required": [
  73. "url"
  74. ],
  75. "properties": {
  76. "url": {
  77. "type": "string",
  78. "description": "The URL of the server to add"
  79. }
  80. }
  81. }
  82. }
  83. }
  84. },
  85. "parameters": [
  86. {
  87. "name": "OCS-APIRequest",
  88. "in": "header",
  89. "description": "Required to be true for the API request to pass",
  90. "required": true,
  91. "schema": {
  92. "type": "boolean",
  93. "default": true
  94. }
  95. }
  96. ],
  97. "responses": {
  98. "200": {
  99. "description": "Server added successfully",
  100. "content": {
  101. "application/json": {
  102. "schema": {
  103. "type": "object",
  104. "required": [
  105. "ocs"
  106. ],
  107. "properties": {
  108. "ocs": {
  109. "type": "object",
  110. "required": [
  111. "meta",
  112. "data"
  113. ],
  114. "properties": {
  115. "meta": {
  116. "$ref": "#/components/schemas/OCSMeta"
  117. },
  118. "data": {
  119. "type": "object",
  120. "required": [
  121. "id",
  122. "message",
  123. "url"
  124. ],
  125. "properties": {
  126. "id": {
  127. "type": "integer",
  128. "format": "int64"
  129. },
  130. "message": {
  131. "type": "string"
  132. },
  133. "url": {
  134. "type": "string"
  135. }
  136. }
  137. }
  138. }
  139. }
  140. }
  141. }
  142. }
  143. }
  144. },
  145. "404": {
  146. "description": "Server not found at the given URL",
  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. "type": "object",
  167. "required": [
  168. "message"
  169. ],
  170. "properties": {
  171. "message": {
  172. "type": "string"
  173. }
  174. }
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }
  181. }
  182. },
  183. "409": {
  184. "description": "Server is already in the list of trusted servers",
  185. "content": {
  186. "application/json": {
  187. "schema": {
  188. "type": "object",
  189. "required": [
  190. "ocs"
  191. ],
  192. "properties": {
  193. "ocs": {
  194. "type": "object",
  195. "required": [
  196. "meta",
  197. "data"
  198. ],
  199. "properties": {
  200. "meta": {
  201. "$ref": "#/components/schemas/OCSMeta"
  202. },
  203. "data": {
  204. "type": "object",
  205. "required": [
  206. "message"
  207. ],
  208. "properties": {
  209. "message": {
  210. "type": "string"
  211. }
  212. }
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. },
  221. "401": {
  222. "description": "Current user is not logged in",
  223. "content": {
  224. "application/json": {
  225. "schema": {
  226. "type": "object",
  227. "required": [
  228. "ocs"
  229. ],
  230. "properties": {
  231. "ocs": {
  232. "type": "object",
  233. "required": [
  234. "meta",
  235. "data"
  236. ],
  237. "properties": {
  238. "meta": {
  239. "$ref": "#/components/schemas/OCSMeta"
  240. },
  241. "data": {}
  242. }
  243. }
  244. }
  245. }
  246. }
  247. }
  248. },
  249. "403": {
  250. "description": "Logged in account must be an admin",
  251. "content": {
  252. "application/json": {
  253. "schema": {
  254. "type": "object",
  255. "required": [
  256. "ocs"
  257. ],
  258. "properties": {
  259. "ocs": {
  260. "type": "object",
  261. "required": [
  262. "meta",
  263. "data"
  264. ],
  265. "properties": {
  266. "meta": {
  267. "$ref": "#/components/schemas/OCSMeta"
  268. },
  269. "data": {}
  270. }
  271. }
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. },
  279. "get": {
  280. "operationId": "settings-get-servers",
  281. "summary": "List all trusted servers",
  282. "description": "This endpoint requires admin access",
  283. "tags": [
  284. "settings"
  285. ],
  286. "security": [
  287. {
  288. "bearer_auth": []
  289. },
  290. {
  291. "basic_auth": []
  292. }
  293. ],
  294. "parameters": [
  295. {
  296. "name": "OCS-APIRequest",
  297. "in": "header",
  298. "description": "Required to be true for the API request to pass",
  299. "required": true,
  300. "schema": {
  301. "type": "boolean",
  302. "default": true
  303. }
  304. }
  305. ],
  306. "responses": {
  307. "200": {
  308. "description": "List of trusted servers",
  309. "content": {
  310. "application/json": {
  311. "schema": {
  312. "type": "object",
  313. "required": [
  314. "ocs"
  315. ],
  316. "properties": {
  317. "ocs": {
  318. "type": "object",
  319. "required": [
  320. "meta",
  321. "data"
  322. ],
  323. "properties": {
  324. "meta": {
  325. "$ref": "#/components/schemas/OCSMeta"
  326. },
  327. "data": {
  328. "type": "array",
  329. "items": {
  330. "type": "object",
  331. "required": [
  332. "id",
  333. "status",
  334. "url"
  335. ],
  336. "properties": {
  337. "id": {
  338. "type": "integer",
  339. "format": "int64"
  340. },
  341. "status": {
  342. "type": "integer",
  343. "format": "int64"
  344. },
  345. "url": {
  346. "type": "string"
  347. }
  348. }
  349. }
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. }
  357. },
  358. "401": {
  359. "description": "Current user is not logged in",
  360. "content": {
  361. "application/json": {
  362. "schema": {
  363. "type": "object",
  364. "required": [
  365. "ocs"
  366. ],
  367. "properties": {
  368. "ocs": {
  369. "type": "object",
  370. "required": [
  371. "meta",
  372. "data"
  373. ],
  374. "properties": {
  375. "meta": {
  376. "$ref": "#/components/schemas/OCSMeta"
  377. },
  378. "data": {}
  379. }
  380. }
  381. }
  382. }
  383. }
  384. }
  385. },
  386. "403": {
  387. "description": "Logged in account must be an admin",
  388. "content": {
  389. "application/json": {
  390. "schema": {
  391. "type": "object",
  392. "required": [
  393. "ocs"
  394. ],
  395. "properties": {
  396. "ocs": {
  397. "type": "object",
  398. "required": [
  399. "meta",
  400. "data"
  401. ],
  402. "properties": {
  403. "meta": {
  404. "$ref": "#/components/schemas/OCSMeta"
  405. },
  406. "data": {}
  407. }
  408. }
  409. }
  410. }
  411. }
  412. }
  413. }
  414. }
  415. }
  416. },
  417. "/ocs/v2.php/apps/federation/trusted-servers/{id}": {
  418. "delete": {
  419. "operationId": "settings-remove-server",
  420. "summary": "Add server to the list of trusted Nextcloud servers",
  421. "description": "This endpoint requires admin access",
  422. "tags": [
  423. "settings"
  424. ],
  425. "security": [
  426. {
  427. "bearer_auth": []
  428. },
  429. {
  430. "basic_auth": []
  431. }
  432. ],
  433. "parameters": [
  434. {
  435. "name": "id",
  436. "in": "path",
  437. "description": "The ID of the trusted server to remove",
  438. "required": true,
  439. "schema": {
  440. "type": "integer",
  441. "format": "int64"
  442. }
  443. },
  444. {
  445. "name": "OCS-APIRequest",
  446. "in": "header",
  447. "description": "Required to be true for the API request to pass",
  448. "required": true,
  449. "schema": {
  450. "type": "boolean",
  451. "default": true
  452. }
  453. }
  454. ],
  455. "responses": {
  456. "200": {
  457. "description": "Server removed successfully",
  458. "content": {
  459. "application/json": {
  460. "schema": {
  461. "type": "object",
  462. "required": [
  463. "ocs"
  464. ],
  465. "properties": {
  466. "ocs": {
  467. "type": "object",
  468. "required": [
  469. "meta",
  470. "data"
  471. ],
  472. "properties": {
  473. "meta": {
  474. "$ref": "#/components/schemas/OCSMeta"
  475. },
  476. "data": {
  477. "type": "object",
  478. "required": [
  479. "id"
  480. ],
  481. "properties": {
  482. "id": {
  483. "type": "integer",
  484. "format": "int64"
  485. }
  486. }
  487. }
  488. }
  489. }
  490. }
  491. }
  492. }
  493. }
  494. },
  495. "404": {
  496. "description": "Server not found at the given ID",
  497. "content": {
  498. "application/json": {
  499. "schema": {
  500. "type": "object",
  501. "required": [
  502. "ocs"
  503. ],
  504. "properties": {
  505. "ocs": {
  506. "type": "object",
  507. "required": [
  508. "meta",
  509. "data"
  510. ],
  511. "properties": {
  512. "meta": {
  513. "$ref": "#/components/schemas/OCSMeta"
  514. },
  515. "data": {
  516. "type": "object",
  517. "required": [
  518. "message"
  519. ],
  520. "properties": {
  521. "message": {
  522. "type": "string"
  523. }
  524. }
  525. }
  526. }
  527. }
  528. }
  529. }
  530. }
  531. }
  532. },
  533. "401": {
  534. "description": "Current user is not logged in",
  535. "content": {
  536. "application/json": {
  537. "schema": {
  538. "type": "object",
  539. "required": [
  540. "ocs"
  541. ],
  542. "properties": {
  543. "ocs": {
  544. "type": "object",
  545. "required": [
  546. "meta",
  547. "data"
  548. ],
  549. "properties": {
  550. "meta": {
  551. "$ref": "#/components/schemas/OCSMeta"
  552. },
  553. "data": {}
  554. }
  555. }
  556. }
  557. }
  558. }
  559. }
  560. },
  561. "403": {
  562. "description": "Logged in account must be an admin",
  563. "content": {
  564. "application/json": {
  565. "schema": {
  566. "type": "object",
  567. "required": [
  568. "ocs"
  569. ],
  570. "properties": {
  571. "ocs": {
  572. "type": "object",
  573. "required": [
  574. "meta",
  575. "data"
  576. ],
  577. "properties": {
  578. "meta": {
  579. "$ref": "#/components/schemas/OCSMeta"
  580. },
  581. "data": {}
  582. }
  583. }
  584. }
  585. }
  586. }
  587. }
  588. }
  589. }
  590. }
  591. }
  592. },
  593. "tags": [
  594. {
  595. "name": "ocs_authapi",
  596. "description": "Class OCSAuthAPI OCS API end-points to exchange shared secret between two connected Nextclouds"
  597. }
  598. ]
  599. }