@sealant/api-contracts-next 0.39.0-next.719 → 0.39.0-next.721
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/dist/core-api/control-plane.d.ts +1129 -1126
- package/dist/core-api/system.d.ts +12 -0
- package/dist/core-api/system.js +6 -0
- package/dist/core-api/workspaces.d.ts +26 -1
- package/dist/core-api/workspaces.js +21 -0
- package/package.json +2 -2
|
@@ -40,6 +40,12 @@ export declare const systemIndexResponseSchema: Schema.Struct<{
|
|
|
40
40
|
readonly workspaceSshUser: Schema.optional<Schema.Boolean>;
|
|
41
41
|
/** `POST /v1/users/:id/person`: a user's person bound once (what `sshAsOwner` checks). */
|
|
42
42
|
readonly personBinding: Schema.optional<Schema.Boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Removing an SSH key ends the gateway connections opened with it: none opens a new channel
|
|
45
|
+
* or forward once it is removed, and each ends within a minute (the gateway's re-check).
|
|
46
|
+
* From an older control plane they stay open until the workspace stops.
|
|
47
|
+
*/
|
|
48
|
+
readonly sshKeyRemovalEndsConnections: Schema.optional<Schema.Boolean>;
|
|
43
49
|
}>>;
|
|
44
50
|
}>;
|
|
45
51
|
export type SystemIndexResponse = typeof systemIndexResponseSchema.Type;
|
|
@@ -107,6 +113,12 @@ export declare const SystemGroup: HttpApiGroup.HttpApiGroup<"system", HttpApiEnd
|
|
|
107
113
|
readonly workspaceSshUser: Schema.optional<Schema.Boolean>;
|
|
108
114
|
/** `POST /v1/users/:id/person`: a user's person bound once (what `sshAsOwner` checks). */
|
|
109
115
|
readonly personBinding: Schema.optional<Schema.Boolean>;
|
|
116
|
+
/**
|
|
117
|
+
* Removing an SSH key ends the gateway connections opened with it: none opens a new channel
|
|
118
|
+
* or forward once it is removed, and each ends within a minute (the gateway's re-check).
|
|
119
|
+
* From an older control plane they stay open until the workspace stops.
|
|
120
|
+
*/
|
|
121
|
+
readonly sshKeyRemovalEndsConnections: Schema.optional<Schema.Boolean>;
|
|
110
122
|
}>>;
|
|
111
123
|
}>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getSetupState", "GET", "/v1/system/setup-state", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
112
124
|
readonly needsSetup: Schema.Boolean;
|
package/dist/core-api/system.js
CHANGED
|
@@ -41,6 +41,12 @@ export const systemIndexResponseSchema = Schema.Struct({
|
|
|
41
41
|
workspaceSshUser: Schema.optional(Schema.Boolean),
|
|
42
42
|
/** `POST /v1/users/:id/person`: a user's person bound once (what `sshAsOwner` checks). */
|
|
43
43
|
personBinding: Schema.optional(Schema.Boolean),
|
|
44
|
+
/**
|
|
45
|
+
* Removing an SSH key ends the gateway connections opened with it: none opens a new channel
|
|
46
|
+
* or forward once it is removed, and each ends within a minute (the gateway's re-check).
|
|
47
|
+
* From an older control plane they stay open until the workspace stops.
|
|
48
|
+
*/
|
|
49
|
+
sshKeyRemovalEndsConnections: Schema.optional(Schema.Boolean),
|
|
44
50
|
})),
|
|
45
51
|
});
|
|
46
52
|
export const systemHealthResponseSchema = Schema.Struct({
|
|
@@ -53,6 +53,12 @@ export declare const workspaceSshTargetSchema: Schema.Struct<{
|
|
|
53
53
|
* (`x-sealant-gateway-ssh-user: 1`); a workspace with a user refuses any other gateway.
|
|
54
54
|
*/
|
|
55
55
|
readonly sessionUser: Schema.NullOr<Schema.String>;
|
|
56
|
+
/**
|
|
57
|
+
* The key fingerprint the gateway named in `x-sealant-ssh-key-fingerprint`, echoed once the API
|
|
58
|
+
* found it still registered to the principal. Absent when the gateway named none. A gateway that
|
|
59
|
+
* named one refuses a target without it (an older API, which never checked the key).
|
|
60
|
+
*/
|
|
61
|
+
readonly sshKeyFingerprint: Schema.optional<Schema.String>;
|
|
56
62
|
}>;
|
|
57
63
|
export type WorkspaceSshTarget = typeof workspaceSshTargetSchema.Type;
|
|
58
64
|
/**
|
|
@@ -1745,6 +1751,7 @@ export declare const workspaceGatewayHeadersSchema: Schema.Struct<{
|
|
|
1745
1751
|
readonly "x-sealant-gateway-token": Schema.optional<Schema.String>;
|
|
1746
1752
|
readonly "x-sealant-principal-id": Schema.optional<Schema.String>;
|
|
1747
1753
|
readonly "x-sealant-gateway-ssh-user": Schema.optional<Schema.String>;
|
|
1754
|
+
readonly "x-sealant-ssh-key-fingerprint": Schema.optional<Schema.String>;
|
|
1748
1755
|
}>;
|
|
1749
1756
|
export type WorkspaceGatewayHeaders = typeof workspaceGatewayHeadersSchema.Type;
|
|
1750
1757
|
declare const WorkspaceBadRequestError_base: Schema.Class<WorkspaceBadRequestError, Schema.TaggedStruct<"WorkspaceBadRequestError", {
|
|
@@ -1783,6 +1790,17 @@ declare const WorkspaceUnauthorizedError_base: Schema.Class<WorkspaceUnauthorize
|
|
|
1783
1790
|
}>, import("effect/Cause").YieldableError>;
|
|
1784
1791
|
export declare class WorkspaceUnauthorizedError extends WorkspaceUnauthorizedError_base {
|
|
1785
1792
|
}
|
|
1793
|
+
declare const WorkspaceSshKeyNoLongerRegisteredError_base: Schema.Class<WorkspaceSshKeyNoLongerRegisteredError, Schema.TaggedStruct<"WorkspaceSshKeyNoLongerRegisteredError", {
|
|
1794
|
+
readonly message: Schema.String;
|
|
1795
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1796
|
+
/**
|
|
1797
|
+
* The SSH key the gateway named (`x-sealant-ssh-key-fingerprint`) is no longer registered to the
|
|
1798
|
+
* principal: removed, or registered since to someone else. Its own tag, so the gateway ends the
|
|
1799
|
+
* connections opened with the key on this refusal alone, never on another 401 (a gateway token
|
|
1800
|
+
* mismatch while the API and the gateway roll).
|
|
1801
|
+
*/
|
|
1802
|
+
export declare class WorkspaceSshKeyNoLongerRegisteredError extends WorkspaceSshKeyNoLongerRegisteredError_base {
|
|
1803
|
+
}
|
|
1786
1804
|
declare const WorkspaceSshOwnerRefusedError_base: Schema.Class<WorkspaceSshOwnerRefusedError, Schema.TaggedStruct<"WorkspaceSshOwnerRefusedError", {
|
|
1787
1805
|
readonly message: Schema.String;
|
|
1788
1806
|
readonly code: Schema.Literals<readonly ["ssh-owner-unbound", "ssh-owner-needs-owner-map", "ssh-owner-mismatch"]>;
|
|
@@ -2532,6 +2550,7 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
2532
2550
|
readonly "x-sealant-gateway-token": Schema.optional<Schema.String>;
|
|
2533
2551
|
readonly "x-sealant-principal-id": Schema.optional<Schema.String>;
|
|
2534
2552
|
readonly "x-sealant-gateway-ssh-user": Schema.optional<Schema.String>;
|
|
2553
|
+
readonly "x-sealant-ssh-key-fingerprint": Schema.optional<Schema.String>;
|
|
2535
2554
|
}>>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
2536
2555
|
readonly workspaceId: Schema.String;
|
|
2537
2556
|
readonly attemptId: Schema.String;
|
|
@@ -2550,7 +2569,13 @@ export declare const WorkspacesGroup: HttpApiGroup.HttpApiGroup<"workspaces", Ht
|
|
|
2550
2569
|
* (`x-sealant-gateway-ssh-user: 1`); a workspace with a user refuses any other gateway.
|
|
2551
2570
|
*/
|
|
2552
2571
|
readonly sessionUser: Schema.NullOr<Schema.String>;
|
|
2553
|
-
|
|
2572
|
+
/**
|
|
2573
|
+
* The key fingerprint the gateway named in `x-sealant-ssh-key-fingerprint`, echoed once the API
|
|
2574
|
+
* found it still registered to the principal. Absent when the gateway named none. A gateway that
|
|
2575
|
+
* named one refuses a target without it (an older API, which never checked the key).
|
|
2576
|
+
*/
|
|
2577
|
+
readonly sshKeyFingerprint: Schema.optional<Schema.String>;
|
|
2578
|
+
}>>, HttpApiEndpoint.Json<typeof WorkspaceUnauthorizedError | typeof WorkspaceSshKeyNoLongerRegisteredError | typeof WorkspaceNotFoundError | typeof WorkspaceConflictError | typeof WorkspaceServiceUnavailableError | typeof WorkspaceInternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"inspectWorkspaceImage", "POST", "/image", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
2554
2579
|
readonly ownerUserId: Schema.String;
|
|
2555
2580
|
readonly registryId: Schema.String;
|
|
2556
2581
|
/** The spec a create would send (`CreateWorkspaceRequest.spec`). */
|
|
@@ -63,6 +63,12 @@ export const workspaceSshTargetSchema = Schema.Struct({
|
|
|
63
63
|
* (`x-sealant-gateway-ssh-user: 1`); a workspace with a user refuses any other gateway.
|
|
64
64
|
*/
|
|
65
65
|
sessionUser: Schema.NullOr(NonEmptyString),
|
|
66
|
+
/**
|
|
67
|
+
* The key fingerprint the gateway named in `x-sealant-ssh-key-fingerprint`, echoed once the API
|
|
68
|
+
* found it still registered to the principal. Absent when the gateway named none. A gateway that
|
|
69
|
+
* named one refuses a target without it (an older API, which never checked the key).
|
|
70
|
+
*/
|
|
71
|
+
sshKeyFingerprint: Schema.optional(NonEmptyString),
|
|
66
72
|
});
|
|
67
73
|
/**
|
|
68
74
|
* Whether an image can run Mend's per-person layout on a runtime (Mend ADR 0016): the verdict of
|
|
@@ -1109,6 +1115,10 @@ export const workspaceGatewayHeadersSchema = Schema.Struct({
|
|
|
1109
1115
|
// `1` from a gateway that runs a workspace's SSH sessions as its `sshUser`. A workspace with a
|
|
1110
1116
|
// user answers no target to a gateway without it, which would run the session as root.
|
|
1111
1117
|
"x-sealant-gateway-ssh-user": Schema.optional(NonEmptyString),
|
|
1118
|
+
// The fingerprint (`SHA256:…`) of the registered key the client logged in with. When it is
|
|
1119
|
+
// named, the API answers a target only while that key is still registered to the principal, so
|
|
1120
|
+
// removing a key ends what connections opened with it can still open.
|
|
1121
|
+
"x-sealant-ssh-key-fingerprint": Schema.optional(NonEmptyString),
|
|
1112
1122
|
});
|
|
1113
1123
|
export class WorkspaceBadRequestError extends Schema.TaggedErrorClass()("WorkspaceBadRequestError", {
|
|
1114
1124
|
message: Schema.String,
|
|
@@ -1142,6 +1152,16 @@ export class WorkspaceUnauthorizedError extends Schema.TaggedErrorClass()("Works
|
|
|
1142
1152
|
message: Schema.String,
|
|
1143
1153
|
}, { httpApiStatus: 401 }) {
|
|
1144
1154
|
}
|
|
1155
|
+
/**
|
|
1156
|
+
* The SSH key the gateway named (`x-sealant-ssh-key-fingerprint`) is no longer registered to the
|
|
1157
|
+
* principal: removed, or registered since to someone else. Its own tag, so the gateway ends the
|
|
1158
|
+
* connections opened with the key on this refusal alone, never on another 401 (a gateway token
|
|
1159
|
+
* mismatch while the API and the gateway roll).
|
|
1160
|
+
*/
|
|
1161
|
+
export class WorkspaceSshKeyNoLongerRegisteredError extends Schema.TaggedErrorClass()("WorkspaceSshKeyNoLongerRegisteredError", {
|
|
1162
|
+
message: Schema.String,
|
|
1163
|
+
}, { httpApiStatus: 401 }) {
|
|
1164
|
+
}
|
|
1145
1165
|
/**
|
|
1146
1166
|
* `sshAsOwner` refused: the owner is bound to no person (`ssh-owner-unbound`), the create carries no
|
|
1147
1167
|
* capture owner map (`ssh-owner-needs-owner-map`), or the owner map or `credentialsHome` does not
|
|
@@ -1498,6 +1518,7 @@ HttpApiEndpoint.post("expireWorkspace", "/:workspaceId/expire", {
|
|
|
1498
1518
|
success: workspaceSshTargetSchema,
|
|
1499
1519
|
error: [
|
|
1500
1520
|
WorkspaceUnauthorizedError,
|
|
1521
|
+
WorkspaceSshKeyNoLongerRegisteredError,
|
|
1501
1522
|
WorkspaceNotFoundError,
|
|
1502
1523
|
WorkspaceConflictError,
|
|
1503
1524
|
WorkspaceServiceUnavailableError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealant/api-contracts-next",
|
|
3
|
-
"version": "0.39.0-next.
|
|
3
|
+
"version": "0.39.0-next.721",
|
|
4
4
|
"description": "Contract-first HTTP API definitions for Sealant services",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"effect": ">=4.0.0-beta.85 <5"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "cada0010b9b96ceb896f5cdc1e690bd0d1ab5d3f",
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
}
|