@gitpod/gitpod-protocol 0.1.5-me-test04251.0 → 0.1.5-me-fixheader.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 +73 -115
- package/lib/accounting-protocol.d.ts +9 -1
- package/lib/accounting-protocol.d.ts.map +1 -1
- package/lib/accounting-protocol.js +13 -2
- package/lib/accounting-protocol.js.map +1 -1
- package/lib/admin-protocol.d.ts +8 -1
- 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.js +1 -1
- package/lib/attribution.d.ts +23 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +50 -0
- package/lib/attribution.js.map +1 -0
- package/lib/auth.d.ts +1 -1
- package/lib/auth.js +1 -1
- package/lib/billing-mode.d.ts +41 -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 -1
- package/lib/context-url.js +2 -2
- package/lib/context-url.js.map +1 -1
- package/lib/context-url.spec.d.ts +1 -1
- package/lib/context-url.spec.js +1 -1
- package/lib/encryption/container-module.d.ts +1 -1
- package/lib/encryption/container-module.js +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 +4 -4
- 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.js +2 -2
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.d.ts +1 -1
- package/lib/encryption/encryption-service.js +1 -1
- package/lib/encryption/key-provider.d.ts +1 -1
- package/lib/encryption/key-provider.js +2 -2
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -1
- package/lib/env.js +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 +36 -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/gitpod-file-parser.d.ts +1 -1
- package/lib/gitpod-file-parser.js +1 -1
- package/lib/gitpod-file-parser.spec.d.ts +1 -1
- package/lib/gitpod-file-parser.spec.js +1 -1
- package/lib/gitpod-service.d.ts +40 -22
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +22 -9
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +1 -1
- package/lib/headless-workspace-log.js +1 -1
- package/lib/ide-frontend-service.d.ts +1 -1
- package/lib/ide-frontend-service.js +1 -1
- package/lib/ide-protocol.d.ts +9 -1
- package/lib/ide-protocol.d.ts.map +1 -1
- package/lib/ide-protocol.js +1 -1
- package/lib/index.d.ts +2 -2
- 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 +2 -1
- 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/window-connection.d.ts +1 -1
- package/lib/messaging/browser/window-connection.js +1 -1
- package/lib/messaging/client-call-metrics.d.ts +2 -18
- package/lib/messaging/client-call-metrics.d.ts.map +1 -1
- package/lib/messaging/client-call-metrics.js +2 -3
- package/lib/messaging/client-call-metrics.js.map +1 -1
- package/lib/messaging/error.d.ts +7 -2
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +14 -4
- package/lib/messaging/error.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.js +1 -1
- package/lib/permission.d.ts +1 -1
- package/lib/permission.js +1 -1
- package/lib/plans.d.ts +2 -1
- package/lib/plans.d.ts.map +1 -1
- package/lib/plans.js +7 -3
- package/lib/plans.js.map +1 -1
- package/lib/protocol.d.ts +112 -21
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +175 -12
- 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/team-subscription-protocol.d.ts +18 -1
- package/lib/team-subscription-protocol.d.ts.map +1 -1
- package/lib/team-subscription-protocol.js +17 -2
- package/lib/team-subscription-protocol.js.map +1 -1
- package/lib/teams-projects-protocol.d.ts +15 -2
- package/lib/teams-projects-protocol.d.ts.map +1 -1
- package/lib/teams-projects-protocol.js +1 -1
- package/lib/teams-projects-protocol.js.map +1 -1
- package/lib/typings/globals.d.ts +1 -1
- package/lib/typings/globals.js +1 -1
- package/lib/usage.d.ts +61 -0
- package/lib/usage.d.ts.map +1 -0
- package/lib/usage.js +14 -0
- package/lib/usage.js.map +1 -0
- package/lib/util/analytics.d.ts +1 -1
- package/lib/util/analytics.js +1 -1
- package/lib/util/async-iterator.d.ts +1 -1
- package/lib/util/async-iterator.js +1 -1
- package/lib/util/cancelable.d.ts +1 -1
- package/lib/util/cancelable.js +1 -1
- package/lib/util/date-time.d.ts +1 -1
- package/lib/util/date-time.js +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/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 +6 -1
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts +1 -1
- package/lib/util/generate-workspace-id.js +1 -1
- package/lib/util/generate-workspace-id.spec.d.ts +1 -1
- package/lib/util/generate-workspace-id.spec.js +1 -1
- package/lib/util/gitpod-cookie.d.ts +1 -1
- package/lib/util/gitpod-cookie.js +1 -1
- package/lib/util/gitpod-host-url.d.ts +4 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +19 -1
- 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.js +1 -1
- package/lib/util/grpc.d.ts +20 -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.js +1 -1
- package/lib/util/logging.d.ts +1 -1
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +9 -2
- 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 +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 +119 -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.js +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +1 -1
- package/lib/util/parse-workspace-id.spec.js +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 +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.js +1 -1
- package/lib/util/skip-if.d.ts +1 -1
- package/lib/util/skip-if.js +1 -1
- package/lib/util/timeutil.d.ts +3 -1
- package/lib/util/timeutil.d.ts.map +1 -1
- package/lib/util/timeutil.js +14 -2
- 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 +1 -1
- package/lib/util/tracing.js +1 -1
- package/lib/util/tracing.spec.d.ts +1 -1
- package/lib/util/tracing.spec.js +1 -1
- package/lib/util/workspace-port-authentication.d.ts +1 -1
- package/lib/util/workspace-port-authentication.js +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 +7 -8
- package/lib/workspace-cluster.d.ts.map +1 -1
- package/lib/workspace-cluster.js +1 -1
- package/lib/workspace-cluster.js.map +1 -1
- package/lib/workspace-instance.d.ts +14 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/workspace-instance.js +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +14 -6
- package/pkg-yarn.lock +10 -5
- package/provenance-bundle.jsonl +1 -1
- package/src/accounting-protocol.ts +14 -1
- package/src/admin-protocol.ts +11 -1
- package/src/analytics.ts +1 -1
- package/src/attribution.ts +59 -0
- package/src/auth.ts +1 -1
- package/src/billing-mode.ts +77 -0
- package/src/blocked-repositories-protocol.ts +13 -0
- package/src/context-url.spec.ts +1 -1
- package/src/context-url.ts +2 -2
- package/src/encryption/container-module.ts +1 -1
- package/src/encryption/encryption-engine.spec.ts +2 -2
- package/src/encryption/encryption-engine.ts +8 -4
- package/src/encryption/encryption-service.ts +1 -1
- package/src/encryption/key-provider.ts +2 -2
- package/src/env.ts +1 -1
- package/src/experiments/always-default.ts +24 -0
- package/src/experiments/configcat-server.ts +41 -0
- package/src/experiments/configcat.ts +56 -0
- package/src/experiments/types.ts +34 -0
- package/src/gitpod-file-parser.spec.ts +1 -1
- package/src/gitpod-file-parser.ts +1 -1
- package/src/gitpod-service.ts +76 -30
- package/src/headless-workspace-log.ts +1 -1
- package/src/ide-frontend-service.ts +1 -1
- package/src/ide-protocol.ts +11 -1
- package/src/index.ts +2 -2
- package/src/installation-admin-protocol.ts +4 -1
- package/src/license-protocol.ts +8 -1
- package/src/messaging/browser/window-connection.ts +1 -1
- package/src/messaging/client-call-metrics.ts +2 -21
- package/src/messaging/error.ts +20 -5
- package/src/oss-allowlist.ts +1 -1
- package/src/payment-protocol.ts +1 -1
- package/src/permission.ts +1 -1
- package/src/plans.ts +7 -3
- package/src/protocol.spec.ts +97 -0
- package/src/protocol.ts +270 -27
- package/src/snapshot-url.spec.ts +1 -1
- package/src/snapshot-url.ts +1 -1
- package/src/team-subscription-protocol.ts +28 -1
- package/src/teams-projects-protocol.ts +16 -2
- package/src/typings/globals.ts +1 -1
- package/src/usage.ts +71 -0
- package/src/util/analytics.ts +1 -1
- package/src/util/async-iterator.ts +1 -1
- package/src/util/cancelable.ts +1 -1
- package/src/util/date-time.ts +1 -1
- package/src/util/debug-app.ts +81 -0
- package/src/util/deep-partial.ts +1 -1
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +6 -1
- package/src/util/generate-workspace-id.spec.ts +1 -1
- package/src/util/generate-workspace-id.ts +1 -1
- package/src/util/gitpod-cookie.ts +1 -1
- package/src/util/gitpod-host-url.spec.ts +1 -1
- package/src/util/gitpod-host-url.ts +22 -1
- package/src/util/grpc.ts +90 -1
- package/src/util/jaeger-client-types.ts +1 -1
- package/src/util/logging.spec.ts +23 -0
- package/src/util/logging.ts +12 -3
- package/src/util/make-link.ts +1 -1
- package/src/util/nice-grpc.ts +93 -0
- package/src/util/parse-workspace-id.spec.ts +1 -1
- package/src/util/parse-workspace-id.ts +1 -1
- package/src/util/queue.spec.ts +1 -1
- package/src/util/queue.ts +1 -1
- package/src/util/repeat.ts +1 -1
- package/src/util/semaphore.ts +1 -1
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.spec.ts +29 -2
- package/src/util/timeutil.ts +13 -1
- package/src/util/tracing.spec.ts +1 -1
- package/src/util/tracing.ts +1 -1
- package/src/util/workspace-port-authentication.ts +1 -1
- package/src/webhook-event.ts +55 -0
- package/src/workspace-class.ts +14 -0
- package/src/workspace-cluster.ts +7 -5
- package/src/workspace-instance.ts +26 -2
- package/src/wsready.ts +2 -2
- 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/src/email-protocol.ts +0 -65
|
@@ -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
|
|
|
7
7
|
import { Message } from "vscode-jsonrpc/lib/messages";
|
|
@@ -1,31 +1,12 @@
|
|
|
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
|
|
|
7
7
|
import { injectable } from "inversify";
|
|
8
8
|
import * as prometheusClient from "prom-client";
|
|
9
|
-
|
|
10
|
-
type GrpcMethodType = "unary" | "client_stream" | "server_stream" | "bidi_stream";
|
|
11
|
-
export interface IGrpcCallMetricsLabels {
|
|
12
|
-
service: string;
|
|
13
|
-
method: string;
|
|
14
|
-
type: GrpcMethodType;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface IGrpcCallMetricsLabelsWithCode extends IGrpcCallMetricsLabels {
|
|
18
|
-
code: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const IClientCallMetrics = Symbol("IClientCallMetrics");
|
|
22
|
-
|
|
23
|
-
export interface IClientCallMetrics {
|
|
24
|
-
started(labels: IGrpcCallMetricsLabels): void;
|
|
25
|
-
sent(labels: IGrpcCallMetricsLabels): void;
|
|
26
|
-
received(labels: IGrpcCallMetricsLabels): void;
|
|
27
|
-
handled(labels: IGrpcCallMetricsLabelsWithCode): void;
|
|
28
|
-
}
|
|
9
|
+
import { IClientCallMetrics, IGrpcCallMetricsLabels, IGrpcCallMetricsLabelsWithCode } from "../util/grpc";
|
|
29
10
|
|
|
30
11
|
@injectable()
|
|
31
12
|
export class PrometheusClientCallMetrics implements IClientCallMetrics {
|
package/src/messaging/error.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
|
|
|
7
7
|
export namespace ErrorCodes {
|
|
@@ -26,21 +26,30 @@ export namespace ErrorCodes {
|
|
|
26
26
|
// 410 No User
|
|
27
27
|
export const SETUP_REQUIRED = 410;
|
|
28
28
|
|
|
29
|
+
// 411 No User
|
|
30
|
+
export const NEEDS_VERIFICATION = 411;
|
|
31
|
+
|
|
29
32
|
// 429 Too Many Requests
|
|
30
33
|
export const TOO_MANY_REQUESTS = 429;
|
|
31
34
|
|
|
32
35
|
// 430 Repository not whitelisted (custom status code)
|
|
33
36
|
export const REPOSITORY_NOT_WHITELISTED = 430;
|
|
34
37
|
|
|
38
|
+
// 450 Payment error
|
|
39
|
+
export const PAYMENT_ERROR = 450;
|
|
40
|
+
|
|
41
|
+
// 451 Out of credits
|
|
42
|
+
export const PAYMENT_SPENDING_LIMIT_REACHED = 451;
|
|
43
|
+
|
|
44
|
+
// 455 Invalid cost center (custom status code)
|
|
45
|
+
export const INVALID_COST_CENTER = 455;
|
|
46
|
+
|
|
35
47
|
// 460 Context Parse Error (custom status code)
|
|
36
48
|
export const CONTEXT_PARSE_ERROR = 460;
|
|
37
49
|
|
|
38
|
-
// 461 Invalid gitpod yml
|
|
50
|
+
// 461 Invalid gitpod yml (custom status code)
|
|
39
51
|
export const INVALID_GITPOD_YML = 461;
|
|
40
52
|
|
|
41
|
-
// 450 Payment error
|
|
42
|
-
export const PAYMENT_ERROR = 450;
|
|
43
|
-
|
|
44
53
|
// 470 User Blocked (custom status code)
|
|
45
54
|
export const USER_BLOCKED = 470;
|
|
46
55
|
|
|
@@ -62,6 +71,9 @@ export namespace ErrorCodes {
|
|
|
62
71
|
// 490 Too Many Running Workspace
|
|
63
72
|
export const TOO_MANY_RUNNING_WORKSPACES = 490;
|
|
64
73
|
|
|
74
|
+
// 500 Internal Server Error
|
|
75
|
+
export const INTERNAL_SERVER_ERROR = 500;
|
|
76
|
+
|
|
65
77
|
// 501 EE Feature
|
|
66
78
|
export const EE_FEATURE = 501;
|
|
67
79
|
|
|
@@ -82,4 +94,7 @@ export namespace ErrorCodes {
|
|
|
82
94
|
|
|
83
95
|
// 640 Headless logs are not available (yet)
|
|
84
96
|
export const HEADLESS_LOG_NOT_YET_AVAILABLE = 640;
|
|
97
|
+
|
|
98
|
+
// 650 Invalid Value
|
|
99
|
+
export const INVALID_VALUE = 650;
|
|
85
100
|
}
|
package/src/oss-allowlist.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
|
|
|
7
7
|
export interface OssAllowList {
|
package/src/payment-protocol.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
|
|
|
7
7
|
export namespace PaymentProtocol {
|
package/src/permission.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
|
|
|
7
7
|
// see below for explanation
|
package/src/plans.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
|
|
|
7
7
|
export type Currency = "USD" | "EUR";
|
|
@@ -131,7 +131,7 @@ export namespace Plans {
|
|
|
131
131
|
githubPlanNumber: 1,
|
|
132
132
|
|
|
133
133
|
type: "free",
|
|
134
|
-
name: "
|
|
134
|
+
name: "Free",
|
|
135
135
|
currency: "USD",
|
|
136
136
|
pricePerMonth: 0,
|
|
137
137
|
hoursPerMonth: 100,
|
|
@@ -146,7 +146,7 @@ export namespace Plans {
|
|
|
146
146
|
githubPlanNumber: 5,
|
|
147
147
|
|
|
148
148
|
type: "free-50",
|
|
149
|
-
name: "
|
|
149
|
+
name: "Free",
|
|
150
150
|
currency: "USD",
|
|
151
151
|
pricePerMonth: 0,
|
|
152
152
|
hoursPerMonth: 50,
|
|
@@ -482,6 +482,10 @@ export namespace Plans {
|
|
|
482
482
|
);
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
+
export function isFreeTier(chargebeeId: string | undefined): boolean {
|
|
486
|
+
return chargebeeId === Plans.FREE.chargebeeId || chargebeeId === Plans.FREE_50.chargebeeId;
|
|
487
|
+
}
|
|
488
|
+
|
|
485
489
|
export function isFreeNonTransientPlan(chargebeeId: string | undefined): boolean {
|
|
486
490
|
return chargebeeId === Plans.FREE_OPEN_SOURCE.chargebeeId;
|
|
487
491
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020 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
|
+
import { suite, test } from "mocha-typescript";
|
|
8
|
+
import * as chai from "chai";
|
|
9
|
+
import { SSHPublicKeyValue } from ".";
|
|
10
|
+
|
|
11
|
+
const expect = chai.expect;
|
|
12
|
+
|
|
13
|
+
@suite
|
|
14
|
+
class TestSSHPublicKeyValue {
|
|
15
|
+
private key =
|
|
16
|
+
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCnrN9UdK1bNGPmZfenTWXLuYYDjlYvZE8S+WOfP08WpR1GETzX5ZvgYOEZGwEE8KUPHC9cge4Hvo/ydIS9aqbZ5MiVGJ8cAIq1Ic89SjlDWU6fl8TwIqOPCi2imAASlEDP4q8vMLK1N6UOW1EVbxyL3uybGd10ysC1t1FxFPveIGNsYE/MOQeuEWS16AplpXYXIfVRSlgAskeBft2w8Ud3B4gNe8ECLA/FXu96UpvZkdtOarA3JZ9Z27GveNJg9Mtmmw0+US0KXiO9x9NyH7G8+mqVDwDY+nNvaFA5gtQxkkl/uY2oz9k/B4Rjlj3jOiUXe5uQs3XUm5m8g9a9fh62DabLpA2fEvtfg+a/VqNe52dNa5YjupwvBd6Inb5uMW/TYjNl6bNHPlXFKw/nwLOVzukpkjxMZUKS6+4BGkpoasj6y2rTU/wkpbdD8J7yjI1p6J9aKkC6KksIWgN7xGmHkv2PCGDqMHTNbnQyowtNKMgA/667vAYJ0qW7HAHBFXJRs6uRi/DI3+c1QV2s4wPCpEHDIYApovQ0fbON4WDPoGMyHd7kPh9xB/bX7Dj0uMXImu1pdTd62fQ/1XXX64+vjAAXS/P9RSCD0RCRt/K3LPKl2m7GPI3y1niaE52XhxZw+ms9ays6NasNVMw/ZC+f02Ti+L5FBEVf8230RVVRQ== notfound@gitpod.io";
|
|
17
|
+
|
|
18
|
+
@test public testValidate() {
|
|
19
|
+
const key = this.key;
|
|
20
|
+
const [t, k, e] = key.split(" ");
|
|
21
|
+
expect(
|
|
22
|
+
SSHPublicKeyValue.getData({
|
|
23
|
+
key,
|
|
24
|
+
name: "NiceName",
|
|
25
|
+
}),
|
|
26
|
+
).to.deep.equal({ type: t, key: k, email: e });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@test public testValidateWithDiffType() {
|
|
30
|
+
const key = this.key;
|
|
31
|
+
const [_, k, e] = key.split(" ");
|
|
32
|
+
expect(
|
|
33
|
+
SSHPublicKeyValue.getData({
|
|
34
|
+
key: key.replace("ssh-rsa", "sk-ecdsa-sha2-nistp256@openssh.com"),
|
|
35
|
+
name: "NiceName",
|
|
36
|
+
}),
|
|
37
|
+
).to.deep.equal({ type: "sk-ecdsa-sha2-nistp256@openssh.com", key: k, email: e });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@test public testValidateWithoutEmail() {
|
|
41
|
+
const key = this.key;
|
|
42
|
+
const [t, k, _] = key.split(" ");
|
|
43
|
+
expect(
|
|
44
|
+
SSHPublicKeyValue.getData({
|
|
45
|
+
key: key.replace(" notfound@gitpod.io", ""),
|
|
46
|
+
name: "NiceName",
|
|
47
|
+
}),
|
|
48
|
+
).to.deep.equal({ type: t, key: k, email: undefined });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@test public testValidateWithoutEmailButEndsWithSpaces() {
|
|
52
|
+
const key = this.key;
|
|
53
|
+
const [t, k, _] = key.split(" ");
|
|
54
|
+
expect(
|
|
55
|
+
SSHPublicKeyValue.getData({
|
|
56
|
+
key: key.replace("notfound@gitpod.io", " "),
|
|
57
|
+
name: "NiceName",
|
|
58
|
+
}),
|
|
59
|
+
).to.deep.equal({ type: t, key: k, email: undefined });
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@test public testValidateWithError() {
|
|
63
|
+
expect(() =>
|
|
64
|
+
SSHPublicKeyValue.getData({
|
|
65
|
+
key: "Hello World",
|
|
66
|
+
name: "NiceName",
|
|
67
|
+
}),
|
|
68
|
+
).throw("Key is invalid");
|
|
69
|
+
|
|
70
|
+
expect(() =>
|
|
71
|
+
SSHPublicKeyValue.getData({
|
|
72
|
+
key: "",
|
|
73
|
+
name: "NiceName",
|
|
74
|
+
}),
|
|
75
|
+
).throw("Key is invalid");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@test public testGetFingerprint() {
|
|
79
|
+
const key = this.key;
|
|
80
|
+
expect(
|
|
81
|
+
SSHPublicKeyValue.getFingerprint({
|
|
82
|
+
key,
|
|
83
|
+
name: "NiceName",
|
|
84
|
+
}),
|
|
85
|
+
).to.equal("ykjP/b5aqoa3envmXzWpPMCGgEFMu3QvubfSTNrJCMA=");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@test public testGetFingerprintWithIncorrectPublicKey() {
|
|
89
|
+
expect(() =>
|
|
90
|
+
SSHPublicKeyValue.getFingerprint({
|
|
91
|
+
key: "Hello World",
|
|
92
|
+
name: "NiceName",
|
|
93
|
+
}),
|
|
94
|
+
).to.throw("Key is invalid");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
module.exports = new TestSSHPublicKeyValue(); // Only to circumvent no usage warning :-/
|