@gitpod/gitpod-protocol 0.1.5-sh-jupyter.0 → 0.1.5-siddhant-k-code-allow-github-prebuilds-10358.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/data/gitpod-schema.json +163 -74
  2. package/lib/accounting-protocol.d.ts +163 -0
  3. package/lib/accounting-protocol.d.ts.map +1 -0
  4. package/lib/accounting-protocol.js +111 -0
  5. package/lib/accounting-protocol.js.map +1 -0
  6. package/lib/admin-protocol.d.ts +51 -6
  7. package/lib/admin-protocol.d.ts.map +1 -1
  8. package/lib/admin-protocol.js +17 -2
  9. package/lib/admin-protocol.js.map +1 -1
  10. package/lib/analytics.d.ts +44 -0
  11. package/lib/analytics.d.ts.map +1 -0
  12. package/lib/analytics.js +10 -0
  13. package/lib/analytics.js.map +1 -0
  14. package/lib/attribution.d.ts +24 -0
  15. package/lib/attribution.d.ts.map +1 -0
  16. package/lib/attribution.js +54 -0
  17. package/lib/attribution.js.map +1 -0
  18. package/lib/auth.d.ts +25 -0
  19. package/lib/auth.d.ts.map +1 -0
  20. package/lib/auth.js +16 -0
  21. package/lib/auth.js.map +1 -0
  22. package/lib/billing-mode.d.ts +45 -0
  23. package/lib/billing-mode.d.ts.map +1 -0
  24. package/lib/billing-mode.js +44 -0
  25. package/lib/billing-mode.js.map +1 -0
  26. package/lib/blocked-repositories-protocol.d.ts +13 -0
  27. package/lib/blocked-repositories-protocol.d.ts.map +1 -0
  28. package/lib/blocked-repositories-protocol.js +8 -0
  29. package/lib/blocked-repositories-protocol.js.map +1 -0
  30. package/lib/context-url.d.ts +30 -0
  31. package/lib/context-url.d.ts.map +1 -0
  32. package/lib/context-url.js +100 -0
  33. package/lib/context-url.js.map +1 -0
  34. package/lib/context-url.spec.d.ts +12 -0
  35. package/lib/context-url.spec.d.ts.map +1 -0
  36. package/lib/context-url.spec.js +81 -0
  37. package/lib/context-url.spec.js.map +1 -0
  38. package/lib/encryption/container-module.d.ts +2 -2
  39. package/lib/encryption/container-module.d.ts.map +1 -1
  40. package/lib/encryption/container-module.js +8 -6
  41. package/lib/encryption/container-module.js.map +1 -1
  42. package/lib/encryption/encryption-engine.d.ts +2 -2
  43. package/lib/encryption/encryption-engine.d.ts.map +1 -1
  44. package/lib/encryption/encryption-engine.js +28 -28
  45. package/lib/encryption/encryption-engine.js.map +1 -1
  46. package/lib/encryption/encryption-engine.spec.d.ts +3 -3
  47. package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
  48. package/lib/encryption/encryption-engine.spec.js +32 -39
  49. package/lib/encryption/encryption-engine.spec.js.map +1 -1
  50. package/lib/encryption/encryption-service.d.ts +2 -2
  51. package/lib/encryption/encryption-service.d.ts.map +1 -1
  52. package/lib/encryption/encryption-service.js +33 -46
  53. package/lib/encryption/encryption-service.js.map +1 -1
  54. package/lib/encryption/key-provider.d.ts +3 -3
  55. package/lib/encryption/key-provider.d.ts.map +1 -1
  56. package/lib/encryption/key-provider.js +34 -40
  57. package/lib/encryption/key-provider.js.map +1 -1
  58. package/lib/env.d.ts +2 -8
  59. package/lib/env.d.ts.map +1 -1
  60. package/lib/env.js +10 -29
  61. package/lib/env.js.map +1 -1
  62. package/lib/experiments/always-default.d.ts +8 -0
  63. package/lib/experiments/always-default.d.ts.map +1 -0
  64. package/lib/experiments/always-default.js +20 -0
  65. package/lib/experiments/always-default.js.map +1 -0
  66. package/lib/experiments/configcat-server.d.ts +10 -0
  67. package/lib/experiments/configcat-server.d.ts.map +1 -0
  68. package/lib/experiments/configcat-server.js +37 -0
  69. package/lib/experiments/configcat-server.js.map +1 -0
  70. package/lib/experiments/configcat.d.ts +21 -0
  71. package/lib/experiments/configcat.d.ts.map +1 -0
  72. package/lib/experiments/configcat.js +51 -0
  73. package/lib/experiments/configcat.js.map +1 -0
  74. package/lib/experiments/types.d.ts +22 -0
  75. package/lib/experiments/types.d.ts.map +1 -0
  76. package/lib/experiments/types.js +10 -0
  77. package/lib/experiments/types.js.map +1 -0
  78. package/lib/frontend-dashboard-service.d.ts +90 -0
  79. package/lib/frontend-dashboard-service.d.ts.map +1 -0
  80. package/lib/frontend-dashboard-service.js +49 -0
  81. package/lib/frontend-dashboard-service.js.map +1 -0
  82. package/lib/gitpod-file-parser.d.ts +2 -2
  83. package/lib/gitpod-file-parser.d.ts.map +1 -1
  84. package/lib/gitpod-file-parser.js +29 -44
  85. package/lib/gitpod-file-parser.js.map +1 -1
  86. package/lib/gitpod-file-parser.spec.d.ts +2 -2
  87. package/lib/gitpod-file-parser.spec.js +147 -144
  88. package/lib/gitpod-file-parser.spec.js.map +1 -1
  89. package/lib/gitpod-service.d.ts +241 -50
  90. package/lib/gitpod-service.d.ts.map +1 -1
  91. package/lib/gitpod-service.js +275 -123
  92. package/lib/gitpod-service.js.map +1 -1
  93. package/lib/headless-workspace-log.d.ts +11 -13
  94. package/lib/headless-workspace-log.d.ts.map +1 -1
  95. package/lib/headless-workspace-log.js +8 -9
  96. package/lib/headless-workspace-log.js.map +1 -1
  97. package/lib/ide-frontend-service.d.ts +26 -0
  98. package/lib/ide-frontend-service.d.ts.map +1 -0
  99. package/lib/ide-frontend-service.js +8 -0
  100. package/lib/ide-frontend-service.js.map +1 -0
  101. package/lib/ide-protocol.d.ts +126 -0
  102. package/lib/ide-protocol.d.ts.map +1 -0
  103. package/lib/ide-protocol.js +18 -0
  104. package/lib/ide-protocol.js.map +1 -0
  105. package/lib/index.d.ts +18 -12
  106. package/lib/index.d.ts.map +1 -1
  107. package/lib/index.js +28 -13
  108. package/lib/index.js.map +1 -1
  109. package/lib/installation-admin-protocol.d.ts +30 -0
  110. package/lib/installation-admin-protocol.d.ts.map +1 -0
  111. package/lib/installation-admin-protocol.js +31 -0
  112. package/lib/installation-admin-protocol.js.map +1 -0
  113. package/lib/license-protocol.d.ts +9 -2
  114. package/lib/license-protocol.d.ts.map +1 -1
  115. package/lib/license-protocol.js +3 -2
  116. package/lib/license-protocol.js.map +1 -1
  117. package/lib/messaging/browser/connection.d.ts +6 -4
  118. package/lib/messaging/browser/connection.d.ts.map +1 -1
  119. package/lib/messaging/browser/connection.js +188 -48
  120. package/lib/messaging/browser/connection.js.map +1 -1
  121. package/lib/messaging/browser/window-connection.d.ts +9 -4
  122. package/lib/messaging/browser/window-connection.d.ts.map +1 -1
  123. package/lib/messaging/browser/window-connection.js +48 -59
  124. package/lib/messaging/browser/window-connection.js.map +1 -1
  125. package/lib/messaging/client-call-metrics.d.ts +21 -0
  126. package/lib/messaging/client-call-metrics.d.ts.map +1 -0
  127. package/lib/messaging/client-call-metrics.js +95 -0
  128. package/lib/messaging/client-call-metrics.js.map +1 -0
  129. package/lib/messaging/error.d.ts +17 -4
  130. package/lib/messaging/error.d.ts.map +1 -1
  131. package/lib/messaging/error.js +34 -7
  132. package/lib/messaging/error.js.map +1 -1
  133. package/lib/messaging/handler.d.ts +10 -0
  134. package/lib/messaging/handler.d.ts.map +1 -1
  135. package/lib/messaging/handler.js +2 -1
  136. package/lib/messaging/handler.js.map +1 -1
  137. package/lib/messaging/node/connection.d.ts +1 -17
  138. package/lib/messaging/node/connection.d.ts.map +1 -1
  139. package/lib/messaging/node/connection.js +24 -59
  140. package/lib/messaging/node/connection.js.map +1 -1
  141. package/lib/messaging/proxy-factory.d.ts +3 -1
  142. package/lib/messaging/proxy-factory.d.ts.map +1 -1
  143. package/lib/messaging/proxy-factory.js +76 -162
  144. package/lib/messaging/proxy-factory.js.map +1 -1
  145. package/lib/oss-allowlist.d.ts +14 -0
  146. package/lib/oss-allowlist.d.ts.map +1 -0
  147. package/lib/oss-allowlist.js +8 -0
  148. package/lib/oss-allowlist.js.map +1 -0
  149. package/lib/payment-protocol.d.ts +18 -0
  150. package/lib/payment-protocol.d.ts.map +1 -0
  151. package/lib/payment-protocol.js +13 -0
  152. package/lib/payment-protocol.js.map +1 -0
  153. package/lib/permission.d.ts +26 -15
  154. package/lib/permission.d.ts.map +1 -1
  155. package/lib/permission.js +50 -36
  156. package/lib/permission.js.map +1 -1
  157. package/lib/plans.d.ts +211 -0
  158. package/lib/plans.d.ts.map +1 -0
  159. package/lib/plans.js +609 -0
  160. package/lib/plans.js.map +1 -0
  161. package/lib/protocol.d.ts +300 -112
  162. package/lib/protocol.d.ts.map +1 -1
  163. package/lib/protocol.js +393 -201
  164. package/lib/protocol.js.map +1 -1
  165. package/lib/protocol.spec.d.ts +7 -0
  166. package/lib/protocol.spec.d.ts.map +1 -0
  167. package/lib/protocol.spec.js +127 -0
  168. package/lib/protocol.spec.js.map +1 -0
  169. package/lib/snapshot-url.d.ts +14 -0
  170. package/lib/snapshot-url.d.ts.map +1 -0
  171. package/lib/snapshot-url.js +26 -0
  172. package/lib/snapshot-url.js.map +1 -0
  173. package/lib/snapshot-url.spec.d.ts +7 -0
  174. package/lib/snapshot-url.spec.d.ts.map +1 -0
  175. package/lib/snapshot-url.spec.js +41 -0
  176. package/lib/snapshot-url.spec.js.map +1 -0
  177. package/lib/team-subscription-protocol.d.ts +92 -0
  178. package/lib/team-subscription-protocol.d.ts.map +1 -0
  179. package/lib/team-subscription-protocol.js +78 -0
  180. package/lib/team-subscription-protocol.js.map +1 -0
  181. package/lib/teams-projects-protocol.d.ts +136 -0
  182. package/lib/teams-projects-protocol.d.ts.map +1 -0
  183. package/lib/teams-projects-protocol.js +37 -0
  184. package/lib/teams-projects-protocol.js.map +1 -0
  185. package/lib/typings/globals.d.ts +4 -3
  186. package/lib/typings/globals.d.ts.map +1 -1
  187. package/lib/typings/globals.js +2 -2
  188. package/lib/usage.d.ts +73 -0
  189. package/lib/usage.d.ts.map +1 -0
  190. package/lib/usage.js +20 -0
  191. package/lib/usage.js.map +1 -0
  192. package/lib/util/analytics.d.ts +8 -0
  193. package/lib/util/analytics.d.ts.map +1 -0
  194. package/lib/util/analytics.js +88 -0
  195. package/lib/util/analytics.js.map +1 -0
  196. package/lib/util/async-iterator.d.ts +2 -2
  197. package/lib/util/async-iterator.d.ts.map +1 -1
  198. package/lib/util/async-iterator.js +60 -137
  199. package/lib/util/async-iterator.js.map +1 -1
  200. package/lib/util/cancelable.d.ts +2 -2
  201. package/lib/util/cancelable.js +20 -61
  202. package/lib/util/cancelable.js.map +1 -1
  203. package/lib/util/date-time.d.ts +2 -2
  204. package/lib/util/date-time.js +14 -13
  205. package/lib/util/date-time.js.map +1 -1
  206. package/lib/util/debug-app.d.ts +25 -0
  207. package/lib/util/debug-app.d.ts.map +1 -0
  208. package/lib/util/debug-app.js +100 -0
  209. package/lib/util/debug-app.js.map +1 -0
  210. package/lib/util/deep-partial.d.ts +2 -2
  211. package/lib/util/deep-partial.js +2 -2
  212. package/lib/util/deferred.d.ts +2 -2
  213. package/lib/util/deferred.js +13 -14
  214. package/lib/util/deferred.js.map +1 -1
  215. package/lib/util/disposable.d.ts +2 -2
  216. package/lib/util/disposable.d.ts.map +1 -1
  217. package/lib/util/disposable.js +28 -40
  218. package/lib/util/disposable.js.map +1 -1
  219. package/lib/util/event.d.ts +1 -1
  220. package/lib/util/event.d.ts.map +1 -1
  221. package/lib/util/event.js +64 -77
  222. package/lib/util/event.js.map +1 -1
  223. package/lib/util/garbage-collected-cache.d.ts +3 -2
  224. package/lib/util/garbage-collected-cache.d.ts.map +1 -1
  225. package/lib/util/garbage-collected-cache.js +35 -49
  226. package/lib/util/garbage-collected-cache.js.map +1 -1
  227. package/lib/util/generate-workspace-id.d.ts +9 -0
  228. package/lib/util/generate-workspace-id.d.ts.map +1 -0
  229. package/lib/util/generate-workspace-id.js +491 -0
  230. package/lib/util/generate-workspace-id.js.map +1 -0
  231. package/lib/util/generate-workspace-id.spec.d.ts +7 -0
  232. package/lib/util/generate-workspace-id.spec.d.ts.map +1 -0
  233. package/lib/util/generate-workspace-id.spec.js +98 -0
  234. package/lib/util/generate-workspace-id.spec.js.map +1 -0
  235. package/lib/util/gitpod-cookie.d.ts +20 -0
  236. package/lib/util/gitpod-cookie.d.ts.map +1 -0
  237. package/lib/util/gitpod-cookie.js +41 -0
  238. package/lib/util/gitpod-cookie.js.map +1 -0
  239. package/lib/util/gitpod-host-url.d.ts +20 -7
  240. package/lib/util/gitpod-host-url.d.ts.map +1 -1
  241. package/lib/util/gitpod-host-url.js +146 -85
  242. package/lib/util/gitpod-host-url.js.map +1 -1
  243. package/lib/util/gitpod-host-url.spec.d.ts +16 -0
  244. package/lib/util/gitpod-host-url.spec.d.ts.map +1 -0
  245. package/lib/util/gitpod-host-url.spec.js +134 -0
  246. package/lib/util/gitpod-host-url.spec.js.map +1 -0
  247. package/lib/util/grpc.d.ts +35 -0
  248. package/lib/util/grpc.d.ts.map +1 -0
  249. package/lib/util/grpc.js +90 -0
  250. package/lib/util/grpc.js.map +1 -0
  251. package/lib/util/jaeger-client-types.d.ts +68 -0
  252. package/lib/util/jaeger-client-types.d.ts.map +1 -0
  253. package/lib/util/jaeger-client-types.js +8 -0
  254. package/lib/util/jaeger-client-types.js.map +1 -0
  255. package/lib/util/logging.d.ts +58 -35
  256. package/lib/util/logging.d.ts.map +1 -1
  257. package/lib/util/logging.js +144 -129
  258. package/lib/util/logging.js.map +1 -1
  259. package/lib/util/logging.spec.d.ts +7 -0
  260. package/lib/util/logging.spec.d.ts.map +1 -0
  261. package/lib/util/logging.spec.js +52 -0
  262. package/lib/util/logging.spec.js.map +1 -0
  263. package/lib/util/make-link.d.ts +2 -2
  264. package/lib/util/make-link.js +8 -7
  265. package/lib/util/make-link.js.map +1 -1
  266. package/lib/util/nice-grpc.d.ts +9 -0
  267. package/lib/util/nice-grpc.d.ts.map +1 -0
  268. package/lib/util/nice-grpc.js +121 -0
  269. package/lib/util/nice-grpc.js.map +1 -0
  270. package/lib/util/parse-workspace-id.d.ts +15 -5
  271. package/lib/util/parse-workspace-id.d.ts.map +1 -1
  272. package/lib/util/parse-workspace-id.js +39 -9
  273. package/lib/util/parse-workspace-id.js.map +1 -1
  274. package/lib/util/parse-workspace-id.spec.d.ts +10 -2
  275. package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
  276. package/lib/util/parse-workspace-id.spec.js +130 -49
  277. package/lib/util/parse-workspace-id.spec.js.map +1 -1
  278. package/lib/util/queue.d.ts +2 -2
  279. package/lib/util/queue.js +19 -57
  280. package/lib/util/queue.js.map +1 -1
  281. package/lib/util/queue.spec.d.ts +2 -2
  282. package/lib/util/queue.spec.js +149 -288
  283. package/lib/util/queue.spec.js.map +1 -1
  284. package/lib/util/repeat.d.ts +15 -0
  285. package/lib/util/repeat.d.ts.map +1 -0
  286. package/lib/util/repeat.js +55 -0
  287. package/lib/util/repeat.js.map +1 -0
  288. package/lib/util/semaphore.d.ts +2 -2
  289. package/lib/util/semaphore.d.ts.map +1 -1
  290. package/lib/util/semaphore.js +18 -48
  291. package/lib/util/semaphore.js.map +1 -1
  292. package/lib/util/skip-if.d.ts +2 -2
  293. package/lib/util/skip-if.d.ts.map +1 -1
  294. package/lib/util/skip-if.js +9 -8
  295. package/lib/util/skip-if.js.map +1 -1
  296. package/lib/util/timeutil.d.ts +4 -2
  297. package/lib/util/timeutil.d.ts.map +1 -1
  298. package/lib/util/timeutil.js +43 -18
  299. package/lib/util/timeutil.js.map +1 -1
  300. package/lib/util/timeutil.spec.d.ts +4 -2
  301. package/lib/util/timeutil.spec.d.ts.map +1 -1
  302. package/lib/util/timeutil.spec.js +57 -25
  303. package/lib/util/timeutil.spec.js.map +1 -1
  304. package/lib/util/tracing.d.ts +54 -8
  305. package/lib/util/tracing.d.ts.map +1 -1
  306. package/lib/util/tracing.js +200 -66
  307. package/lib/util/tracing.js.map +1 -1
  308. package/lib/util/tracing.spec.d.ts +7 -0
  309. package/lib/util/tracing.spec.d.ts.map +1 -0
  310. package/lib/util/tracing.spec.js +121 -0
  311. package/lib/util/tracing.spec.js.map +1 -0
  312. package/lib/util/workspace-port-authentication.d.ts +9 -9
  313. package/lib/util/workspace-port-authentication.d.ts.map +1 -1
  314. package/lib/util/workspace-port-authentication.js +13 -14
  315. package/lib/util/workspace-port-authentication.js.map +1 -1
  316. package/lib/webhook-event.d.ts +44 -0
  317. package/lib/webhook-event.d.ts.map +1 -0
  318. package/lib/webhook-event.js +8 -0
  319. package/lib/webhook-event.js.map +1 -0
  320. package/lib/workspace-class.d.ts +14 -0
  321. package/lib/workspace-class.d.ts.map +1 -0
  322. package/lib/workspace-class.js +8 -0
  323. package/lib/workspace-class.js.map +1 -0
  324. package/lib/workspace-cluster.d.ts +75 -0
  325. package/lib/workspace-cluster.d.ts.map +1 -0
  326. package/lib/workspace-cluster.js +31 -0
  327. package/lib/workspace-cluster.js.map +1 -0
  328. package/lib/workspace-instance.d.ts +51 -8
  329. package/lib/workspace-instance.d.ts.map +1 -1
  330. package/lib/workspace-instance.js +2 -2
  331. package/lib/wsready.d.ts +8 -2
  332. package/lib/wsready.d.ts.map +1 -1
  333. package/lib/wsready.js +4 -3
  334. package/lib/wsready.js.map +1 -1
  335. package/package.json +42 -18
  336. package/pkg-yarn.lock +24 -10
  337. package/provenance-bundle.jsonl +2 -0
  338. package/src/accounting-protocol.ts +244 -0
  339. package/src/admin-protocol.ts +96 -21
  340. package/src/analytics.ts +52 -0
  341. package/src/attribution.ts +63 -0
  342. package/src/auth.ts +27 -0
  343. package/src/billing-mode.ts +84 -0
  344. package/src/blocked-repositories-protocol.ts +13 -0
  345. package/src/context-url.spec.ts +49 -0
  346. package/src/context-url.ts +107 -0
  347. package/src/encryption/container-module.ts +4 -5
  348. package/src/encryption/encryption-engine.spec.ts +11 -10
  349. package/src/encryption/encryption-engine.ts +22 -18
  350. package/src/encryption/encryption-service.ts +6 -7
  351. package/src/encryption/key-provider.ts +18 -21
  352. package/src/env.ts +3 -26
  353. package/src/experiments/always-default.ts +24 -0
  354. package/src/experiments/configcat-server.ts +42 -0
  355. package/src/experiments/configcat.ts +56 -0
  356. package/src/experiments/types.ts +34 -0
  357. package/src/frontend-dashboard-service.ts +125 -0
  358. package/src/gitpod-file-parser.spec.ts +57 -63
  359. package/src/gitpod-file-parser.ts +18 -19
  360. package/src/gitpod-service.ts +534 -99
  361. package/src/headless-workspace-log.ts +14 -16
  362. package/src/ide-frontend-service.ts +28 -0
  363. package/src/ide-protocol.ts +147 -0
  364. package/src/index.ts +18 -12
  365. package/src/installation-admin-protocol.ts +45 -0
  366. package/src/license-protocol.ts +14 -8
  367. package/src/messaging/browser/connection.ts +202 -26
  368. package/src/messaging/browser/window-connection.ts +45 -29
  369. package/src/messaging/client-call-metrics.ts +94 -0
  370. package/src/messaging/error.ts +47 -10
  371. package/src/messaging/handler.ts +13 -1
  372. package/src/messaging/node/connection.ts +23 -70
  373. package/src/messaging/proxy-factory.ts +35 -34
  374. package/src/oss-allowlist.ts +15 -0
  375. package/src/payment-protocol.ts +20 -0
  376. package/src/permission.ts +53 -40
  377. package/src/plans.ts +683 -0
  378. package/src/protocol.spec.ts +97 -0
  379. package/src/protocol.ts +706 -299
  380. package/src/snapshot-url.spec.ts +27 -0
  381. package/src/snapshot-url.ts +27 -0
  382. package/src/team-subscription-protocol.ts +150 -0
  383. package/src/teams-projects-protocol.ts +177 -0
  384. package/src/typings/globals.ts +7 -5
  385. package/src/usage.ts +85 -0
  386. package/src/util/analytics.ts +109 -0
  387. package/src/util/async-iterator.ts +6 -7
  388. package/src/util/cancelable.ts +5 -5
  389. package/src/util/date-time.ts +10 -10
  390. package/src/util/debug-app.ts +81 -0
  391. package/src/util/deep-partial.ts +2 -2
  392. package/src/util/deferred.ts +8 -8
  393. package/src/util/disposable.ts +3 -6
  394. package/src/util/event.ts +9 -11
  395. package/src/util/garbage-collected-cache.ts +18 -10
  396. package/src/util/generate-workspace-id.spec.ts +58 -0
  397. package/src/util/generate-workspace-id.ts +481 -0
  398. package/src/util/gitpod-cookie.ts +38 -0
  399. package/src/util/gitpod-host-url.spec.ts +76 -0
  400. package/src/util/gitpod-host-url.ts +121 -38
  401. package/src/util/grpc.ts +107 -0
  402. package/src/util/jaeger-client-types.ts +102 -0
  403. package/src/util/logging.spec.ts +23 -0
  404. package/src/util/logging.ts +163 -73
  405. package/src/util/make-link.ts +8 -9
  406. package/src/util/nice-grpc.ts +96 -0
  407. package/src/util/parse-workspace-id.spec.ts +62 -12
  408. package/src/util/parse-workspace-id.ts +40 -10
  409. package/src/util/queue.spec.ts +30 -28
  410. package/src/util/queue.ts +2 -2
  411. package/src/util/repeat.ts +45 -0
  412. package/src/util/semaphore.ts +8 -10
  413. package/src/util/skip-if.ts +12 -9
  414. package/src/util/timeutil.spec.ts +42 -16
  415. package/src/util/timeutil.ts +33 -17
  416. package/src/util/tracing.spec.ts +88 -0
  417. package/src/util/tracing.ts +202 -33
  418. package/src/util/workspace-port-authentication.ts +12 -15
  419. package/src/webhook-event.ts +55 -0
  420. package/src/workspace-class.ts +14 -0
  421. package/src/workspace-cluster.ts +110 -0
  422. package/src/workspace-instance.ts +119 -35
  423. package/src/wsready.ts +11 -4
  424. package/data/builtin-theia-plugins.json +0 -362
  425. package/lib/email-protocol.d.ts +0 -49
  426. package/lib/email-protocol.d.ts.map +0 -1
  427. package/lib/email-protocol.js +0 -27
  428. package/lib/email-protocol.js.map +0 -1
  429. package/lib/messaging/connection-error-handler.d.ts +0 -27
  430. package/lib/messaging/connection-error-handler.d.ts.map +0 -1
  431. package/lib/messaging/connection-error-handler.js +0 -45
  432. package/lib/messaging/connection-error-handler.js.map +0 -1
  433. package/lib/theia-plugins.d.ts +0 -11
  434. package/lib/theia-plugins.d.ts.map +0 -1
  435. package/lib/theia-plugins.js +0 -8
  436. package/lib/theia-plugins.js.map +0 -1
  437. package/lib/util/repeater.d.ts +0 -22
  438. package/lib/util/repeater.d.ts.map +0 -1
  439. package/lib/util/repeater.js +0 -117
  440. package/lib/util/repeater.js.map +0 -1
  441. package/lib/util/safe-promise.d.ts +0 -11
  442. package/lib/util/safe-promise.d.ts.map +0 -1
  443. package/lib/util/safe-promise.js +0 -33
  444. package/lib/util/safe-promise.js.map +0 -1
  445. package/lib/util/without.d.ts +0 -7
  446. package/lib/util/without.d.ts.map +0 -1
  447. package/lib/util/without.js +0 -8
  448. package/lib/util/without.js.map +0 -1
  449. package/src/email-protocol.ts +0 -67
  450. package/src/messaging/connection-error-handler.ts +0 -62
  451. package/src/theia-plugins.ts +0 -11
  452. package/src/util/jaeger-client.d.ts +0 -105
  453. package/src/util/repeater.ts +0 -49
  454. package/src/util/safe-promise.ts +0 -26
  455. package/src/util/without.ts +0 -8
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
+ * Licensed under the GNU Affero General Public License (AGPL).
5
+ * See License.AGPL.txt in the project root for license information.
6
+ */
7
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12
+ };
13
+ var __metadata = (this && this.__metadata) || function (k, v) {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ContextUrlTest = void 0;
18
+ const chai = require("chai");
19
+ const mocha_typescript_1 = require("mocha-typescript");
20
+ const context_url_1 = require("./context-url");
21
+ const expect = chai.expect;
22
+ let ContextUrlTest = class ContextUrlTest {
23
+ parseContextUrl_withEnvVar() {
24
+ const actual = context_url_1.ContextURL.getNormalizedURL({
25
+ contextURL: "passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo",
26
+ context: {},
27
+ });
28
+ expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
29
+ expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
30
+ }
31
+ parseContextUrl_withEnvVar_withoutSchema() {
32
+ const actual = context_url_1.ContextURL.getNormalizedURL({
33
+ contextURL: "passedin=test%20value/github.com/gitpod-io/gitpod-test-repo",
34
+ context: {},
35
+ });
36
+ expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
37
+ expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
38
+ }
39
+ parseContextUrl_withEnvVar_sshUrl() {
40
+ const actual = context_url_1.ContextURL.getNormalizedURL({
41
+ contextURL: "passedin=test%20value/git@github.com:gitpod-io/gitpod-test-repo.git",
42
+ context: {},
43
+ });
44
+ expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
45
+ expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo.git");
46
+ }
47
+ parseContextUrl_badUrl() {
48
+ const actual = context_url_1.ContextURL.getNormalizedURL({ contextURL: "[Object object]", context: {} });
49
+ expect(actual).to.be.undefined;
50
+ }
51
+ };
52
+ __decorate([
53
+ mocha_typescript_1.test,
54
+ __metadata("design:type", Function),
55
+ __metadata("design:paramtypes", []),
56
+ __metadata("design:returntype", void 0)
57
+ ], ContextUrlTest.prototype, "parseContextUrl_withEnvVar", null);
58
+ __decorate([
59
+ mocha_typescript_1.test,
60
+ __metadata("design:type", Function),
61
+ __metadata("design:paramtypes", []),
62
+ __metadata("design:returntype", void 0)
63
+ ], ContextUrlTest.prototype, "parseContextUrl_withEnvVar_withoutSchema", null);
64
+ __decorate([
65
+ mocha_typescript_1.test,
66
+ __metadata("design:type", Function),
67
+ __metadata("design:paramtypes", []),
68
+ __metadata("design:returntype", void 0)
69
+ ], ContextUrlTest.prototype, "parseContextUrl_withEnvVar_sshUrl", null);
70
+ __decorate([
71
+ mocha_typescript_1.test,
72
+ __metadata("design:type", Function),
73
+ __metadata("design:paramtypes", []),
74
+ __metadata("design:returntype", void 0)
75
+ ], ContextUrlTest.prototype, "parseContextUrl_badUrl", null);
76
+ ContextUrlTest = __decorate([
77
+ mocha_typescript_1.suite
78
+ ], ContextUrlTest);
79
+ exports.ContextUrlTest = ContextUrlTest;
80
+ module.exports = new ContextUrlTest();
81
+ //# sourceMappingURL=context-url.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-url.spec.js","sourceRoot":"","sources":["../src/context-url.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,6BAA6B;AAC7B,uDAA+C;AAE/C,+CAA2C;AAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAK3B,IAAa,cAAc,GAA3B,MAAa,cAAc;IACV,0BAA0B;QACnC,MAAM,MAAM,GAAG,wBAAU,CAAC,gBAAgB,CAAC;YACvC,UAAU,EAAE,qEAAqE;YACjF,OAAO,EAAE,EAAE;SACE,CAAC,CAAC;QACnB,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACrE,CAAC;IAEY,wCAAwC;QACjD,MAAM,MAAM,GAAG,wBAAU,CAAC,gBAAgB,CAAC;YACvC,UAAU,EAAE,6DAA6D;YACzE,OAAO,EAAE,EAAE;SACE,CAAC,CAAC;QACnB,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACrE,CAAC;IAEY,iCAAiC;QAC1C,MAAM,MAAM,GAAG,wBAAU,CAAC,gBAAgB,CAAC;YACvC,UAAU,EAAE,qEAAqE;YACjF,OAAO,EAAE,EAAE;SACE,CAAC,CAAC;QACnB,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACzE,CAAC;IAEY,sBAAsB;QAC/B,MAAM,MAAM,GAAG,wBAAU,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,EAAE,EAAkB,CAAC,CAAC;QAC3G,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;IACnC,CAAC;CACJ,CAAA;AA/BS;IAAL,uBAAI;;;;gEAOJ;AAEK;IAAL,uBAAI;;;;8EAOJ;AAEK;IAAL,uBAAI;;;;uEAOJ;AAEK;IAAL,uBAAI;;;;4DAGJ;AA/BQ,cAAc;IAD1B,wBAAK;GACO,cAAc,CAgC1B;AAhCY,wCAAc;AAiC3B,MAAM,CAAC,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  import { interfaces } from "inversify";
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKvC;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,uBAMzC,CAAC"}
1
+ {"version":3,"file":"container-module.d.ts","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKvC;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,UAAU,CAAC,uBAKzC,CAAC"}
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- var key_provider_1 = require("./key-provider");
9
- var encryption_engine_1 = require("./encryption-engine");
10
- var encryption_service_1 = require("./encryption-service");
8
+ exports.encryptionModule = void 0;
9
+ const key_provider_1 = require("./key-provider");
10
+ const encryption_engine_1 = require("./encryption-engine");
11
+ const encryption_service_1 = require("./encryption-service");
11
12
  /**
12
13
  * User have to provide a binding for KeyProviderConfig!!!
13
14
  * Example:
@@ -18,9 +19,10 @@ var encryption_service_1 = require("./encryption-service");
18
19
  * };
19
20
  * }).inSingletonScope();
20
21
  */
21
- exports.encryptionModule = function (bind) {
22
+ const encryptionModule = (bind) => {
22
23
  bind(key_provider_1.KeyProvider).to(key_provider_1.KeyProviderImpl).inSingletonScope();
23
24
  bind(encryption_engine_1.EncryptionEngine).to(encryption_engine_1.EncryptionEngineImpl).inSingletonScope();
24
25
  bind(encryption_service_1.EncryptionService).to(encryption_service_1.EncryptionServiceImpl).inSingletonScope();
25
26
  };
27
+ exports.encryptionModule = encryptionModule;
26
28
  //# sourceMappingURL=container-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"container-module.js","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAGH,+CAA8D;AAC9D,yDAA6E;AAC7E,2DAAgF;AAEhF;;;;;;;;;GASG;AACU,QAAA,gBAAgB,GAAuC,UAAA,IAAI;IAEpE,IAAI,CAAC,0BAAW,CAAC,CAAC,EAAE,CAAC,8BAAe,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEzD,IAAI,CAAC,oCAAgB,CAAC,CAAC,EAAE,CAAC,wCAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnE,IAAI,CAAC,sCAAiB,CAAC,CAAC,EAAE,CAAC,0CAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACzE,CAAC,CAAC"}
1
+ {"version":3,"file":"container-module.js","sourceRoot":"","sources":["../../src/encryption/container-module.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,iDAA8D;AAC9D,2DAA6E;AAC7E,6DAAgF;AAEhF;;;;;;;;;GASG;AACI,MAAM,gBAAgB,GAAuC,CAAC,IAAI,EAAE,EAAE;IACzE,IAAI,CAAC,0BAAW,CAAC,CAAC,EAAE,CAAC,8BAAe,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEzD,IAAI,CAAC,oCAAgB,CAAC,CAAC,EAAE,CAAC,wCAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACnE,IAAI,CAAC,sCAAiB,CAAC,CAAC,EAAE,CAAC,0CAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACzE,CAAC,CAAC;AALW,QAAA,gBAAgB,oBAK3B"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  /// <reference types="node" />
7
7
  export interface KeyParams {
@@ -1 +1 @@
1
- {"version":3,"file":"encryption-engine.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-engine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAKH,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,aAAa;IAC1B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAA;CACvB;AAED,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;IAClD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9D;AAED;;;;;GAKG;AACF,qBACY,oBAAoB;IAC7B,QAAQ,CAAC,SAAS,iBAAiB;IACnC,QAAQ,CAAC,GAAG,YAAY;IAExB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAajD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;CAM7D"}
1
+ {"version":3,"file":"encryption-engine.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-engine.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAKH,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC1B,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC;IAClD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9D;AAED;;;;;GAKG;AACH,qBACa,oBAAoB;IAC7B,QAAQ,CAAC,SAAS,iBAAiB;IACnC,QAAQ,CAAC,GAAG,YAAY;IAExB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa;IAajD,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;CAU7D"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -11,42 +11,42 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
11
  return c > 3 && r && Object.defineProperty(target, key, r), r;
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- var crypto = require("crypto");
15
- var inversify_1 = require("inversify");
16
- exports.EncryptionEngine = Symbol('EncryptionEngine');
14
+ exports.EncryptionEngineImpl = exports.EncryptionEngine = void 0;
15
+ const crypto = require("crypto");
16
+ const inversify_1 = require("inversify");
17
+ exports.EncryptionEngine = Symbol("EncryptionEngine");
17
18
  /**
18
19
  * For starters, let's use aes-cbc-256 with:
19
20
  * - 16 bytes/128 bits IV (the size of an aes-256-cbc block)
20
21
  * - no salt, as we pass in a real key (no salting needed to turn a password into a key)
21
22
  * The implementation closely follows the exampes in https://nodejs.org/api/crypto.html.
22
23
  */
23
- var EncryptionEngineImpl = /** @class */ (function () {
24
- function EncryptionEngineImpl() {
25
- this.algorithm = 'aes-256-cbc';
26
- this.enc = 'base64';
24
+ let EncryptionEngineImpl = class EncryptionEngineImpl {
25
+ constructor() {
26
+ this.algorithm = "aes-256-cbc";
27
+ this.enc = "base64";
27
28
  }
28
- EncryptionEngineImpl.prototype.encrypt = function (data, key) {
29
- var iv = crypto.randomBytes(16);
30
- var cipher = crypto.createCipheriv(this.algorithm, key, iv);
31
- var encrypted = cipher.update(new Buffer(data, 'utf8'));
32
- var finalEncrypted = Buffer.concat([encrypted, cipher.final()]);
29
+ encrypt(data, key) {
30
+ const iv = crypto.randomBytes(16);
31
+ const cipher = crypto.createCipheriv(this.algorithm, key, iv);
32
+ const encrypted = cipher.update(Buffer.from(data, "utf8"));
33
+ const finalEncrypted = Buffer.concat([encrypted, cipher.final()]);
33
34
  return {
34
35
  data: finalEncrypted.toString(this.enc),
35
36
  keyParams: {
36
- iv: iv.toString(this.enc)
37
- }
37
+ iv: iv.toString(this.enc),
38
+ },
38
39
  };
39
- };
40
- EncryptionEngineImpl.prototype.decrypt = function (encryptedData, key) {
41
- var decipher = crypto.createDecipheriv(this.algorithm, key, new Buffer(encryptedData.keyParams.iv, this.enc));
42
- var decrypted = decipher.update(new Buffer(encryptedData.data, this.enc));
43
- var finalDecrypted = Buffer.concat([decrypted, decipher.final()]);
44
- return finalDecrypted.toString('utf8');
45
- };
46
- EncryptionEngineImpl = __decorate([
47
- inversify_1.injectable()
48
- ], EncryptionEngineImpl);
49
- return EncryptionEngineImpl;
50
- }());
40
+ }
41
+ decrypt(encryptedData, key) {
42
+ const decipher = crypto.createDecipheriv(this.algorithm, key, Buffer.from(encryptedData.keyParams.iv, this.enc));
43
+ let decrypted = decipher.update(Buffer.from(encryptedData.data, this.enc));
44
+ const finalDecrypted = Buffer.concat([decrypted, decipher.final()]);
45
+ return finalDecrypted.toString("utf8");
46
+ }
47
+ };
48
+ EncryptionEngineImpl = __decorate([
49
+ (0, inversify_1.injectable)()
50
+ ], EncryptionEngineImpl);
51
51
  exports.EncryptionEngineImpl = EncryptionEngineImpl;
52
52
  //# sourceMappingURL=encryption-engine.js.map
@@ -1 +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AAC,IAAI,CAAC,GAAG,CAAC;aAC5B;SACJ,CAAC;IACN,CAAC;IAED,OAAO,CAAC,aAA4B,EAAE,GAAW;QAC7C,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CACpC,IAAI,CAAC,SAAS,EACd,GAAG,EACH,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CACpD,CAAC;QACF,IAAI,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3E,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACpE,OAAO,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;CACJ,CAAA;AA3BY,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA2BhC;AA3BY,oDAAoB"}
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  declare class TestEncryptionEngineImpl {
7
- protected readonly testkey: string;
7
+ protected get testkey(): string;
8
8
  basicSymmetry(): void;
9
9
  }
10
10
  export declare const t: TestEncryptionEngineImpl;
@@ -1 +1 @@
1
- {"version":3,"file":"encryption-engine.spec.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,cAAa,wBAAwB;uBAEnB,OAAO;IAMf,aAAa;CAWtB;AACD,eAAO,MAAM,CAAC,0BAAiC,CAAC"}
1
+ {"version":3,"file":"encryption-engine.spec.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,cACM,wBAAwB;IAE1B,SAAS,KAAK,OAAO,WAIpB;IAEK,aAAa;CAWtB;AACD,eAAO,MAAM,CAAC,0BAAiC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -14,45 +14,38 @@ var __metadata = (this && this.__metadata) || function (k, v) {
14
14
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- var mocha_typescript_1 = require("mocha-typescript");
18
- var chai = require("chai");
19
- var path = require("path");
20
- var fs = require("fs");
21
- var encryption_engine_1 = require("./encryption-engine");
22
- var expect = chai.expect;
23
- var TestEncryptionEngineImpl = /** @class */ (function () {
24
- function TestEncryptionEngineImpl() {
17
+ exports.t = void 0;
18
+ const mocha_typescript_1 = require("mocha-typescript");
19
+ const chai = require("chai");
20
+ const path = require("path");
21
+ const fs = require("fs");
22
+ const encryption_engine_1 = require("./encryption-engine");
23
+ const expect = chai.expect;
24
+ let TestEncryptionEngineImpl = class TestEncryptionEngineImpl {
25
+ // Created with openssl rand -rand /dev/urandom -out key -base64 32
26
+ get testkey() {
27
+ const keyFilePath = path.resolve(__dirname, "../../test/fixtures/encryption/testkey");
28
+ const keyBuffer = fs.readFileSync(keyFilePath);
29
+ return keyBuffer.toString().trim();
25
30
  }
26
- Object.defineProperty(TestEncryptionEngineImpl.prototype, "testkey", {
27
- // Created with openssl rand -rand /dev/urandom -out key -base64 32
28
- get: function () {
29
- var keyFilePath = path.resolve(__dirname, '../../test/fixtures/encryption/testkey');
30
- var keyBuffer = fs.readFileSync(keyFilePath);
31
- return keyBuffer.toString().trim();
32
- },
33
- enumerable: true,
34
- configurable: true
35
- });
36
- ;
37
- TestEncryptionEngineImpl.prototype.basicSymmetry = function () {
38
- var plaintext = "12345678901234567890";
39
- var key = new Buffer(this.testkey, 'base64');
40
- var cut = new encryption_engine_1.EncryptionEngineImpl();
41
- var encryptedData = cut.encrypt(plaintext, key);
31
+ basicSymmetry() {
32
+ const plaintext = "12345678901234567890";
33
+ const key = Buffer.from(this.testkey, "base64");
34
+ const cut = new encryption_engine_1.EncryptionEngineImpl();
35
+ const encryptedData = cut.encrypt(plaintext, key);
42
36
  expect(encryptedData).to.be.not.undefined;
43
- var decryptedPlaintext = cut.decrypt(encryptedData, key);
37
+ const decryptedPlaintext = cut.decrypt(encryptedData, key);
44
38
  expect(decryptedPlaintext).equals(plaintext);
45
- };
46
- __decorate([
47
- mocha_typescript_1.test,
48
- __metadata("design:type", Function),
49
- __metadata("design:paramtypes", []),
50
- __metadata("design:returntype", void 0)
51
- ], TestEncryptionEngineImpl.prototype, "basicSymmetry", null);
52
- TestEncryptionEngineImpl = __decorate([
53
- mocha_typescript_1.suite
54
- ], TestEncryptionEngineImpl);
55
- return TestEncryptionEngineImpl;
56
- }());
39
+ }
40
+ };
41
+ __decorate([
42
+ mocha_typescript_1.test,
43
+ __metadata("design:type", Function),
44
+ __metadata("design:paramtypes", []),
45
+ __metadata("design:returntype", void 0)
46
+ ], TestEncryptionEngineImpl.prototype, "basicSymmetry", null);
47
+ TestEncryptionEngineImpl = __decorate([
48
+ mocha_typescript_1.suite
49
+ ], TestEncryptionEngineImpl);
57
50
  exports.t = new TestEncryptionEngineImpl();
58
51
  //# sourceMappingURL=encryption-engine.spec.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@ -1,7 +1,7 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  import { EncryptedData, EncryptionEngine } from "./encryption-engine";
7
7
  import { KeyProvider, KeyMetadata } from "./key-provider";
@@ -1 +1 @@
1
- {"version":3,"file":"encryption-service.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG1D,MAAM,WAAW,SAAS,CAAC,EAAE,CAAE,SAAQ,aAAa;IAChD,WAAW,EAAE,WAAW,CAAA;CAC3B;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAC1C;AAED,qBACa,qBAAsB,YAAW,iBAAiB;IACjC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAEjE,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAWjC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;IAMtC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAItC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAG5C"}
1
+ {"version":3,"file":"encryption-service.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,WAAW,SAAS,CAAC,EAAE,CAAE,SAAQ,aAAa;IAChD,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAC1C;AAED,qBACa,qBAAsB,YAAW,iBAAiB;IACjC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IACjD,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAEjE,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAWjC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;IAMtC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAItC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC;CAG5C"}
@@ -1,20 +1,9 @@
1
1
  "use strict";
2
2
  /**
3
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
3
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
4
4
  * Licensed under the GNU Affero General Public License (AGPL).
5
- * See License-AGPL.txt in the project root for license information.
5
+ * See License.AGPL.txt in the project root for license information.
6
6
  */
7
- var __assign = (this && this.__assign) || function () {
8
- __assign = Object.assign || function(t) {
9
- for (var s, i = 1, n = arguments.length; i < n; i++) {
10
- s = arguments[i];
11
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
12
- t[p] = s[p];
13
- }
14
- return t;
15
- };
16
- return __assign.apply(this, arguments);
17
- };
18
7
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
8
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
9
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -25,42 +14,40 @@ var __metadata = (this && this.__metadata) || function (k, v) {
25
14
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
26
15
  };
27
16
  Object.defineProperty(exports, "__esModule", { value: true });
28
- var inversify_1 = require("inversify");
29
- var encryption_engine_1 = require("./encryption-engine");
30
- var key_provider_1 = require("./key-provider");
31
- exports.EncryptionService = Symbol('EncryptionService');
32
- var EncryptionServiceImpl = /** @class */ (function () {
33
- function EncryptionServiceImpl() {
17
+ exports.EncryptionServiceImpl = exports.EncryptionService = void 0;
18
+ const inversify_1 = require("inversify");
19
+ const encryption_engine_1 = require("./encryption-engine");
20
+ const key_provider_1 = require("./key-provider");
21
+ exports.EncryptionService = Symbol("EncryptionService");
22
+ let EncryptionServiceImpl = class EncryptionServiceImpl {
23
+ encrypt(data) {
24
+ const dataStr = this.serialize(data);
25
+ const key = this.keyProvider.getPrimaryKey();
26
+ const encryptedData = this.engine.encrypt(dataStr, key.material);
27
+ return Object.assign(Object.assign({}, encryptedData), { keyMetadata: key.metadata });
34
28
  }
35
- EncryptionServiceImpl.prototype.encrypt = function (data) {
36
- var dataStr = this.serialize(data);
37
- var key = this.keyProvider.getPrimaryKey();
38
- var encryptedData = this.engine.encrypt(dataStr, key.material);
39
- return __assign(__assign({}, encryptedData), { keyMetadata: key.metadata });
40
- };
41
- EncryptionServiceImpl.prototype.decrypt = function (encrypted) {
42
- var key = this.keyProvider.getKeyFor(encrypted.keyMetadata);
43
- var serializedData = this.engine.decrypt(encrypted, key.material);
29
+ decrypt(encrypted) {
30
+ const key = this.keyProvider.getKeyFor(encrypted.keyMetadata);
31
+ const serializedData = this.engine.decrypt(encrypted, key.material);
44
32
  return this.deserialize(serializedData);
45
- };
46
- EncryptionServiceImpl.prototype.serialize = function (data) {
33
+ }
34
+ serialize(data) {
47
35
  return JSON.stringify(data);
48
- };
49
- EncryptionServiceImpl.prototype.deserialize = function (data) {
36
+ }
37
+ deserialize(data) {
50
38
  return JSON.parse(data);
51
- };
52
- __decorate([
53
- inversify_1.inject(encryption_engine_1.EncryptionEngine),
54
- __metadata("design:type", Object)
55
- ], EncryptionServiceImpl.prototype, "engine", void 0);
56
- __decorate([
57
- inversify_1.inject(key_provider_1.KeyProvider),
58
- __metadata("design:type", Object)
59
- ], EncryptionServiceImpl.prototype, "keyProvider", void 0);
60
- EncryptionServiceImpl = __decorate([
61
- inversify_1.injectable()
62
- ], EncryptionServiceImpl);
63
- return EncryptionServiceImpl;
64
- }());
39
+ }
40
+ };
41
+ __decorate([
42
+ (0, inversify_1.inject)(encryption_engine_1.EncryptionEngine),
43
+ __metadata("design:type", Object)
44
+ ], EncryptionServiceImpl.prototype, "engine", void 0);
45
+ __decorate([
46
+ (0, inversify_1.inject)(key_provider_1.KeyProvider),
47
+ __metadata("design:type", Object)
48
+ ], EncryptionServiceImpl.prototype, "keyProvider", void 0);
49
+ EncryptionServiceImpl = __decorate([
50
+ (0, inversify_1.injectable)()
51
+ ], EncryptionServiceImpl);
65
52
  exports.EncryptionServiceImpl = EncryptionServiceImpl;
66
53
  //# sourceMappingURL=encryption-service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"encryption-service.js","sourceRoot":"","sources":["../../src/encryption/enc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BAAqB,CA4BjC;AA5BY,sDAAqB"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2
+ * Copyright (c) 2020 Gitpod GmbH. All rights reserved.
3
3
  * Licensed under the GNU Affero General Public License (AGPL).
4
- * See License-AGPL.txt in the project root for license information.
4
+ * See License.AGPL.txt in the project root for license information.
5
5
  */
6
6
  /// <reference types="node" />
7
7
  export interface KeyMetadata {
@@ -30,7 +30,7 @@ export declare class KeyProviderImpl implements KeyProvider {
30
30
  protected readonly config: KeyProviderConfig;
31
31
  static loadKeyConfigFromJsonString(configStr: string): KeyConfig[];
32
32
  constructor(config: KeyProviderConfig);
33
- protected readonly keys: KeyConfig[];
33
+ protected get keys(): KeyConfig[];
34
34
  getPrimaryKey(): Key;
35
35
  getKeyFor(metadata: KeyMetadata): Key;
36
36
  protected configToKey(config: KeyConfig): Key;
@@ -1 +1 @@
1
- {"version":3,"file":"key-provider.d.ts","sourceRoot":"","sources":["../../src/encryption/key-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAIH,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,GAAG;IAChB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,MAAM,WAAW,WAAW;IACxB,aAAa,IAAI,GAAG,CAAC;IACrB,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,GAAG,CAAC;CACzC;AAED,oBAAY,SAAS,GAAG,WAAW,GAAG;IAClC,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,SAAS,EAAE,CA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