openapi.json 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. {
  2. "openapi": "3.0.3",
  3. "info": {
  4. "title": "federation",
  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/api/v1/shared-secret": {
  51. "get": {
  52. "operationId": "ocs_authapi-get-shared-secret-legacy",
  53. "summary": "Create shared secret and return it, for legacy end-points",
  54. "tags": [
  55. "ocs_authapi"
  56. ],
  57. "security": [
  58. {},
  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. "token"
  75. ],
  76. "properties": {
  77. "url": {
  78. "type": "string",
  79. "description": "URL of the server"
  80. },
  81. "token": {
  82. "type": "string",
  83. "description": "Token of the server"
  84. }
  85. }
  86. }
  87. }
  88. }
  89. },
  90. "parameters": [
  91. {
  92. "name": "OCS-APIRequest",
  93. "in": "header",
  94. "description": "Required to be true for the API request to pass",
  95. "required": true,
  96. "schema": {
  97. "type": "boolean",
  98. "default": true
  99. }
  100. }
  101. ],
  102. "responses": {
  103. "200": {
  104. "description": "Shared secret returned",
  105. "content": {
  106. "application/json": {
  107. "schema": {
  108. "type": "object",
  109. "required": [
  110. "ocs"
  111. ],
  112. "properties": {
  113. "ocs": {
  114. "type": "object",
  115. "required": [
  116. "meta",
  117. "data"
  118. ],
  119. "properties": {
  120. "meta": {
  121. "$ref": "#/components/schemas/OCSMeta"
  122. },
  123. "data": {
  124. "type": "object",
  125. "required": [
  126. "sharedSecret"
  127. ],
  128. "properties": {
  129. "sharedSecret": {
  130. "type": "string"
  131. }
  132. }
  133. }
  134. }
  135. }
  136. }
  137. }
  138. }
  139. }
  140. },
  141. "403": {
  142. "description": "Getting shared secret is not allowed",
  143. "content": {
  144. "application/json": {
  145. "schema": {
  146. "type": "object",
  147. "required": [
  148. "ocs"
  149. ],
  150. "properties": {
  151. "ocs": {
  152. "type": "object",
  153. "required": [
  154. "meta",
  155. "data"
  156. ],
  157. "properties": {
  158. "meta": {
  159. "$ref": "#/components/schemas/OCSMeta"
  160. },
  161. "data": {}
  162. }
  163. }
  164. }
  165. }
  166. }
  167. }
  168. }
  169. }
  170. }
  171. },
  172. "/ocs/v2.php/apps/federation/api/v1/request-shared-secret": {
  173. "post": {
  174. "operationId": "ocs_authapi-request-shared-secret-legacy",
  175. "summary": "Request received to ask remote server for a shared secret, for legacy end-points",
  176. "tags": [
  177. "ocs_authapi"
  178. ],
  179. "security": [
  180. {},
  181. {
  182. "bearer_auth": []
  183. },
  184. {
  185. "basic_auth": []
  186. }
  187. ],
  188. "requestBody": {
  189. "required": true,
  190. "content": {
  191. "application/json": {
  192. "schema": {
  193. "type": "object",
  194. "required": [
  195. "url",
  196. "token"
  197. ],
  198. "properties": {
  199. "url": {
  200. "type": "string",
  201. "description": "URL of the server"
  202. },
  203. "token": {
  204. "type": "string",
  205. "description": "Token of the server"
  206. }
  207. }
  208. }
  209. }
  210. }
  211. },
  212. "parameters": [
  213. {
  214. "name": "OCS-APIRequest",
  215. "in": "header",
  216. "description": "Required to be true for the API request to pass",
  217. "required": true,
  218. "schema": {
  219. "type": "boolean",
  220. "default": true
  221. }
  222. }
  223. ],
  224. "responses": {
  225. "200": {
  226. "description": "Shared secret requested successfully",
  227. "content": {
  228. "application/json": {
  229. "schema": {
  230. "type": "object",
  231. "required": [
  232. "ocs"
  233. ],
  234. "properties": {
  235. "ocs": {
  236. "type": "object",
  237. "required": [
  238. "meta",
  239. "data"
  240. ],
  241. "properties": {
  242. "meta": {
  243. "$ref": "#/components/schemas/OCSMeta"
  244. },
  245. "data": {}
  246. }
  247. }
  248. }
  249. }
  250. }
  251. }
  252. },
  253. "403": {
  254. "description": "Requesting shared secret is not allowed",
  255. "content": {
  256. "application/json": {
  257. "schema": {
  258. "type": "object",
  259. "required": [
  260. "ocs"
  261. ],
  262. "properties": {
  263. "ocs": {
  264. "type": "object",
  265. "required": [
  266. "meta",
  267. "data"
  268. ],
  269. "properties": {
  270. "meta": {
  271. "$ref": "#/components/schemas/OCSMeta"
  272. },
  273. "data": {}
  274. }
  275. }
  276. }
  277. }
  278. }
  279. }
  280. }
  281. }
  282. }
  283. },
  284. "/ocs/v2.php/cloud/shared-secret": {
  285. "get": {
  286. "operationId": "ocs_authapi-get-shared-secret",
  287. "summary": "Create shared secret and return it",
  288. "tags": [
  289. "ocs_authapi"
  290. ],
  291. "security": [
  292. {},
  293. {
  294. "bearer_auth": []
  295. },
  296. {
  297. "basic_auth": []
  298. }
  299. ],
  300. "requestBody": {
  301. "required": true,
  302. "content": {
  303. "application/json": {
  304. "schema": {
  305. "type": "object",
  306. "required": [
  307. "url",
  308. "token"
  309. ],
  310. "properties": {
  311. "url": {
  312. "type": "string",
  313. "description": "URL of the server"
  314. },
  315. "token": {
  316. "type": "string",
  317. "description": "Token of the server"
  318. }
  319. }
  320. }
  321. }
  322. }
  323. },
  324. "parameters": [
  325. {
  326. "name": "OCS-APIRequest",
  327. "in": "header",
  328. "description": "Required to be true for the API request to pass",
  329. "required": true,
  330. "schema": {
  331. "type": "boolean",
  332. "default": true
  333. }
  334. }
  335. ],
  336. "responses": {
  337. "200": {
  338. "description": "Shared secret returned",
  339. "content": {
  340. "application/json": {
  341. "schema": {
  342. "type": "object",
  343. "required": [
  344. "ocs"
  345. ],
  346. "properties": {
  347. "ocs": {
  348. "type": "object",
  349. "required": [
  350. "meta",
  351. "data"
  352. ],
  353. "properties": {
  354. "meta": {
  355. "$ref": "#/components/schemas/OCSMeta"
  356. },
  357. "data": {
  358. "type": "object",
  359. "required": [
  360. "sharedSecret"
  361. ],
  362. "properties": {
  363. "sharedSecret": {
  364. "type": "string"
  365. }
  366. }
  367. }
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. },
  375. "403": {
  376. "description": "Getting shared secret is not allowed",
  377. "content": {
  378. "application/json": {
  379. "schema": {
  380. "type": "object",
  381. "required": [
  382. "ocs"
  383. ],
  384. "properties": {
  385. "ocs": {
  386. "type": "object",
  387. "required": [
  388. "meta",
  389. "data"
  390. ],
  391. "properties": {
  392. "meta": {
  393. "$ref": "#/components/schemas/OCSMeta"
  394. },
  395. "data": {}
  396. }
  397. }
  398. }
  399. }
  400. }
  401. }
  402. }
  403. }
  404. },
  405. "post": {
  406. "operationId": "ocs_authapi-request-shared-secret",
  407. "summary": "Request received to ask remote server for a shared secret",
  408. "tags": [
  409. "ocs_authapi"
  410. ],
  411. "security": [
  412. {},
  413. {
  414. "bearer_auth": []
  415. },
  416. {
  417. "basic_auth": []
  418. }
  419. ],
  420. "requestBody": {
  421. "required": true,
  422. "content": {
  423. "application/json": {
  424. "schema": {
  425. "type": "object",
  426. "required": [
  427. "url",
  428. "token"
  429. ],
  430. "properties": {
  431. "url": {
  432. "type": "string",
  433. "description": "URL of the server"
  434. },
  435. "token": {
  436. "type": "string",
  437. "description": "Token of the server"
  438. }
  439. }
  440. }
  441. }
  442. }
  443. },
  444. "parameters": [
  445. {
  446. "name": "OCS-APIRequest",
  447. "in": "header",
  448. "description": "Required to be true for the API request to pass",
  449. "required": true,
  450. "schema": {
  451. "type": "boolean",
  452. "default": true
  453. }
  454. }
  455. ],
  456. "responses": {
  457. "200": {
  458. "description": "Shared secret requested successfully",
  459. "content": {
  460. "application/json": {
  461. "schema": {
  462. "type": "object",
  463. "required": [
  464. "ocs"
  465. ],
  466. "properties": {
  467. "ocs": {
  468. "type": "object",
  469. "required": [
  470. "meta",
  471. "data"
  472. ],
  473. "properties": {
  474. "meta": {
  475. "$ref": "#/components/schemas/OCSMeta"
  476. },
  477. "data": {}
  478. }
  479. }
  480. }
  481. }
  482. }
  483. }
  484. },
  485. "403": {
  486. "description": "Requesting shared secret is not allowed",
  487. "content": {
  488. "application/json": {
  489. "schema": {
  490. "type": "object",
  491. "required": [
  492. "ocs"
  493. ],
  494. "properties": {
  495. "ocs": {
  496. "type": "object",
  497. "required": [
  498. "meta",
  499. "data"
  500. ],
  501. "properties": {
  502. "meta": {
  503. "$ref": "#/components/schemas/OCSMeta"
  504. },
  505. "data": {}
  506. }
  507. }
  508. }
  509. }
  510. }
  511. }
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "tags": [
  518. {
  519. "name": "ocs_authapi",
  520. "description": "Class OCSAuthAPI\nOCS API end-points to exchange shared secret between two connected Nextclouds"
  521. }
  522. ]
  523. }