1
0

openapi.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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 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/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. "required": true,
  89. "schema": {
  90. "type": "string",
  91. "default": "true"
  92. }
  93. }
  94. ],
  95. "responses": {
  96. "200": {
  97. "description": "Shared secret returned",
  98. "content": {
  99. "application/json": {
  100. "schema": {
  101. "type": "object",
  102. "required": [
  103. "ocs"
  104. ],
  105. "properties": {
  106. "ocs": {
  107. "type": "object",
  108. "required": [
  109. "meta",
  110. "data"
  111. ],
  112. "properties": {
  113. "meta": {
  114. "$ref": "#/components/schemas/OCSMeta"
  115. },
  116. "data": {
  117. "type": "object",
  118. "required": [
  119. "sharedSecret"
  120. ],
  121. "properties": {
  122. "sharedSecret": {
  123. "type": "string"
  124. }
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. }
  132. }
  133. },
  134. "403": {
  135. "description": "Getting shared secret is not allowed",
  136. "content": {
  137. "text/plain": {
  138. "schema": {
  139. "type": "string"
  140. }
  141. }
  142. }
  143. }
  144. }
  145. }
  146. },
  147. "/ocs/v2.php/apps/federation/api/v1/request-shared-secret": {
  148. "post": {
  149. "operationId": "ocs_authapi-request-shared-secret-legacy",
  150. "summary": "Request received to ask remote server for a shared secret, for legacy end-points",
  151. "tags": [
  152. "ocs_authapi"
  153. ],
  154. "security": [
  155. {},
  156. {
  157. "bearer_auth": []
  158. },
  159. {
  160. "basic_auth": []
  161. }
  162. ],
  163. "parameters": [
  164. {
  165. "name": "url",
  166. "in": "query",
  167. "description": "URL of the server",
  168. "required": true,
  169. "schema": {
  170. "type": "string"
  171. }
  172. },
  173. {
  174. "name": "token",
  175. "in": "query",
  176. "description": "Token of the server",
  177. "required": true,
  178. "schema": {
  179. "type": "string"
  180. }
  181. },
  182. {
  183. "name": "OCS-APIRequest",
  184. "in": "header",
  185. "required": true,
  186. "schema": {
  187. "type": "string",
  188. "default": "true"
  189. }
  190. }
  191. ],
  192. "responses": {
  193. "200": {
  194. "description": "Shared secret requested successfully",
  195. "content": {
  196. "application/json": {
  197. "schema": {
  198. "type": "object",
  199. "required": [
  200. "ocs"
  201. ],
  202. "properties": {
  203. "ocs": {
  204. "type": "object",
  205. "required": [
  206. "meta",
  207. "data"
  208. ],
  209. "properties": {
  210. "meta": {
  211. "$ref": "#/components/schemas/OCSMeta"
  212. },
  213. "data": {}
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. },
  221. "403": {
  222. "description": "Requesting shared secret is not allowed",
  223. "content": {
  224. "text/plain": {
  225. "schema": {
  226. "type": "string"
  227. }
  228. }
  229. }
  230. }
  231. }
  232. }
  233. },
  234. "/ocs/v2.php/cloud/shared-secret": {
  235. "get": {
  236. "operationId": "ocs_authapi-get-shared-secret",
  237. "summary": "Create shared secret and return it",
  238. "tags": [
  239. "ocs_authapi"
  240. ],
  241. "security": [
  242. {},
  243. {
  244. "bearer_auth": []
  245. },
  246. {
  247. "basic_auth": []
  248. }
  249. ],
  250. "parameters": [
  251. {
  252. "name": "url",
  253. "in": "query",
  254. "description": "URL of the server",
  255. "required": true,
  256. "schema": {
  257. "type": "string"
  258. }
  259. },
  260. {
  261. "name": "token",
  262. "in": "query",
  263. "description": "Token of the server",
  264. "required": true,
  265. "schema": {
  266. "type": "string"
  267. }
  268. },
  269. {
  270. "name": "OCS-APIRequest",
  271. "in": "header",
  272. "required": true,
  273. "schema": {
  274. "type": "string",
  275. "default": "true"
  276. }
  277. }
  278. ],
  279. "responses": {
  280. "200": {
  281. "description": "Shared secret returned",
  282. "content": {
  283. "application/json": {
  284. "schema": {
  285. "type": "object",
  286. "required": [
  287. "ocs"
  288. ],
  289. "properties": {
  290. "ocs": {
  291. "type": "object",
  292. "required": [
  293. "meta",
  294. "data"
  295. ],
  296. "properties": {
  297. "meta": {
  298. "$ref": "#/components/schemas/OCSMeta"
  299. },
  300. "data": {
  301. "type": "object",
  302. "required": [
  303. "sharedSecret"
  304. ],
  305. "properties": {
  306. "sharedSecret": {
  307. "type": "string"
  308. }
  309. }
  310. }
  311. }
  312. }
  313. }
  314. }
  315. }
  316. }
  317. },
  318. "403": {
  319. "description": "Getting shared secret is not allowed",
  320. "content": {
  321. "text/plain": {
  322. "schema": {
  323. "type": "string"
  324. }
  325. }
  326. }
  327. }
  328. }
  329. },
  330. "post": {
  331. "operationId": "ocs_authapi-request-shared-secret",
  332. "summary": "Request received to ask remote server for a shared secret",
  333. "tags": [
  334. "ocs_authapi"
  335. ],
  336. "security": [
  337. {},
  338. {
  339. "bearer_auth": []
  340. },
  341. {
  342. "basic_auth": []
  343. }
  344. ],
  345. "parameters": [
  346. {
  347. "name": "url",
  348. "in": "query",
  349. "description": "URL of the server",
  350. "required": true,
  351. "schema": {
  352. "type": "string"
  353. }
  354. },
  355. {
  356. "name": "token",
  357. "in": "query",
  358. "description": "Token of the server",
  359. "required": true,
  360. "schema": {
  361. "type": "string"
  362. }
  363. },
  364. {
  365. "name": "OCS-APIRequest",
  366. "in": "header",
  367. "required": true,
  368. "schema": {
  369. "type": "string",
  370. "default": "true"
  371. }
  372. }
  373. ],
  374. "responses": {
  375. "200": {
  376. "description": "Shared secret requested successfully",
  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. "403": {
  404. "description": "Requesting shared secret is not allowed",
  405. "content": {
  406. "text/plain": {
  407. "schema": {
  408. "type": "string"
  409. }
  410. }
  411. }
  412. }
  413. }
  414. }
  415. }
  416. },
  417. "tags": [
  418. {
  419. "name": "ocs_authapi",
  420. "description": "Class OCSAuthAPI\nOCS API end-points to exchange shared secret between two connected Nextclouds"
  421. }
  422. ]
  423. }