hammerkit 2.1.0-next.8 → 2.1.0
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/build.schema.json +28 -126
- package/dist/cli.js +0 -5
- package/dist/dashboard/assets/graph-canvas-DtJSpova.js +8 -0
- package/dist/dashboard/assets/index-BndChMep.css +2 -0
- package/dist/dashboard/assets/{index-CE5PSB3y.js → index-DRSwIRXd.js} +9 -15
- package/dist/dashboard/index.html +2 -2
- package/dist/docker/item-network.js +5 -6
- package/dist/docker/remove-orphaned-containers.js +4 -5
- package/dist/environment/replace-env-variables.js +5 -8
- package/dist/environment/run-source-envs.js +1 -2
- package/dist/executer/check-readiness.js +4 -8
- package/dist/executer/deadline.js +63 -10
- package/dist/executer/docker-service.js +15 -21
- package/dist/executer/execute-work-task.js +15 -3
- package/dist/harness/sandbox-client.js +1 -0
- package/dist/harness/service-tools.js +25 -1
- package/dist/kubernetes/cluster-state.js +48 -14
- package/dist/kubernetes/ensure-kubernetes-deployment-exists.js +14 -62
- package/dist/kubernetes/ensure-persistent-data.js +14 -3
- package/dist/kubernetes/kept-claims.js +9 -12
- package/dist/kubernetes/resources.js +5 -1
- package/dist/optimizer/work-task-cache-description.js +3 -5
- package/dist/planner/image-build.js +0 -5
- package/dist/planner/service-definition.js +1 -2
- package/dist/planner/utils/append-work-service.js +4 -12
- package/dist/planner/utils/dependency-outputs.js +6 -7
- package/dist/planner/validate.js +0 -41
- package/dist/planner/work-healthcheck.js +2 -23
- package/dist/planner/work-runtime-docker.js +1 -24
- package/dist/planner/work-runtime-kubernetes.js +16 -37
- package/dist/planner/work-secret.js +11 -33
- package/dist/planner/work-service-id.js +6 -30
- package/dist/planner/work-service.js +2 -2
- package/dist/program.js +1 -19
- package/dist/remote/annotations.js +31 -11
- package/dist/remote/collect-bundle.js +3 -2
- package/dist/remote/remote-status.js +1 -1
- package/dist/remote/remote-work-commands.js +50 -7
- package/dist/schema/build-file-base-task-schema.js +1 -16
- package/dist/schema/build-file-image-build-schema.js +8 -5
- package/dist/schema/build-file-service-container-healthcheck.js +7 -25
- package/dist/schema/reference-parser.js +43 -108
- package/dist/schema/work-scope-parser.js +0 -8
- package/dist/secrets/prefetch-secrets.js +1 -20
- package/dist/server/capacity.js +6 -18
- package/dist/server/endpoints.js +52 -32
- package/dist/server/kubernetes-backend.js +28 -114
- package/dist/server/kubernetes-sandbox-storage.js +2 -3
- package/dist/server/overview.js +1 -7
- package/dist/server/plan.js +0 -8
- package/dist/server/public-paths.js +52 -0
- package/dist/server/run-request.js +52 -1
- package/dist/server/run-retry.js +6 -0
- package/dist/server/run-source-environment.js +1 -1
- package/dist/server/runs.js +6 -4
- package/dist/server/sandbox-files-api.js +12 -27
- package/dist/server/sandbox-files.js +2 -3
- package/dist/server/sandbox-pod.js +1 -1
- package/dist/server/sandboxes-api.js +14 -65
- package/dist/server/sandboxes.js +3 -19
- package/dist/server/server-config.js +2 -59
- package/dist/server/server.js +20 -8
- package/dist/server/service-runs.js +41 -8
- package/package.json +1 -1
- package/dist/dashboard/assets/graph-canvas-BFnEN5i0.js +0 -8
- package/dist/dashboard/assets/index-Dt3ITvRO.css +0 -2
- package/dist/executer/docker-healthcheck.js +0 -73
- package/dist/network/healthcheck-request.js +0 -38
- package/dist/server/borrowed-quota.js +0 -216
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mayPublishEndpoints = exports.mayOpenEndpoints = exports.getRunRepo = exports.toRunEndpoints = exports.refuseEndpoints = exports.getEndpointHosts = exports.getServiceRunName = void 0;
|
|
3
|
+
exports.mayPublishEndpoints = exports.mayOpenEndpoints = exports.getRunRepo = exports.toRunEndpoints = exports.refusePublicPaths = exports.refusePublicSecrets = exports.refuseEndpoints = exports.getEndpointHosts = exports.getServiceRunName = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
5
|
const plan_1 = require("./plan");
|
|
6
6
|
const policy_1 = require("./policy");
|
|
@@ -73,6 +73,28 @@ function refuseEndpoints(request, plan, secretNetworkOpen) {
|
|
|
73
73
|
return null;
|
|
74
74
|
}
|
|
75
75
|
exports.refuseEndpoints = refuseEndpoints;
|
|
76
|
+
/**
|
|
77
|
+
* Why the public paths of a run can not be served, or null. A public path is open without a
|
|
78
|
+
* sign-in, so a service with one may not read a secret or a credential, directly or through
|
|
79
|
+
* what it is made from or needs, whatever `runs.secretNetwork` says: the way out refuseEndpoints
|
|
80
|
+
* allows for a signed-in page does not hold for a path anybody may request.
|
|
81
|
+
*/
|
|
82
|
+
function refusePublicSecrets(request, plan) {
|
|
83
|
+
for (const { service } of request.publicPaths) {
|
|
84
|
+
for (const { name, path } of reachedFrom(service, plan)) {
|
|
85
|
+
const reads = (0, plan_1.getCredentialReads)(plan[name]);
|
|
86
|
+
if (reads.length === 0) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
// the way from the service to what reads it: `web needs api, which needs vault`
|
|
90
|
+
const way = path.map((step, index) => `${index === 0 ? '' : ', which '}${step.relation} ${step.name}`).join('');
|
|
91
|
+
const from = path.length === 0 ? `${service} reads` : `${service} ${way}, which reads`;
|
|
92
|
+
return `${from} ${reads.join(', ')}: it can not have public paths on this server, a path open without a sign-in could show it`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
exports.refusePublicSecrets = refusePublicSecrets;
|
|
76
98
|
function reachedFrom(service, plan) {
|
|
77
99
|
if (!plan[service]) {
|
|
78
100
|
return [];
|
|
@@ -96,13 +118,24 @@ function reachedFrom(service, plan) {
|
|
|
96
118
|
}
|
|
97
119
|
return reached;
|
|
98
120
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
121
|
+
// The public paths of a run must name the run they start: a run that gets another name than the
|
|
122
|
+
// one the paths were written for would publish them at endpoints the operator did not mean.
|
|
123
|
+
function refusePublicPaths(request, name) {
|
|
124
|
+
const other = request.publicPaths.find((entry) => entry.run !== name);
|
|
125
|
+
return other ? `the public paths name the run ${other.run}, but this run is ${name}` : null;
|
|
126
|
+
}
|
|
127
|
+
exports.refusePublicPaths = refusePublicPaths;
|
|
128
|
+
function toRunEndpoints(endpoints, hosts, url, publicPaths = []) {
|
|
129
|
+
return endpoints.map((endpoint, index) => {
|
|
130
|
+
const paths = publicPaths.find((entry) => entry.service === endpoint.service && entry.port === endpoint.port);
|
|
131
|
+
return {
|
|
132
|
+
service: endpoint.service,
|
|
133
|
+
port: endpoint.port,
|
|
134
|
+
host: hosts[index],
|
|
135
|
+
url: url(hosts[index]),
|
|
136
|
+
...(paths ? { publicPaths: paths.paths } : {}),
|
|
137
|
+
};
|
|
138
|
+
});
|
|
106
139
|
}
|
|
107
140
|
exports.toRunEndpoints = toRunEndpoints;
|
|
108
141
|
// The repository of a run's source, which the endpoints grants are written for.
|
package/package.json
CHANGED