openapi.json 21 KB

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