@gitpod/gitpod-protocol 0.1.5-wth-test.80 → 0.1.5-wv-remove-without-ws-flag.5
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.
- package/data/gitpod-schema.json +132 -5
- package/lib/accounting-protocol.d.ts +19 -11
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +35 -33
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +19 -2
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +1 -1
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +1 -1
- package/lib/analytics.d.ts.map +1 -1
- package/lib/analytics.js +1 -1
- package/lib/analytics.js.map +1 -1
- package/lib/attribution.d.ts +24 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +54 -0
- package/lib/attribution.js.map +1 -0
- package/lib/auth.d.ts +1 -1
- package/lib/auth.d.ts.map +1 -1
- package/lib/auth.js +1 -1
- package/lib/billing-mode.d.ts +45 -0
- package/lib/billing-mode.d.ts.map +1 -0
- package/lib/billing-mode.js +44 -0
- package/lib/billing-mode.js.map +1 -0
- package/lib/blocked-repositories-protocol.d.ts +13 -0
- package/lib/blocked-repositories-protocol.d.ts.map +1 -0
- package/lib/blocked-repositories-protocol.js +8 -0
- package/lib/blocked-repositories-protocol.js.map +1 -0
- package/lib/context-url.d.ts +1 -2
- package/lib/context-url.d.ts.map +1 -1
- package/lib/context-url.js +5 -7
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +1 -3
- package/lib/context-url.spec.d.ts.map +1 -1
- package/lib/context-url.spec.js +13 -26
- package/lib/context-url.spec.js.map +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.d.ts.map +1 -1
- package/lib/encryption/container-module.js +2 -2
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +10 -10
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +3 -4
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +1 -1
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +2 -2
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts +1 -1
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +8 -10
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -6
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +2 -21
- package/lib/env.js.map +1 -1
- package/lib/experiments/always-default.d.ts +8 -0
- package/lib/experiments/always-default.d.ts.map +1 -0
- package/lib/experiments/always-default.js +20 -0
- package/lib/experiments/always-default.js.map +1 -0
- package/lib/experiments/configcat-server.d.ts +10 -0
- package/lib/experiments/configcat-server.d.ts.map +1 -0
- package/lib/experiments/configcat-server.js +37 -0
- package/lib/experiments/configcat-server.js.map +1 -0
- package/lib/experiments/configcat.d.ts +21 -0
- package/lib/experiments/configcat.d.ts.map +1 -0
- package/lib/experiments/configcat.js +51 -0
- package/lib/experiments/configcat.js.map +1 -0
- package/lib/experiments/types.d.ts +22 -0
- package/lib/experiments/types.d.ts.map +1 -0
- package/lib/experiments/types.js +10 -0
- package/lib/experiments/types.js.map +1 -0
- package/lib/frontend-dashboard-service.d.ts +90 -0
- package/lib/frontend-dashboard-service.d.ts.map +1 -0
- package/lib/frontend-dashboard-service.js +49 -0
- package/lib/frontend-dashboard-service.js.map +1 -0
- package/lib/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +7 -7
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +43 -40
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +73 -55
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +61 -34
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +2 -1
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +3 -2
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +2 -2
- package/lib/ide-frontend-service.js +1 -1
- package/lib/ide-protocol.d.ts +29 -8
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/ide-protocol.js +11 -1
- package/lib/ide-protocol.js.map +1 -1
- package/lib/index.d.ts +17 -17
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +4 -1
- package/lib/installation-admin-protocol.d.ts.map +1 -1
- package/lib/installation-admin-protocol.js +4 -3
- package/lib/installation-admin-protocol.js.map +1 -1
- package/lib/license-protocol.d.ts +8 -1
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +1 -1
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +19 -19
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +5 -5
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +10 -7
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +5 -19
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +35 -23
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +10 -2
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +20 -4
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/handler.js +1 -1
- package/lib/messaging/node/connection.js +8 -8
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +1 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +7 -9
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +1 -1
- package/lib/oss-allowlist.js +1 -1
- package/lib/payment-protocol.d.ts +1 -1
- package/lib/payment-protocol.d.ts.map +1 -1
- package/lib/payment-protocol.js +2 -2
- package/lib/payment-protocol.js.map +1 -1
- package/lib/permission.d.ts +7 -4
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +16 -24
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +5 -4
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +211 -172
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +167 -61
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +282 -106
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.spec.d.ts +7 -0
- package/lib/protocol.spec.d.ts.map +1 -0
- package/lib/protocol.spec.js +127 -0
- package/lib/protocol.spec.js.map +1 -0
- package/lib/snapshot-url.d.ts +1 -1
- package/lib/snapshot-url.js +1 -1
- package/lib/snapshot-url.spec.d.ts +1 -1
- package/lib/snapshot-url.spec.js +1 -1
- package/lib/snapshot-url.spec.js.map +1 -1
- package/lib/team-subscription-protocol.d.ts +23 -4
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +21 -6
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +29 -6
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +10 -3
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +3 -3
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/typings/globals.js +1 -1
- package/lib/usage.d.ts +73 -0
- package/lib/usage.d.ts.map +1 -0
- package/lib/usage.js +20 -0
- package/lib/usage.js.map +1 -0
- package/lib/util/analytics.d.ts +1 -1
- package/lib/util/analytics.d.ts.map +1 -1
- package/lib/util/analytics.js +7 -7
- package/lib/util/analytics.js.map +1 -1
- package/lib/util/async-iterator.d.ts +1 -1
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +4 -4
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +1 -1
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +7 -7
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/debug-app.d.ts +25 -0
- package/lib/util/debug-app.d.ts.map +1 -0
- package/lib/util/debug-app.js +100 -0
- package/lib/util/debug-app.js.map +1 -0
- package/lib/util/deep-partial.d.ts +1 -1
- package/lib/util/deep-partial.js +1 -1
- package/lib/util/deferred.d.ts +1 -1
- package/lib/util/deferred.js +1 -1
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +2 -2
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +5 -3
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -1
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +7 -2
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +5 -0
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +446 -442
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.d.ts +1 -1
- package/lib/util/generate-workspace-id.spec.js +19 -8
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-cookie.d.ts +2 -2
- package/lib/util/gitpod-cookie.d.ts.map +1 -1
- package/lib/util/gitpod-cookie.js +1 -4
- package/lib/util/gitpod-cookie.js.map +1 -1
- package/lib/util/gitpod-host-url.d.ts +12 -3
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +69 -35
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +16 -6
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +21 -1
- package/lib/util/grpc.d.ts.map +1 -1
- package/lib/util/grpc.js +74 -2
- package/lib/util/grpc.js.map +1 -1
- package/lib/util/jaeger-client-types.d.ts +1 -1
- package/lib/util/jaeger-client-types.d.ts.map +1 -1
- package/lib/util/jaeger-client-types.js +1 -1
- package/lib/util/logging.d.ts +2 -2
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +32 -26
- package/lib/util/logging.js.map +1 -1
- package/lib/util/logging.spec.d.ts +7 -0
- package/lib/util/logging.spec.d.ts.map +1 -0
- package/lib/util/logging.spec.js +52 -0
- package/lib/util/logging.spec.js.map +1 -0
- package/lib/util/make-link.d.ts +1 -1
- package/lib/util/make-link.js +6 -6
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/nice-grpc.d.ts +9 -0
- package/lib/util/nice-grpc.d.ts.map +1 -0
- package/lib/util/nice-grpc.js +121 -0
- package/lib/util/nice-grpc.js.map +1 -0
- package/lib/util/parse-workspace-id.d.ts +1 -1
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +2 -3
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +1 -1
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.d.ts +1 -1
- package/lib/util/queue.js +1 -1
- package/lib/util/queue.spec.d.ts +1 -1
- package/lib/util/queue.spec.js +10 -7
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +1 -1
- package/lib/util/repeat.js +1 -1
- package/lib/util/semaphore.d.ts +1 -1
- package/lib/util/semaphore.d.ts.map +1 -1
- package/lib/util/semaphore.js +1 -1
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +1 -1
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +3 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +16 -4
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts +3 -1
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +35 -1
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +7 -7
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +15 -17
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +1 -1
- package/lib/util/tracing.spec.js +4 -4
- package/lib/util/tracing.spec.js.map +1 -1
- package/lib/util/workspace-port-authentication.d.ts +8 -8
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +9 -12
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/webhook-event.d.ts +44 -0
- package/lib/webhook-event.d.ts.map +1 -0
- package/lib/webhook-event.js +8 -0
- package/lib/webhook-event.js.map +1 -0
- package/lib/workspace-class.d.ts +14 -0
- package/lib/workspace-class.d.ts.map +1 -0
- package/lib/workspace-class.js +8 -0
- package/lib/workspace-class.js.map +1 -0
- package/lib/workspace-cluster.d.ts +13 -14
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +3 -5
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +22 -4
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +1 -1
- package/lib/wsready.d.ts +8 -2
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +3 -3
- package/package.json +14 -6
- package/pkg-yarn.lock +10 -5
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +67 -52
- package/src/admin-protocol.ts +48 -22
- package/src/analytics.ts +22 -22
- package/src/attribution.ts +63 -0
- package/src/auth.ts +3 -3
- package/src/billing-mode.ts +84 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +18 -22
- package/src/context-url.ts +79 -79
- package/src/encryption/container-module.ts +3 -4
- package/src/encryption/encryption-engine.spec.ts +10 -9
- package/src/encryption/encryption-engine.ts +21 -17
- package/src/encryption/encryption-service.ts +5 -6
- package/src/encryption/key-provider.ts +17 -20
- package/src/env.ts +2 -25
- package/src/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +42 -0
- package/src/experiments/configcat.ts +56 -0
- package/src/experiments/types.ts +34 -0
- package/src/frontend-dashboard-service.ts +125 -0
- package/src/gitpod-file-parser.spec.ts +56 -62
- package/src/gitpod-file-parser.ts +17 -18
- package/src/gitpod-service.ts +224 -142
- package/src/headless-workspace-log.ts +7 -5
- package/src/ide-frontend-service.ts +3 -3
- package/src/ide-protocol.ts +38 -10
- package/src/index.ts +17 -17
- package/src/installation-admin-protocol.ts +12 -9
- package/src/license-protocol.ts +13 -7
- package/src/messaging/browser/connection.ts +45 -47
- package/src/messaging/browser/window-connection.ts +40 -30
- package/src/messaging/client-call-metrics.ts +79 -82
- package/src/messaging/error.ts +30 -8
- package/src/messaging/handler.ts +6 -6
- package/src/messaging/node/connection.ts +8 -8
- package/src/messaging/proxy-factory.ts +23 -30
- package/src/oss-allowlist.ts +4 -4
- package/src/payment-protocol.ts +3 -3
- package/src/permission.ts +25 -32
- package/src/plans.ts +241 -190
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +527 -265
- package/src/snapshot-url.spec.ts +10 -8
- package/src/snapshot-url.ts +1 -1
- package/src/team-subscription-protocol.ts +60 -23
- package/src/teams-projects-protocol.ts +42 -12
- package/src/typings/globals.ts +6 -5
- package/src/usage.ts +85 -0
- package/src/util/analytics.ts +47 -43
- package/src/util/async-iterator.ts +5 -6
- package/src/util/cancelable.ts +4 -4
- package/src/util/date-time.ts +9 -9
- package/src/util/debug-app.ts +81 -0
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +7 -7
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +9 -7
- package/src/util/generate-workspace-id.spec.ts +27 -17
- package/src/util/generate-workspace-id.ts +461 -455
- package/src/util/gitpod-cookie.ts +9 -10
- package/src/util/gitpod-host-url.spec.ts +41 -14
- package/src/util/gitpod-host-url.ts +82 -39
- package/src/util/grpc.ts +94 -2
- package/src/util/jaeger-client-types.ts +3 -3
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +61 -43
- package/src/util/make-link.ts +7 -8
- package/src/util/nice-grpc.ts +96 -0
- package/src/util/parse-workspace-id.spec.ts +18 -9
- package/src/util/parse-workspace-id.ts +6 -7
- package/src/util/queue.spec.ts +28 -26
- package/src/util/queue.ts +1 -1
- package/src/util/repeat.ts +2 -2
- package/src/util/semaphore.ts +5 -7
- package/src/util/skip-if.ts +10 -7
- package/src/util/timeutil.spec.ts +41 -15
- package/src/util/timeutil.ts +28 -12
- package/src/util/tracing.spec.ts +29 -24
- package/src/util/tracing.ts +55 -52
- package/src/util/workspace-port-authentication.ts +11 -14
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +25 -19
- package/src/workspace-instance.ts +67 -25
- package/src/wsready.ts +11 -4
- package/data/builtin-theia-plugins.json +0 -372
- package/lib/email-protocol.d.ts +0 -49
- package/lib/email-protocol.d.ts.map +0 -1
- package/lib/email-protocol.js +0 -28
- package/lib/email-protocol.js.map +0 -1
- package/lib/theia-plugins.d.ts +0 -11
- package/lib/theia-plugins.d.ts.map +0 -1
- package/lib/theia-plugins.js +0 -8
- package/lib/theia-plugins.js.map +0 -1
- package/src/email-protocol.ts +0 -66
- package/src/theia-plugins.ts +0 -11
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.AttributionId = void 0;
|
|
9
|
+
const protocol_1 = require("./protocol");
|
|
10
|
+
var AttributionId;
|
|
11
|
+
(function (AttributionId) {
|
|
12
|
+
const SEPARATOR = ":";
|
|
13
|
+
function create(userOrTeam) {
|
|
14
|
+
if (protocol_1.User.is(userOrTeam)) {
|
|
15
|
+
return { kind: "user", userId: userOrTeam.id };
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return { kind: "team", teamId: userOrTeam.id };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
AttributionId.create = create;
|
|
22
|
+
function parse(s) {
|
|
23
|
+
if (!s) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const parts = s.split(":");
|
|
27
|
+
if (parts.length !== 2) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
switch (parts[0]) {
|
|
31
|
+
case "user":
|
|
32
|
+
return { kind: "user", userId: parts[1] };
|
|
33
|
+
case "team":
|
|
34
|
+
return { kind: "team", teamId: parts[1] };
|
|
35
|
+
default:
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
AttributionId.parse = parse;
|
|
40
|
+
function render(id) {
|
|
41
|
+
switch (id.kind) {
|
|
42
|
+
case "user":
|
|
43
|
+
return `user${SEPARATOR}${id.userId}`;
|
|
44
|
+
case "team":
|
|
45
|
+
return `team${SEPARATOR}${id.teamId}`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
AttributionId.render = render;
|
|
49
|
+
function equals(a, b) {
|
|
50
|
+
return render(a) === render(b);
|
|
51
|
+
}
|
|
52
|
+
AttributionId.equals = equals;
|
|
53
|
+
})(AttributionId = exports.AttributionId || (exports.AttributionId = {}));
|
|
54
|
+
//# sourceMappingURL=attribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.js","sourceRoot":"","sources":["../src/attribution.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,yCAAkC;AAelC,IAAiB,aAAa,CAyC7B;AAzCD,WAAiB,aAAa;IAC1B,MAAM,SAAS,GAAG,GAAG,CAAC;IAEtB,SAAgB,MAAM,CAAC,UAAuB;QAC1C,IAAI,eAAI,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE;YACrB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;SAClD;aAAM;YACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC;SAClD;IACL,CAAC;IANe,oBAAM,SAMrB,CAAA;IAED,SAAgB,KAAK,CAAC,CAAS;QAC3B,IAAI,CAAC,CAAC,EAAE;YACJ,OAAO,SAAS,CAAC;SACpB;QACD,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACpB,OAAO,SAAS,CAAC;SACpB;QACD,QAAQ,KAAK,CAAC,CAAC,CAAC,EAAE;YACd,KAAK,MAAM;gBACP,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C,KAAK,MAAM;gBACP,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9C;gBACI,OAAO,SAAS,CAAC;SACxB;IACL,CAAC;IAhBe,mBAAK,QAgBpB,CAAA;IAED,SAAgB,MAAM,CAAC,EAAiB;QACpC,QAAQ,EAAE,CAAC,IAAI,EAAE;YACb,KAAK,MAAM;gBACP,OAAO,OAAO,SAAS,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;YAC1C,KAAK,MAAM;gBACP,OAAO,OAAO,SAAS,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;SAC7C;IACL,CAAC;IAPe,oBAAM,SAOrB,CAAA;IAED,SAAgB,MAAM,CAAC,CAAgB,EAAE,CAAgB;QACrD,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IAFe,oBAAM,SAErB,CAAA;AACL,CAAC,EAzCgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAyC7B"}
|
package/lib/auth.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
export interface SelectAccountPayload {
|
|
7
7
|
currentUser: {
|
package/lib/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC5B,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC5B,CAAC;CACL;AACD,yBAAiB,oBAAoB,CAAC;IAClC,SAAgB,EAAE,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,oBAAoB,CAE1D;CACJ"}
|
package/lib/auth.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.SelectAccountPayload = void 0;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* BillingMode is used to answer the following questions:
|
|
8
|
+
* - Should UI piece x be displayed for this user/team? (getBillingModeForUser/Team)
|
|
9
|
+
* - What model should be used to limit this workspace's capabilities (mayStartWorkspace, setTimeout, workspace class, etc...) (getBillingMode(workspaceInstance.attributionId))
|
|
10
|
+
* - How is a workspace session charged for? (getBillingMode(workspaceInstance.attributionId))
|
|
11
|
+
*/
|
|
12
|
+
export declare type BillingMode = None | Chargebee | UsageBased;
|
|
13
|
+
export declare namespace BillingMode {
|
|
14
|
+
const NONE: None;
|
|
15
|
+
/** Incl. upgrade and status */
|
|
16
|
+
function showUsageBasedBilling(billingMode?: BillingMode): boolean;
|
|
17
|
+
function showTeamSubscriptionUI(billingMode?: BillingMode): boolean;
|
|
18
|
+
function canSetWorkspaceClass(billingMode?: BillingMode): boolean;
|
|
19
|
+
function canSetCostCenter(billingMode: BillingMode): boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Payment is disabled */
|
|
22
|
+
interface None {
|
|
23
|
+
mode: "none";
|
|
24
|
+
}
|
|
25
|
+
/** Sessions is handled with old subscription logic based on Chargebee */
|
|
26
|
+
interface Chargebee {
|
|
27
|
+
mode: "chargebee";
|
|
28
|
+
/** True iff this is a team, and is based on a paid plan. Currently only set for teams! */
|
|
29
|
+
paid?: boolean;
|
|
30
|
+
canUpgradeToUBB?: boolean;
|
|
31
|
+
/** Name of team(s) that block switching to usage-based */
|
|
32
|
+
teamNames?: string[];
|
|
33
|
+
}
|
|
34
|
+
/** Session is handld with new usage-based logic */
|
|
35
|
+
interface UsageBased {
|
|
36
|
+
mode: "usage-based";
|
|
37
|
+
/** True iff this is a team, and is based on a paid plan. Currently only set for teams! */
|
|
38
|
+
paid?: boolean;
|
|
39
|
+
/** User is already converted, but is member with at least one Chargebee-based "Team Plan" */
|
|
40
|
+
hasChargebeeTeamPlan?: boolean;
|
|
41
|
+
/** User is already converted, but is member or owner in at least one Chargebee-based "Team Subscription" */
|
|
42
|
+
hasChargebeeTeamSubscription?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=billing-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-mode.d.ts","sourceRoot":"","sources":["../src/billing-mode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,oBAAY,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC;AACxD,yBAAiB,WAAW,CAAC;IAClB,MAAM,IAAI,EAAE,IAElB,CAAC;IAEF,+BAA+B;IAC/B,SAAgB,qBAAqB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAOxE;IAED,SAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAQzE;IAED,SAAgB,oBAAoB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAOvE;IAED,SAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGlE;CACJ;AAED,0BAA0B;AAC1B,UAAU,IAAI;IACV,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,yEAAyE;AACzE,UAAU,SAAS;IACf,IAAI,EAAE,WAAW,CAAC;IAElB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,mDAAmD;AACnD,UAAU,UAAU;IAChB,IAAI,EAAE,aAAa,CAAC;IAEpB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,6FAA6F;IAC7F,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,4GAA4G;IAC5G,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.BillingMode = void 0;
|
|
9
|
+
var BillingMode;
|
|
10
|
+
(function (BillingMode) {
|
|
11
|
+
BillingMode.NONE = {
|
|
12
|
+
mode: "none",
|
|
13
|
+
};
|
|
14
|
+
/** Incl. upgrade and status */
|
|
15
|
+
function showUsageBasedBilling(billingMode) {
|
|
16
|
+
if (!billingMode) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return (billingMode.mode === "usage-based" || (billingMode.mode === "chargebee" && !!billingMode.canUpgradeToUBB));
|
|
20
|
+
}
|
|
21
|
+
BillingMode.showUsageBasedBilling = showUsageBasedBilling;
|
|
22
|
+
function showTeamSubscriptionUI(billingMode) {
|
|
23
|
+
if (!billingMode) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return (billingMode.mode === "chargebee" ||
|
|
27
|
+
(billingMode.mode === "usage-based" && !!billingMode.hasChargebeeTeamSubscription));
|
|
28
|
+
}
|
|
29
|
+
BillingMode.showTeamSubscriptionUI = showTeamSubscriptionUI;
|
|
30
|
+
function canSetWorkspaceClass(billingMode) {
|
|
31
|
+
if (!billingMode) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
// if has any Stripe subscription, either directly or per team, OR we're running on a license
|
|
35
|
+
return billingMode.mode === "usage-based" || billingMode.mode === "none";
|
|
36
|
+
}
|
|
37
|
+
BillingMode.canSetWorkspaceClass = canSetWorkspaceClass;
|
|
38
|
+
function canSetCostCenter(billingMode) {
|
|
39
|
+
// if has any Stripe Subscription, either directly or per team
|
|
40
|
+
return billingMode.mode === "usage-based";
|
|
41
|
+
}
|
|
42
|
+
BillingMode.canSetCostCenter = canSetCostCenter;
|
|
43
|
+
})(BillingMode = exports.BillingMode || (exports.BillingMode = {}));
|
|
44
|
+
//# sourceMappingURL=billing-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing-mode.js","sourceRoot":"","sources":["../src/billing-mode.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AASH,IAAiB,WAAW,CAsC3B;AAtCD,WAAiB,WAAW;IACX,gBAAI,GAAS;QACtB,IAAI,EAAE,MAAM;KACf,CAAC;IAEF,+BAA+B;IAC/B,SAAgB,qBAAqB,CAAC,WAAyB;QAC3D,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,CACH,WAAW,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAC5G,CAAC;IACN,CAAC;IAPe,iCAAqB,wBAOpC,CAAA;IAED,SAAgB,sBAAsB,CAAC,WAAyB;QAC5D,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,CACH,WAAW,CAAC,IAAI,KAAK,WAAW;YAChC,CAAC,WAAW,CAAC,IAAI,KAAK,aAAa,IAAI,CAAC,CAAC,WAAW,CAAC,4BAA4B,CAAC,CACrF,CAAC;IACN,CAAC;IARe,kCAAsB,yBAQrC,CAAA;IAED,SAAgB,oBAAoB,CAAC,WAAyB;QAC1D,IAAI,CAAC,WAAW,EAAE;YACd,OAAO,KAAK,CAAC;SAChB;QAED,6FAA6F;QAC7F,OAAO,WAAW,CAAC,IAAI,KAAK,aAAa,IAAI,WAAW,CAAC,IAAI,KAAK,MAAM,CAAC;IAC7E,CAAC;IAPe,gCAAoB,uBAOnC,CAAA;IAED,SAAgB,gBAAgB,CAAC,WAAwB;QACrD,8DAA8D;QAC9D,OAAO,WAAW,CAAC,IAAI,KAAK,aAAa,CAAC;IAC9C,CAAC;IAHe,4BAAgB,mBAG/B,CAAA;AACL,CAAC,EAtCgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAsC3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
|
|
3
|
+
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
|
+
*/
|
|
6
|
+
export interface BlockedRepository {
|
|
7
|
+
id: number;
|
|
8
|
+
urlRegexp: string;
|
|
9
|
+
blockUser: boolean;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
updatedAt: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=blocked-repositories-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocked-repositories-protocol.d.ts","sourceRoot":"","sources":["../src/blocked-repositories-protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2022 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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
//# sourceMappingURL=blocked-repositories-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocked-repositories-protocol.js","sourceRoot":"","sources":["../src/blocked-repositories-protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
package/lib/context-url.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
import { Workspace } from ".";
|
|
7
7
|
/**
|
|
@@ -13,7 +13,6 @@ import { Workspace } from ".";
|
|
|
13
13
|
* TODO(gpl) See if we can get this into `server` code to remove the burden from clients
|
|
14
14
|
*/
|
|
15
15
|
export declare namespace ContextURL {
|
|
16
|
-
const INCREMENTAL_PREBUILD_PREFIX = "incremental-prebuild";
|
|
17
16
|
const PREBUILD_PREFIX = "prebuild";
|
|
18
17
|
const IMAGEBUILD_PREFIX = "imagebuild";
|
|
19
18
|
const SNAPSHOT_PREFIX = "snapshot";
|
package/lib/context-url.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-url.d.ts","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAE9B;;;;;;;GAOG;AACH,yBAAiB,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"context-url.d.ts","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAE9B;;;;;;;GAOG;AACH,yBAAiB,UAAU,CAAC;IACjB,MAAM,eAAe,aAAa,CAAC;IACnC,MAAM,iBAAiB,eAAe,CAAC;IACvC,MAAM,eAAe,aAAa,CAAC;IACnC,MAAM,eAAe,cAAc,CAAC;IAE3C;;;;;;;OAOG;IACH,SAAgB,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAAC,GAAG,SAAS,GAAG,GAAG,GAAG,SAAS,CAY3G;CAgEJ"}
|
package/lib/context-url.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.ContextURL = void 0;
|
|
@@ -16,11 +16,10 @@ exports.ContextURL = void 0;
|
|
|
16
16
|
*/
|
|
17
17
|
var ContextURL;
|
|
18
18
|
(function (ContextURL) {
|
|
19
|
-
ContextURL.INCREMENTAL_PREBUILD_PREFIX = "incremental-prebuild";
|
|
20
19
|
ContextURL.PREBUILD_PREFIX = "prebuild";
|
|
21
20
|
ContextURL.IMAGEBUILD_PREFIX = "imagebuild";
|
|
22
21
|
ContextURL.SNAPSHOT_PREFIX = "snapshot";
|
|
23
|
-
ContextURL.REFERRER_PREFIX =
|
|
22
|
+
ContextURL.REFERRER_PREFIX = "referrer:";
|
|
24
23
|
/**
|
|
25
24
|
* This function will (try to) return the HTTP(S) URL of the context the user originally created this workspace on.
|
|
26
25
|
* Especially it will not contain any modifiers or be of different scheme than HTTP(S).
|
|
@@ -38,7 +37,7 @@ var ContextURL;
|
|
|
38
37
|
return new URL(normalized);
|
|
39
38
|
}
|
|
40
39
|
catch (err) {
|
|
41
|
-
console.
|
|
40
|
+
console.debug(`unable to parse URL from normalized contextURL: '${normalized}'`);
|
|
42
41
|
}
|
|
43
42
|
return undefined;
|
|
44
43
|
}
|
|
@@ -77,16 +76,15 @@ var ContextURL;
|
|
|
77
76
|
const segmentsToURL = (offset) => {
|
|
78
77
|
let rest = segments.slice(offset).join("/");
|
|
79
78
|
if (/^git@[^:\/]+:/.test(rest)) {
|
|
80
|
-
rest = rest.replace(/^git@([^:\/]+):/,
|
|
79
|
+
rest = rest.replace(/^git@([^:\/]+):/, "https://$1/");
|
|
81
80
|
}
|
|
82
81
|
if (!rest.startsWith("http")) {
|
|
83
|
-
rest =
|
|
82
|
+
rest = "https://" + rest;
|
|
84
83
|
}
|
|
85
84
|
return rest;
|
|
86
85
|
};
|
|
87
86
|
const firstSegment = segments[0];
|
|
88
87
|
if (firstSegment === ContextURL.PREBUILD_PREFIX ||
|
|
89
|
-
firstSegment === ContextURL.INCREMENTAL_PREBUILD_PREFIX ||
|
|
90
88
|
firstSegment === ContextURL.IMAGEBUILD_PREFIX ||
|
|
91
89
|
firstSegment === ContextURL.SNAPSHOT_PREFIX ||
|
|
92
90
|
firstSegment.startsWith(ContextURL.REFERRER_PREFIX)) {
|
package/lib/context-url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-url.js","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH;;;;;;;GAOG;AACH,IAAiB,UAAU,CA0F1B;AA1FD,WAAiB,UAAU;
|
|
1
|
+
{"version":3,"file":"context-url.js","sourceRoot":"","sources":["../src/context-url.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAIH;;;;;;;GAOG;AACH,IAAiB,UAAU,CA0F1B;AA1FD,WAAiB,UAAU;IACV,0BAAe,GAAG,UAAU,CAAC;IAC7B,4BAAiB,GAAG,YAAY,CAAC;IACjC,0BAAe,GAAG,UAAU,CAAC;IAC7B,0BAAe,GAAG,WAAW,CAAC;IAE3C;;;;;;;OAOG;IACH,SAAgB,gBAAgB,CAAC,EAAyD;QACtF,MAAM,UAAU,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,SAAS,CAAC;SACpB;QAED,IAAI;YACA,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;SAC9B;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,oDAAoD,UAAU,GAAG,CAAC,CAAC;SACpF;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAZe,2BAAgB,mBAY/B,CAAA;IAED,SAAS,SAAS,CAAC,EAAyD;QACxE,IAAI,CAAC,EAAE,EAAE;YACL,OAAO,SAAS,CAAC;SACpB;QACD,IAAI,EAAE,CAAC,OAAO,CAAC,oBAAoB,EAAE;YACjC,OAAO,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC;SAC1C;QAED,+GAA+G;QAC/G,IAAI,QAAQ,GAAuB,SAAS,CAAC;QAC7C,IAAI;YACA,QAAQ,GAAG,cAAc,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;SAC5C;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,+CAA+C,EAAE,CAAC,UAAU,GAAG,EAAE,GAAG,CAAC,CAAC;SACvF;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACH,SAAS,cAAc,CAAC,UAA8B;QAClD,IAAI,UAAU,KAAK,SAAS,EAAE;YAC1B,OAAO,SAAS,CAAC;SACpB;QAED,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACvC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,uCAAuC;SAC9D;QAED,MAAM,aAAa,GAAG,CAAC,MAAc,EAAU,EAAE;YAC7C,IAAI,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC5C,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBAC5B,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;aACzD;YACD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;gBAC1B,IAAI,GAAG,UAAU,GAAG,IAAI,CAAC;aAC5B;YACD,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACjC,IACI,YAAY,KAAK,WAAA,eAAe;YAChC,YAAY,KAAK,WAAA,iBAAiB;YAClC,YAAY,KAAK,WAAA,eAAe;YAChC,YAAY,CAAC,UAAU,CAAC,WAAA,eAAe,CAAC,EAC1C;YACE,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;SAC3B;QAED,qBAAqB;QACrB,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAClC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;SAC3B;QAED,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;AACL,CAAC,EA1FgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA0F1B"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
export declare class ContextUrlTest {
|
|
7
7
|
parseContextUrl_withEnvVar(): void;
|
|
8
8
|
parseContextUrl_withEnvVar_withoutSchema(): void;
|
|
9
9
|
parseContextUrl_withEnvVar_sshUrl(): void;
|
|
10
|
-
parseContextUrl_withPrebuild(): void;
|
|
11
|
-
parseContextUrl_withPrebuild_withoutSchema(): void;
|
|
12
10
|
parseContextUrl_badUrl(): void;
|
|
13
11
|
}
|
|
14
12
|
//# sourceMappingURL=context-url.spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-url.spec.d.ts","sourceRoot":"","sources":["../src/context-url.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,qBACa,cAAc;
|
|
1
|
+
{"version":3,"file":"context-url.spec.d.ts","sourceRoot":"","sources":["../src/context-url.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,qBACa,cAAc;IACV,0BAA0B;IAS1B,wCAAwC;IASxC,iCAAiC;IASjC,sBAAsB;CAItC"}
|
package/lib/context-url.spec.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
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;
|
|
@@ -21,30 +21,29 @@ const context_url_1 = require("./context-url");
|
|
|
21
21
|
const expect = chai.expect;
|
|
22
22
|
let ContextUrlTest = class ContextUrlTest {
|
|
23
23
|
parseContextUrl_withEnvVar() {
|
|
24
|
-
const actual = context_url_1.ContextURL.getNormalizedURL({
|
|
24
|
+
const actual = context_url_1.ContextURL.getNormalizedURL({
|
|
25
|
+
contextURL: "passedin=test%20value/https://github.com/gitpod-io/gitpod-test-repo",
|
|
26
|
+
context: {},
|
|
27
|
+
});
|
|
25
28
|
expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
|
|
26
29
|
expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
27
30
|
}
|
|
28
31
|
parseContextUrl_withEnvVar_withoutSchema() {
|
|
29
|
-
const actual = context_url_1.ContextURL.getNormalizedURL({
|
|
32
|
+
const actual = context_url_1.ContextURL.getNormalizedURL({
|
|
33
|
+
contextURL: "passedin=test%20value/github.com/gitpod-io/gitpod-test-repo",
|
|
34
|
+
context: {},
|
|
35
|
+
});
|
|
30
36
|
expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
|
|
31
37
|
expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
32
38
|
}
|
|
33
39
|
parseContextUrl_withEnvVar_sshUrl() {
|
|
34
|
-
const actual = context_url_1.ContextURL.getNormalizedURL({
|
|
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
|
+
});
|
|
35
44
|
expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
|
|
36
45
|
expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo.git");
|
|
37
46
|
}
|
|
38
|
-
parseContextUrl_withPrebuild() {
|
|
39
|
-
const actual = context_url_1.ContextURL.getNormalizedURL({ contextURL: "prebuild/https://github.com/gitpod-io/gitpod-test-repo", context: {} });
|
|
40
|
-
expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
|
|
41
|
-
expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
42
|
-
}
|
|
43
|
-
parseContextUrl_withPrebuild_withoutSchema() {
|
|
44
|
-
const actual = context_url_1.ContextURL.getNormalizedURL({ contextURL: "prebuild/github.com/gitpod-io/gitpod-test-repo", context: {} });
|
|
45
|
-
expect(actual === null || actual === void 0 ? void 0 : actual.host).to.equal("github.com");
|
|
46
|
-
expect(actual === null || actual === void 0 ? void 0 : actual.pathname).to.equal("/gitpod-io/gitpod-test-repo");
|
|
47
|
-
}
|
|
48
47
|
parseContextUrl_badUrl() {
|
|
49
48
|
const actual = context_url_1.ContextURL.getNormalizedURL({ contextURL: "[Object object]", context: {} });
|
|
50
49
|
expect(actual).to.be.undefined;
|
|
@@ -68,18 +67,6 @@ __decorate([
|
|
|
68
67
|
__metadata("design:paramtypes", []),
|
|
69
68
|
__metadata("design:returntype", void 0)
|
|
70
69
|
], ContextUrlTest.prototype, "parseContextUrl_withEnvVar_sshUrl", null);
|
|
71
|
-
__decorate([
|
|
72
|
-
mocha_typescript_1.test,
|
|
73
|
-
__metadata("design:type", Function),
|
|
74
|
-
__metadata("design:paramtypes", []),
|
|
75
|
-
__metadata("design:returntype", void 0)
|
|
76
|
-
], ContextUrlTest.prototype, "parseContextUrl_withPrebuild", null);
|
|
77
|
-
__decorate([
|
|
78
|
-
mocha_typescript_1.test,
|
|
79
|
-
__metadata("design:type", Function),
|
|
80
|
-
__metadata("design:paramtypes", []),
|
|
81
|
-
__metadata("design:returntype", void 0)
|
|
82
|
-
], ContextUrlTest.prototype, "parseContextUrl_withPrebuild_withoutSchema", null);
|
|
83
70
|
__decorate([
|
|
84
71
|
mocha_typescript_1.test,
|
|
85
72
|
__metadata("design:type", Function),
|
|
@@ -1 +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;
|
|
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
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
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,
|
|
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"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
5
|
+
* See License.AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.encryptionModule = void 0;
|
|
@@ -19,7 +19,7 @@ const encryption_service_1 = require("./encryption-service");
|
|
|
19
19
|
* };
|
|
20
20
|
* }).inSingletonScope();
|
|
21
21
|
*/
|
|
22
|
-
const encryptionModule = bind => {
|
|
22
|
+
const encryptionModule = (bind) => {
|
|
23
23
|
bind(key_provider_1.KeyProvider).to(key_provider_1.KeyProviderImpl).inSingletonScope();
|
|
24
24
|
bind(encryption_engine_1.EncryptionEngine).to(encryption_engine_1.EncryptionEngineImpl).inSingletonScope();
|
|
25
25
|
bind(encryption_service_1.EncryptionService).to(encryption_service_1.EncryptionServiceImpl).inSingletonScope();
|
|
@@ -1 +1 @@
|
|
|
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,IAAI,
|
|
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
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
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,
|
|
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"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
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,7 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.EncryptionEngineImpl = exports.EncryptionEngine = void 0;
|
|
15
15
|
const crypto = require("crypto");
|
|
16
16
|
const inversify_1 = require("inversify");
|
|
17
|
-
exports.EncryptionEngine = Symbol(
|
|
17
|
+
exports.EncryptionEngine = Symbol("EncryptionEngine");
|
|
18
18
|
/**
|
|
19
19
|
* For starters, let's use aes-cbc-256 with:
|
|
20
20
|
* - 16 bytes/128 bits IV (the size of an aes-256-cbc block)
|
|
@@ -23,26 +23,26 @@ exports.EncryptionEngine = Symbol('EncryptionEngine');
|
|
|
23
23
|
*/
|
|
24
24
|
let EncryptionEngineImpl = class EncryptionEngineImpl {
|
|
25
25
|
constructor() {
|
|
26
|
-
this.algorithm =
|
|
27
|
-
this.enc =
|
|
26
|
+
this.algorithm = "aes-256-cbc";
|
|
27
|
+
this.enc = "base64";
|
|
28
28
|
}
|
|
29
29
|
encrypt(data, key) {
|
|
30
30
|
const iv = crypto.randomBytes(16);
|
|
31
31
|
const cipher = crypto.createCipheriv(this.algorithm, key, iv);
|
|
32
|
-
const encrypted = cipher.update(
|
|
32
|
+
const encrypted = cipher.update(Buffer.from(data, "utf8"));
|
|
33
33
|
const finalEncrypted = Buffer.concat([encrypted, cipher.final()]);
|
|
34
34
|
return {
|
|
35
35
|
data: finalEncrypted.toString(this.enc),
|
|
36
36
|
keyParams: {
|
|
37
|
-
iv: iv.toString(this.enc)
|
|
38
|
-
}
|
|
37
|
+
iv: iv.toString(this.enc),
|
|
38
|
+
},
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
decrypt(encryptedData, key) {
|
|
42
|
-
const decipher = crypto.createDecipheriv(this.algorithm, key,
|
|
43
|
-
let decrypted = decipher.update(
|
|
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
44
|
const finalDecrypted = Buffer.concat([decrypted, decipher.final()]);
|
|
45
|
-
return finalDecrypted.toString(
|
|
45
|
+
return finalDecrypted.toString("utf8");
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
EncryptionEngineImpl = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-engine.js","sourceRoot":"","sources":["../../src/encryption/encryption-engine.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,iCAAiC;AACjC,yCAAuC;AAY1B,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAS3D;;;;;GAKG;AAEH,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAAjC;QACa,cAAS,GAAG,aAAa,CAAC;QAC1B,QAAG,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"encryption-engine.js","sourceRoot":"","sources":["../../src/encryption/encryption-engine.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,iCAAiC;AACjC,yCAAuC;AAY1B,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAS3D;;;;;GAKG;AAEH,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAAjC;QACa,cAAS,GAAG,aAAa,CAAC;QAC1B,QAAG,GAAG,QAAQ,CAAC;IAyB5B,CAAC;IAvBG,OAAO,CAAC,IAAY,EAAE,GAAW;QAC7B,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QAC3D,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAClE,OAAO;YACH,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;YACvC,SAAS,EAAE;gBACP,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,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,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
4
|
+
* See License.AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
declare class TestEncryptionEngineImpl {
|
|
7
7
|
protected get testkey(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-engine.spec.d.ts","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,
|
|
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"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
|
-
* See License
|
|
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;
|
|
@@ -24,14 +24,13 @@ const expect = chai.expect;
|
|
|
24
24
|
let TestEncryptionEngineImpl = class TestEncryptionEngineImpl {
|
|
25
25
|
// Created with openssl rand -rand /dev/urandom -out key -base64 32
|
|
26
26
|
get testkey() {
|
|
27
|
-
const keyFilePath = path.resolve(__dirname,
|
|
27
|
+
const keyFilePath = path.resolve(__dirname, "../../test/fixtures/encryption/testkey");
|
|
28
28
|
const keyBuffer = fs.readFileSync(keyFilePath);
|
|
29
29
|
return keyBuffer.toString().trim();
|
|
30
30
|
}
|
|
31
|
-
;
|
|
32
31
|
basicSymmetry() {
|
|
33
32
|
const plaintext = "12345678901234567890";
|
|
34
|
-
const key =
|
|
33
|
+
const key = Buffer.from(this.testkey, "base64");
|
|
35
34
|
const cut = new encryption_engine_1.EncryptionEngineImpl();
|
|
36
35
|
const encryptedData = cut.encrypt(plaintext, key);
|
|
37
36
|
expect(encryptedData).to.be.not.undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-engine.spec.js","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,uDAA+C;AAC/C,6BAA6B;AAC7B,6BAA6B;AAC7B,yBAAyB;AAEzB,2DAA2D;AAE3D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"encryption-engine.spec.js","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,uDAA+C;AAC/C,6BAA6B;AAC7B,6BAA6B;AAC7B,yBAAyB;AAEzB,2DAA2D;AAE3D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAG3B,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAC1B,mEAAmE;IACnE,IAAc,OAAO;QACjB,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAC;QACtF,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAC/C,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;IAEK,aAAa;QACf,MAAM,SAAS,GAAG,sBAAsB,CAAC;QACzC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAEhD,MAAM,GAAG,GAAG,IAAI,wCAAoB,EAAE,CAAC;QACvC,MAAM,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAClD,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;QAE1C,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;QAC3D,MAAM,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;CACJ,CAAA;AAXS;IAAL,uBAAI;;;;6DAUJ;AAlBC,wBAAwB;IAD7B,wBAAK;GACA,wBAAwB,CAmB7B;AACY,QAAA,CAAC,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright (c) 2020 Gitpod GmbH. All rights reserved.
|
|
3
3
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
4
|
-
* See License
|
|
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;
|
|
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"}
|