@gitpod/gitpod-protocol 0.1.5-wth-argo.0 → 0.1.5-yh-vmoptions-fork.1
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 +206 -28
- package/lib/accounting-protocol.d.ts +162 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +107 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +32 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +15 -0
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +44 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/analytics.js +10 -0
- package/lib/analytics.js.map +1 -0
- package/lib/auth.d.ts.map +1 -1
- package/lib/context-url.d.ts +31 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +102 -0
- package/lib/context-url.js.map +1 -0
- package/lib/context-url.spec.d.ts +14 -0
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +109 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +1 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +4 -4
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.d.ts.map +1 -1
- package/lib/encryption/container-module.js +5 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.js +25 -26
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.d.ts.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -37
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts.map +1 -1
- package/lib/encryption/encryption-service.js +30 -44
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.d.ts.map +1 -1
- package/lib/encryption/key-provider.js +31 -38
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +0 -6
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +7 -27
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.d.ts.map +1 -1
- package/lib/gitpod-file-parser.js +26 -42
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +145 -142
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +180 -33
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +194 -273
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +9 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +6 -8
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +5 -1
- package/lib/ide-frontend-service.d.ts.map +1 -1
- package/lib/ide-protocol.d.ts +105 -0
- package/lib/ide-protocol.d.ts.map +1 -0
- package/lib/{util/without.js → ide-protocol.js} +2 -2
- package/lib/ide-protocol.js.map +1 -0
- package/lib/index.d.ts +16 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/installation-admin-protocol.d.ts +27 -0
- package/lib/installation-admin-protocol.d.ts.map +1 -0
- package/lib/installation-admin-protocol.js +30 -0
- package/lib/installation-admin-protocol.js.map +1 -0
- package/lib/license-protocol.d.ts +7 -0
- package/lib/license-protocol.d.ts.map +1 -1
- package/lib/license-protocol.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +184 -34
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.d.ts +4 -4
- package/lib/messaging/browser/window-connection.d.ts.map +1 -1
- package/lib/messaging/browser/window-connection.js +42 -59
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/error.d.ts +6 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +12 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/handler.js +1 -1
- package/lib/messaging/node/connection.d.ts +1 -17
- package/lib/messaging/node/connection.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +24 -60
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +3 -1
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +75 -162
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/oss-allowlist.d.ts +14 -0
- package/lib/oss-allowlist.d.ts.map +1 -0
- package/lib/oss-allowlist.js +8 -0
- package/lib/oss-allowlist.js.map +1 -0
- package/lib/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +10 -3
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +41 -31
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +605 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +196 -83
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +264 -200
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +91 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +74 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +118 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +30 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/typings/globals.d.ts +2 -2
- package/lib/typings/globals.d.ts.map +1 -1
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +88 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.d.ts.map +1 -1
- package/lib/util/async-iterator.js +57 -135
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js +17 -59
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +11 -11
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.d.ts.map +1 -1
- package/lib/util/disposable.js +27 -40
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.d.ts.map +1 -1
- package/lib/util/event.js +63 -77
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.d.ts +1 -0
- package/lib/util/garbage-collected-cache.d.ts.map +1 -1
- package/lib/util/garbage-collected-cache.js +27 -47
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +6 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +469 -502
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +68 -78
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +41 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -2
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +108 -109
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +7 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +113 -31
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/jaeger-client-types.d.ts +68 -0
- package/lib/util/jaeger-client-types.d.ts.map +1 -0
- package/lib/{theia-plugins.js → util/jaeger-client-types.js} +1 -1
- package/lib/util/jaeger-client-types.js.map +1 -0
- package/lib/util/logging.d.ts +49 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +125 -129
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +5 -5
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +10 -0
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +31 -7
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +4 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +123 -84
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.js +16 -55
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.js +147 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeat.d.ts +15 -0
- package/lib/util/repeat.d.ts.map +1 -0
- package/lib/util/repeat.js +55 -0
- package/lib/util/repeat.js.map +1 -0
- package/lib/util/semaphore.d.ts.map +1 -1
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.d.ts.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.d.ts +1 -0
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +35 -17
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.d.ts.map +1 -1
- package/lib/util/timeutil.spec.js +21 -24
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.d.ts +52 -6
- package/lib/util/tracing.d.ts.map +1 -1
- package/lib/util/tracing.js +197 -64
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/tracing.spec.d.ts +7 -0
- package/lib/util/tracing.spec.d.ts.map +1 -0
- package/lib/util/tracing.spec.js +121 -0
- package/lib/util/tracing.spec.js.map +1 -0
- package/lib/util/workspace-port-authentication.d.ts +7 -7
- package/lib/util/workspace-port-authentication.d.ts.map +1 -1
- package/lib/util/workspace-port-authentication.js +10 -12
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +76 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +31 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +45 -5
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.d.ts.map +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +32 -18
- package/pkg-yarn.lock +18 -10
- package/provenance-bundle.jsonl +2 -0
- package/src/accounting-protocol.ts +241 -0
- package/src/admin-protocol.ts +70 -19
- package/src/analytics.ts +52 -0
- package/src/auth.ts +2 -2
- package/src/context-url.spec.ts +67 -0
- package/src/context-url.ts +109 -0
- package/src/email-protocol.ts +5 -7
- package/src/encryption/container-module.ts +2 -3
- package/src/encryption/encryption-engine.spec.ts +9 -8
- package/src/encryption/encryption-engine.ts +14 -14
- package/src/encryption/encryption-service.ts +4 -5
- package/src/encryption/key-provider.ts +16 -19
- package/src/env.ts +0 -22
- package/src/gitpod-file-parser.spec.ts +55 -61
- package/src/gitpod-file-parser.ts +16 -17
- package/src/gitpod-service.ts +348 -110
- package/src/headless-workspace-log.ts +12 -14
- package/src/ide-frontend-service.ts +6 -2
- package/src/ide-protocol.ts +119 -0
- package/src/index.ts +16 -10
- package/src/installation-admin-protocol.ts +42 -0
- package/src/license-protocol.ts +12 -6
- package/src/messaging/browser/connection.ts +197 -18
- package/src/messaging/browser/window-connection.ts +39 -29
- package/src/messaging/client-call-metrics.ts +96 -0
- package/src/messaging/error.ts +18 -5
- package/src/messaging/handler.ts +13 -1
- package/src/messaging/node/connection.ts +23 -70
- package/src/messaging/proxy-factory.ts +35 -34
- package/src/oss-allowlist.ts +15 -0
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +42 -33
- package/src/plans.ts +679 -0
- package/src/protocol.ts +493 -275
- package/src/snapshot-url.spec.ts +27 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +147 -0
- package/src/teams-projects-protocol.ts +153 -0
- package/src/typings/globals.ts +4 -4
- package/src/util/analytics.ts +109 -0
- package/src/util/async-iterator.ts +4 -5
- package/src/util/cancelable.ts +3 -3
- package/src/util/date-time.ts +8 -8
- package/src/util/deferred.ts +6 -6
- package/src/util/disposable.ts +3 -6
- package/src/util/event.ts +9 -11
- package/src/util/garbage-collected-cache.ts +11 -8
- package/src/util/generate-workspace-id.spec.ts +37 -10
- package/src/util/generate-workspace-id.ts +464 -438
- package/src/util/gitpod-cookie.ts +38 -0
- package/src/util/gitpod-host-url.spec.ts +59 -8
- package/src/util/gitpod-host-url.ts +52 -40
- package/src/util/grpc.ts +15 -0
- package/src/util/jaeger-client-types.ts +102 -0
- package/src/util/logging.ts +145 -72
- package/src/util/make-link.ts +6 -7
- package/src/util/parse-workspace-id.spec.ts +37 -8
- package/src/util/parse-workspace-id.ts +32 -7
- package/src/util/queue.spec.ts +28 -26
- package/src/util/repeat.ts +45 -0
- package/src/util/semaphore.ts +6 -8
- package/src/util/skip-if.ts +10 -7
- package/src/util/timeutil.spec.ts +14 -15
- package/src/util/timeutil.ts +25 -15
- package/src/util/tracing.spec.ts +88 -0
- package/src/util/tracing.ts +200 -31
- package/src/util/workspace-port-authentication.ts +10 -13
- package/src/workspace-cluster.ts +107 -0
- package/src/workspace-instance.ts +98 -31
- package/src/wsready.ts +3 -3
- package/data/builtin-theia-plugins.json +0 -372
- package/lib/messaging/connection-error-handler.d.ts +0 -27
- package/lib/messaging/connection-error-handler.d.ts.map +0 -1
- package/lib/messaging/connection-error-handler.js +0 -46
- package/lib/messaging/connection-error-handler.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.map +0 -1
- package/lib/util/context-url.d.ts +0 -13
- package/lib/util/context-url.d.ts.map +0 -1
- package/lib/util/context-url.js +0 -26
- package/lib/util/context-url.js.map +0 -1
- package/lib/util/context-url.spec.d.ts +0 -10
- package/lib/util/context-url.spec.d.ts.map +0 -1
- package/lib/util/context-url.spec.js +0 -52
- package/lib/util/context-url.spec.js.map +0 -1
- package/lib/util/repeater.d.ts +0 -22
- package/lib/util/repeater.d.ts.map +0 -1
- package/lib/util/repeater.js +0 -118
- package/lib/util/repeater.js.map +0 -1
- package/lib/util/safe-promise.d.ts +0 -11
- package/lib/util/safe-promise.d.ts.map +0 -1
- package/lib/util/safe-promise.js +0 -34
- package/lib/util/safe-promise.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/messaging/connection-error-handler.ts +0 -62
- package/src/theia-plugins.ts +0 -11
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
- package/src/util/jaeger-client.d.ts +0 -105
- package/src/util/repeater.ts +0 -49
- package/src/util/safe-promise.ts +0 -26
|
@@ -15,45 +15,37 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.t = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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();
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return keyBuffer.toString().trim();
|
|
33
|
-
},
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
|
-
;
|
|
38
|
-
TestEncryptionEngineImpl.prototype.basicSymmetry = function () {
|
|
39
|
-
var plaintext = "12345678901234567890";
|
|
40
|
-
var key = new Buffer(this.testkey, 'base64');
|
|
41
|
-
var cut = new encryption_engine_1.EncryptionEngineImpl();
|
|
42
|
-
var encryptedData = cut.encrypt(plaintext, key);
|
|
31
|
+
basicSymmetry() {
|
|
32
|
+
const plaintext = "12345678901234567890";
|
|
33
|
+
const key = new Buffer(this.testkey, "base64");
|
|
34
|
+
const cut = new encryption_engine_1.EncryptionEngineImpl();
|
|
35
|
+
const encryptedData = cut.encrypt(plaintext, key);
|
|
43
36
|
expect(encryptedData).to.be.not.undefined;
|
|
44
|
-
|
|
37
|
+
const decryptedPlaintext = cut.decrypt(encryptedData, key);
|
|
45
38
|
expect(decryptedPlaintext).equals(plaintext);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}());
|
|
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);
|
|
58
50
|
exports.t = new TestEncryptionEngineImpl();
|
|
59
51
|
//# sourceMappingURL=encryption-engine.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-engine.spec.js","sourceRoot":"","sources":["../../src/encryption/encryption-engine.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
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,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAE/C,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 +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"}
|
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
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);
|
|
@@ -26,42 +15,39 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
26
15
|
};
|
|
27
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
17
|
exports.EncryptionServiceImpl = exports.EncryptionService = void 0;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.EncryptionService = Symbol(
|
|
33
|
-
|
|
34
|
-
|
|
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 });
|
|
35
28
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var encryptedData = this.engine.encrypt(dataStr, key.material);
|
|
40
|
-
return __assign(__assign({}, encryptedData), { keyMetadata: key.metadata });
|
|
41
|
-
};
|
|
42
|
-
EncryptionServiceImpl.prototype.decrypt = function (encrypted) {
|
|
43
|
-
var key = this.keyProvider.getKeyFor(encrypted.keyMetadata);
|
|
44
|
-
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);
|
|
45
32
|
return this.deserialize(serializedData);
|
|
46
|
-
}
|
|
47
|
-
|
|
33
|
+
}
|
|
34
|
+
serialize(data) {
|
|
48
35
|
return JSON.stringify(data);
|
|
49
|
-
}
|
|
50
|
-
|
|
36
|
+
}
|
|
37
|
+
deserialize(data) {
|
|
51
38
|
return JSON.parse(data);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}());
|
|
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);
|
|
66
52
|
exports.EncryptionServiceImpl = EncryptionServiceImpl;
|
|
67
53
|
//# sourceMappingURL=encryption-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption-service.js","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"encryption-service.js","sourceRoot":"","sources":["../../src/encryption/encryption-service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,yCAA+C;AAE/C,2DAAsE;AACtE,iDAA0D;AAM7C,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAO7D,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAI9B,OAAO,CAAI,IAAO;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;QAE7C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjE,uCACO,aAAa,KAChB,WAAW,EAAE,GAAG,CAAC,QAAQ,IAC3B;IACN,CAAC;IAED,OAAO,CAAI,SAAuB;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QAC9D,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpE,OAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAC5C,CAAC;IAES,SAAS,CAAC,IAAS;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAES,WAAW,CAAI,IAAY;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;IACjC,CAAC;CACJ,CAAA;AA3B6B;IAAzB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;;qDAA6C;AACjD;IAApB,IAAA,kBAAM,EAAC,0BAAW,CAAC;;0DAA6C;AAFxD,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CA4BjC;AA5BY,sDAAqB"}
|
|
@@ -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,
|
|
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,CAAC;CACnB;AAED,MAAM,WAAW,GAAG;IAChB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CACpB;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,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,qBACa,eAAgB,YAAW,WAAW;IASR,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB;IARnF,MAAM,CAAC,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE;gBAQR,MAAM,EAAE,iBAAiB;IAEnF,SAAS,KAAK,IAAI,gBAEjB;IAED,aAAa,IAAI,GAAG;IAQpB,SAAS,CAAC,QAAQ,EAAE,WAAW,GAAG,GAAG;IAQrC,SAAS,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,GAAG;CAShD"}
|
|
@@ -18,58 +18,51 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.KeyProviderImpl = exports.KeyProviderConfig = exports.KeyProvider = void 0;
|
|
21
|
-
|
|
22
|
-
exports.KeyProvider = Symbol(
|
|
23
|
-
exports.KeyProviderConfig = Symbol(
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const inversify_1 = require("inversify");
|
|
22
|
+
exports.KeyProvider = Symbol("KeyProvider");
|
|
23
|
+
exports.KeyProviderConfig = Symbol("KeyProviderConfig");
|
|
24
|
+
let KeyProviderImpl = class KeyProviderImpl {
|
|
25
|
+
constructor(config) {
|
|
26
26
|
this.config = config;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!Array.isArray(keys)
|
|
31
|
-
|
|
32
|
-
|| 1 !== keys.reduce(function (p, k) { return k.primary ? p + 1 : p; }, 0)) {
|
|
33
|
-
throw new Error('Invalid key config!');
|
|
28
|
+
static loadKeyConfigFromJsonString(configStr) {
|
|
29
|
+
const keys = (JSON.parse(configStr) || []);
|
|
30
|
+
if (!Array.isArray(keys) || keys.length < 0 || 1 !== keys.reduce((p, k) => (k.primary ? p + 1 : p), 0)) {
|
|
31
|
+
throw new Error("Invalid key config!");
|
|
34
32
|
}
|
|
35
33
|
return keys;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
configurable: true
|
|
43
|
-
});
|
|
44
|
-
KeyProviderImpl.prototype.getPrimaryKey = function () {
|
|
45
|
-
var primaryKey = this.keys.find(function (key) { return !!key.primary; });
|
|
34
|
+
}
|
|
35
|
+
get keys() {
|
|
36
|
+
return this.config.keys;
|
|
37
|
+
}
|
|
38
|
+
getPrimaryKey() {
|
|
39
|
+
const primaryKey = this.keys.find((key) => !!key.primary);
|
|
46
40
|
if (!primaryKey) {
|
|
47
|
-
throw new Error(
|
|
41
|
+
throw new Error("No primary encryption key found!");
|
|
48
42
|
}
|
|
49
43
|
return this.configToKey(primaryKey);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
}
|
|
45
|
+
getKeyFor(metadata) {
|
|
46
|
+
const key = this.keys.find((k) => k.name === metadata.name && k.version === metadata.version);
|
|
53
47
|
if (!key) {
|
|
54
|
-
throw new Error(
|
|
48
|
+
throw new Error(`No key found for metadata ${metadata.name}/${metadata.version}`);
|
|
55
49
|
}
|
|
56
50
|
return this.configToKey(key);
|
|
57
|
-
}
|
|
58
|
-
|
|
51
|
+
}
|
|
52
|
+
configToKey(config) {
|
|
59
53
|
return {
|
|
60
54
|
metadata: {
|
|
61
55
|
name: config.name,
|
|
62
|
-
version: config.version
|
|
56
|
+
version: config.version,
|
|
63
57
|
},
|
|
64
|
-
material: new Buffer(config.material,
|
|
58
|
+
material: new Buffer(config.material, "base64"),
|
|
65
59
|
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}());
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
KeyProviderImpl = __decorate([
|
|
63
|
+
(0, inversify_1.injectable)(),
|
|
64
|
+
__param(0, (0, inversify_1.inject)(exports.KeyProviderConfig)),
|
|
65
|
+
__metadata("design:paramtypes", [Object])
|
|
66
|
+
], KeyProviderImpl);
|
|
74
67
|
exports.KeyProviderImpl = KeyProviderImpl;
|
|
75
68
|
//# sourceMappingURL=key-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-provider.js","sourceRoot":"","sources":["../../src/encryption/key-provider.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"key-provider.js","sourceRoot":"","sources":["../../src/encryption/key-provider.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;AAEH,yCAA+C;AAYlC,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAYpC,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAM7D,IAAa,eAAe,GAA5B,MAAa,eAAe;IASxB,YAA0D,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IARvF,MAAM,CAAC,2BAA2B,CAAC,SAAiB;QAChD,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAgB,CAAC;QAC1D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YACpG,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SAC1C;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAID,IAAc,IAAI;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,aAAa;QACT,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,UAAU,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACvD;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,QAAqB;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9F,IAAI,CAAC,GAAG,EAAE;YACN,MAAM,IAAI,KAAK,CAAC,6BAA6B,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;SACrF;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAES,WAAW,CAAC,MAAiB;QACnC,OAAO;YACH,QAAQ,EAAE;gBACN,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,OAAO,EAAE,MAAM,CAAC,OAAO;aAC1B;YACD,QAAQ,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;SAClD,CAAC;IACN,CAAC;CACJ,CAAA;AAxCY,eAAe;IAD3B,IAAA,sBAAU,GAAE;IAUI,WAAA,IAAA,kBAAM,EAAC,yBAAiB,CAAC,CAAA;;GAT7B,eAAe,CAwC3B;AAxCY,0CAAe"}
|
package/lib/env.d.ts
CHANGED
|
@@ -4,13 +4,7 @@
|
|
|
4
4
|
* See License-AGPL.txt in the project root for license information.
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class AbstractComponentEnv {
|
|
7
|
-
readonly kubeStage: KubeStage;
|
|
8
|
-
readonly kubeNamespace: string;
|
|
9
|
-
readonly version: string;
|
|
10
|
-
readonly installationLongname: string;
|
|
11
|
-
readonly installationShortname: string;
|
|
12
7
|
}
|
|
13
|
-
export declare type KubeStage = 'production' | 'prodcopy' | 'staging' | 'dev';
|
|
14
8
|
export declare function getEnvVar(name: string, defaultValue?: string): string;
|
|
15
9
|
export declare function filePathTelepresenceAware(filePath: string): string;
|
|
16
10
|
export declare function getEnvVarParsed<T>(name: string, parser: (value: string) => T, defaultValue?: string): T;
|
package/lib/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,8BACsB,oBAAoB;CACzC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAMrE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAEvG"}
|
package/lib/env.js
CHANGED
|
@@ -12,37 +12,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.getEnvVarParsed = exports.filePathTelepresenceAware = exports.getEnvVar = exports.AbstractComponentEnv = void 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"production": "production",
|
|
18
|
-
"staging": "prodcopy",
|
|
19
|
-
"devstaging": "dev",
|
|
20
|
-
"dev": "dev"
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
let AbstractComponentEnv = class AbstractComponentEnv {
|
|
21
17
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var stage = legacyStagenameTranslation[kubeStage];
|
|
26
|
-
if (!stage) {
|
|
27
|
-
throw new Error("Environment variable invalid: KUBE_STAGE=" + kubeStage);
|
|
28
|
-
}
|
|
29
|
-
return stage;
|
|
30
|
-
});
|
|
31
|
-
this.kubeNamespace = getEnvVar('KUBE_NAMESPACE');
|
|
32
|
-
this.version = getEnvVar('VERSION');
|
|
33
|
-
this.installationLongname = getEnvVar("GITPOD_INSTALLATION_LONGNAME");
|
|
34
|
-
this.installationShortname = getEnvVar("GITPOD_INSTALLATION_SHORTNAME");
|
|
35
|
-
}
|
|
36
|
-
AbstractComponentEnv = __decorate([
|
|
37
|
-
inversify_1.injectable()
|
|
38
|
-
], AbstractComponentEnv);
|
|
39
|
-
return AbstractComponentEnv;
|
|
40
|
-
}());
|
|
18
|
+
AbstractComponentEnv = __decorate([
|
|
19
|
+
(0, inversify_1.injectable)()
|
|
20
|
+
], AbstractComponentEnv);
|
|
41
21
|
exports.AbstractComponentEnv = AbstractComponentEnv;
|
|
42
22
|
function getEnvVar(name, defaultValue) {
|
|
43
|
-
|
|
23
|
+
const value = process.env[name] || defaultValue;
|
|
44
24
|
if (!value) {
|
|
45
|
-
throw new Error(
|
|
25
|
+
throw new Error(`Environment variable undefined or empty: ${name}`);
|
|
46
26
|
}
|
|
47
27
|
return value;
|
|
48
28
|
}
|
package/lib/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,yCAAuC;AAGvC,IAAsB,oBAAoB,GAA1C,MAAsB,oBAAoB;CACzC,CAAA;AADqB,oBAAoB;IADzC,IAAA,sBAAU,GAAE;GACS,oBAAoB,CACzC;AADqB,oDAAoB;AAG1C,SAAgB,SAAS,CAAC,IAAY,EAAE,YAAqB;IACzD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC;IAChD,IAAI,CAAC,KAAK,EAAE;QACR,MAAM,IAAI,KAAK,CAAC,4CAA4C,IAAI,EAAE,CAAC,CAAC;KACvE;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAND,8BAMC;AAED,SAAgB,yBAAyB,CAAC,QAAgB;IACtD,IAAI,QAAQ,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;QAC3C,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,QAAQ,CAAC;KACvD;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AALD,8DAKC;AAED,SAAgB,eAAe,CAAI,IAAY,EAAE,MAA4B,EAAE,YAAqB;IAChG,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,0CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.d.ts","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAE9D,oBAAY,WAAW,GAAG,eAAe,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"gitpod-file-parser.d.ts","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AAE9D,oBAAY,WAAW,GAAG,eAAe,GAAG,SAAS,CAAC;AAQtD,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,qBACa,gBAAgB;IAClB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,KAAK,EAAE,aAAa,GAAE,eAAoB,GAAG,WAAW;CAoCrG"}
|
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
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);
|
|
@@ -23,55 +12,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
12
|
};
|
|
24
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
14
|
exports.GitpodFileParser = void 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
const yaml = require("js-yaml");
|
|
17
|
+
const Ajv = require("ajv");
|
|
18
|
+
const logging_1 = require("./util/logging");
|
|
19
|
+
const protocol_1 = require("./protocol");
|
|
20
|
+
const schema = require("../data/gitpod-schema.json");
|
|
21
|
+
const validate = new Ajv().compile(schema);
|
|
22
|
+
const defaultParseOptions = {
|
|
34
23
|
acceptPortRanges: false,
|
|
35
24
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
GitpodFileParser.prototype.parse = function (content, parseOptions, defaultConfig) {
|
|
40
|
-
if (parseOptions === void 0) { parseOptions = {}; }
|
|
41
|
-
if (defaultConfig === void 0) { defaultConfig = {}; }
|
|
42
|
-
var options = __assign(__assign({}, defaultParseOptions), parseOptions);
|
|
25
|
+
let GitpodFileParser = class GitpodFileParser {
|
|
26
|
+
parse(content, parseOptions = {}, defaultConfig = {}) {
|
|
27
|
+
const options = Object.assign(Object.assign({}, defaultParseOptions), parseOptions);
|
|
43
28
|
try {
|
|
44
|
-
|
|
29
|
+
const parsedConfig = yaml.safeLoad(content);
|
|
45
30
|
validate(parsedConfig);
|
|
46
|
-
|
|
31
|
+
const validationErrors = validate.errors ? validate.errors.map((e) => e.message || e.keyword) : undefined;
|
|
47
32
|
if (validationErrors && validationErrors.length > 0) {
|
|
48
33
|
return {
|
|
49
34
|
config: defaultConfig,
|
|
50
|
-
parsedConfig
|
|
51
|
-
validationErrors
|
|
35
|
+
parsedConfig,
|
|
36
|
+
validationErrors,
|
|
52
37
|
};
|
|
53
38
|
}
|
|
54
|
-
|
|
39
|
+
const overrides = {};
|
|
55
40
|
if (!options.acceptPortRanges && Array.isArray(parsedConfig.ports)) {
|
|
56
|
-
overrides.ports = parsedConfig.ports.filter(
|
|
41
|
+
overrides.ports = parsedConfig.ports.filter((port) => !protocol_1.PortRangeConfig.is(port));
|
|
57
42
|
}
|
|
58
43
|
return {
|
|
59
|
-
config:
|
|
60
|
-
parsedConfig
|
|
44
|
+
config: Object.assign(Object.assign(Object.assign({}, defaultConfig), parsedConfig), overrides),
|
|
45
|
+
parsedConfig,
|
|
61
46
|
};
|
|
62
47
|
}
|
|
63
48
|
catch (err) {
|
|
64
|
-
logging_1.log.error(
|
|
49
|
+
logging_1.log.error("Unparsable Gitpod configuration", err, { content });
|
|
65
50
|
return {
|
|
66
51
|
config: defaultConfig,
|
|
67
|
-
validationErrors: [
|
|
52
|
+
validationErrors: ["Unparsable Gitpod configuration: " + err.toString()],
|
|
68
53
|
};
|
|
69
54
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}());
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
GitpodFileParser = __decorate([
|
|
58
|
+
(0, inversify_1.injectable)()
|
|
59
|
+
], GitpodFileParser);
|
|
76
60
|
exports.GitpodFileParser = GitpodFileParser;
|
|
77
61
|
//# sourceMappingURL=gitpod-file-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.js","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":";AAAA;;;;GAIG
|
|
1
|
+
{"version":3,"file":"gitpod-file-parser.js","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;AAEH,yCAAuC;AACvC,gCAAgC;AAChC,2BAA2B;AAC3B,4CAAqC;AACrC,yCAA8D;AAI9D,MAAM,MAAM,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AACrD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,mBAAmB,GAAG;IACxB,gBAAgB,EAAE,KAAK;CAC1B,CAAC;AASF,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAClB,KAAK,CAAC,OAAe,EAAE,YAAY,GAAG,EAAE,EAAE,gBAAiC,EAAE;QAChF,MAAM,OAAO,mCACN,mBAAmB,GACnB,YAAY,CAClB,CAAC;QACF,IAAI;YACA,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAQ,CAAC;YACnD,QAAQ,CAAC,YAAY,CAAC,CAAC;YACvB,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1G,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;gBACjD,OAAO;oBACH,MAAM,EAAE,aAAa;oBACrB,YAAY;oBACZ,gBAAgB;iBACnB,CAAC;aACL;YACD,MAAM,SAAS,GAAG,EAAS,CAAC;YAC5B,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;gBAChE,SAAS,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,0BAAe,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;aACzF;YACD,OAAO;gBACH,MAAM,gDACC,aAAa,GACb,YAAY,GACZ,SAAS,CACf;gBACD,YAAY;aACf,CAAC;SACL;QAAC,OAAO,GAAG,EAAE;YACV,aAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YAC/D,OAAO;gBACH,MAAM,EAAE,aAAa;gBACrB,gBAAgB,EAAE,CAAC,mCAAmC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC3E,CAAC;SACL;IACL,CAAC;CACJ,CAAA;AArCY,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAqC5B;AArCY,4CAAgB"}
|