@serve.zone/interfaces 22.0.0 → 23.0.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/changelog.md +12 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/appstore/types.d.ts +31 -16
- package/dist_ts/appstore/types.js +208 -11
- package/dist_ts/data/deploymentoperation.js +6 -20
- package/dist_ts/data/deploymentpreflight.d.ts +2 -6
- package/dist_ts/data/deploymentpreflight.js +1 -1
- package/dist_ts/data/hostedapp.d.ts +40 -14
- package/dist_ts/data/hostedapp.js +90 -1
- package/dist_ts/data/immutableimage.d.ts +30 -1
- package/dist_ts/data/immutableimage.js +103 -1
- package/dist_ts/data/index.d.ts +0 -2
- package/dist_ts/data/index.js +1 -3
- package/dist_ts/data/secret.d.ts +186 -13
- package/dist_ts/data/secret.js +543 -45
- package/dist_ts/data/service.d.ts +0 -39
- package/dist_ts/data/service.js +1 -77
- package/dist_ts/data/settings.d.ts +62 -43
- package/dist_ts/data/settings.js +34 -2
- package/dist_ts/platform/storage.d.ts +13 -14
- package/dist_ts/platform/storage.js +1 -1
- package/dist_ts/platform/storagemigration.d.ts +8 -8
- package/dist_ts/platform/storagemigration.golden.d.ts +2 -2
- package/dist_ts/platform/storagemigration.golden.js +19 -88
- package/dist_ts/platform/storagemigration.js +46 -58
- package/dist_ts/platform/types.d.ts +5 -19
- package/dist_ts/plugins.d.ts +2 -1
- package/dist_ts/plugins.js +3 -2
- package/dist_ts/requests/hostedapp.d.ts +12 -9
- package/dist_ts/requests/hostedapp.js +38 -1
- package/dist_ts/requests/index.d.ts +1 -3
- package/dist_ts/requests/index.js +2 -4
- package/dist_ts/requests/platform.d.ts +0 -1
- package/dist_ts/requests/secret.d.ts +23 -17
- package/dist_ts/requests/secret.js +161 -2
- package/dist_ts/requests/service.d.ts +0 -13
- package/dist_ts/requests/settings.d.ts +3 -3
- package/dist_ts/runtime.d.ts +78 -26
- package/dist_ts/runtime.js +219 -19
- package/package.json +2 -1
- package/readme.md +106 -28
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/appstore/types.ts +251 -25
- package/ts/data/deploymentoperation.ts +7 -31
- package/ts/data/deploymentpreflight.ts +2 -5
- package/ts/data/hostedapp.ts +144 -18
- package/ts/data/immutableimage.ts +150 -1
- package/ts/data/index.ts +0 -2
- package/ts/data/secret.ts +775 -53
- package/ts/data/service.ts +0 -118
- package/ts/data/settings.ts +70 -80
- package/ts/platform/storage.ts +15 -16
- package/ts/platform/storagemigration.golden.ts +18 -95
- package/ts/platform/storagemigration.ts +57 -87
- package/ts/platform/types.ts +6 -19
- package/ts/plugins.ts +2 -0
- package/ts/requests/hostedapp.ts +50 -9
- package/ts/requests/index.ts +0 -4
- package/ts/requests/platform.ts +0 -1
- package/ts/requests/secret.ts +204 -9
- package/ts/requests/service.ts +0 -16
- package/ts/requests/settings.ts +3 -3
- package/ts/runtime.ts +314 -41
- package/dist_ts/data/secretbundle.d.ts +0 -57
- package/dist_ts/data/secretbundle.js +0 -2
- package/dist_ts/data/secretgroup.d.ts +0 -52
- package/dist_ts/data/secretgroup.js +0 -2
- package/dist_ts/requests/secretbundle.d.ts +0 -75
- package/dist_ts/requests/secretbundle.js +0 -4
- package/dist_ts/requests/secretgroup.d.ts +0 -52
- package/dist_ts/requests/secretgroup.js +0 -4
- package/ts/data/secretbundle.ts +0 -65
- package/ts/data/secretgroup.ts +0 -58
- package/ts/requests/secretbundle.ts +0 -103
- package/ts/requests/secretgroup.ts +0 -74
package/dist_ts/data/secret.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
1
2
|
import type { TSha256Digest } from './immutableimage.js';
|
|
2
3
|
export type TSecretEnvironment = string;
|
|
3
4
|
export type TSecretLifecycleState = 'active' | 'retired' | 'revoked' | 'deleted';
|
|
4
5
|
export type TSecretVersionLifecycleState = 'active' | 'retired' | 'revoked' | 'purged';
|
|
5
6
|
/** Retired versions remain usable only through an already-accepted manifest. */
|
|
6
|
-
export declare const isSecretVersionMaterialIssuable: (lifecycleStateArg: TSecretVersionLifecycleState) => boolean;
|
|
7
|
-
export type TSecretManagementSource = 'operator' | '
|
|
8
|
-
export type TSecretManagementScope = 'operator' |
|
|
7
|
+
export declare const isSecretVersionMaterialIssuable: (lifecycleStateArg: TSecretVersionLifecycleState, referencedByAcceptedManifestArg: boolean) => boolean;
|
|
8
|
+
export type TSecretManagementSource = 'operator' | 'appstore' | 'mail' | 'oidc' | 'webpush' | 'platform' | 'system';
|
|
9
|
+
export type TSecretManagementScope = 'operator' | `appstore:${string}` | `mail:${string}` | `oidc:${string}` | `webpush:${string}` | `platform:${string}` | `system:${string}`;
|
|
9
10
|
export interface IServiceSecretOwner {
|
|
10
11
|
kind: 'service';
|
|
11
12
|
serviceId: string;
|
|
@@ -14,7 +15,17 @@ export interface ISecretSetSecretOwner {
|
|
|
14
15
|
kind: 'secret-set';
|
|
15
16
|
secretSetId: string;
|
|
16
17
|
}
|
|
17
|
-
export
|
|
18
|
+
export interface IPlatformProviderSecretOwner {
|
|
19
|
+
kind: 'platform-provider';
|
|
20
|
+
providerConfigId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ISystemSecretOwner {
|
|
23
|
+
kind: 'system';
|
|
24
|
+
systemId: string;
|
|
25
|
+
}
|
|
26
|
+
export type TSecretOwner = IServiceSecretOwner | ISecretSetSecretOwner | IPlatformProviderSecretOwner | ISystemSecretOwner;
|
|
27
|
+
export type TSecretMutationTarget = TSecretOwner;
|
|
28
|
+
export type TWorkloadSecretOwner = IServiceSecretOwner | ISecretSetSecretOwner;
|
|
18
29
|
export interface ISecretVersionReference {
|
|
19
30
|
secretId: string;
|
|
20
31
|
secretVersionId: string;
|
|
@@ -93,18 +104,35 @@ export interface ISecretSetConsumerRolloutStatus {
|
|
|
93
104
|
errorCode?: string;
|
|
94
105
|
updatedAt: number;
|
|
95
106
|
}
|
|
96
|
-
export interface
|
|
97
|
-
type: 'environment';
|
|
107
|
+
export interface ISecretLauncherEnvironmentDelivery {
|
|
108
|
+
type: 'launcher-environment';
|
|
98
109
|
variableName: string;
|
|
110
|
+
uid: number;
|
|
111
|
+
gid: number;
|
|
112
|
+
mode: 0o400 | 0o440;
|
|
99
113
|
}
|
|
100
114
|
export interface ISecretFileDelivery {
|
|
101
115
|
type: 'file';
|
|
102
116
|
targetPath: string;
|
|
103
117
|
uid: number;
|
|
104
118
|
gid: number;
|
|
105
|
-
mode:
|
|
119
|
+
mode: 0o400 | 0o440;
|
|
106
120
|
}
|
|
107
|
-
export type TSecretDelivery =
|
|
121
|
+
export type TSecretDelivery = ISecretLauncherEnvironmentDelivery | ISecretFileDelivery;
|
|
122
|
+
export declare const secretValueLimits: Readonly<{
|
|
123
|
+
maximumBytes: number;
|
|
124
|
+
minimumGeneratedBytes: 16;
|
|
125
|
+
maximumGeneratedBytes: 64;
|
|
126
|
+
}>;
|
|
127
|
+
export type TSecretGeneratedEncoding = 'hex' | 'base64url';
|
|
128
|
+
export type TSecretValueInput = {
|
|
129
|
+
mode: 'sealed';
|
|
130
|
+
envelope: plugins.smartcrypto.IX25519EnvelopeV1;
|
|
131
|
+
} | {
|
|
132
|
+
mode: 'generated';
|
|
133
|
+
encoding: TSecretGeneratedEncoding;
|
|
134
|
+
bytes: number;
|
|
135
|
+
};
|
|
108
136
|
export interface ISecretSetAttachmentMapping {
|
|
109
137
|
/** Source key in the attached SecretSet. */
|
|
110
138
|
sourceKey: string;
|
|
@@ -124,7 +152,7 @@ export interface ISecretSetAttachment {
|
|
|
124
152
|
* Cloudly verifies organization ownership when resolving the referenced sets.
|
|
125
153
|
*/
|
|
126
154
|
export interface IServiceSecretConfiguration {
|
|
127
|
-
schemaVersion:
|
|
155
|
+
schemaVersion: 2;
|
|
128
156
|
/** Dedicated CAS revision for SecretSet attachments. */
|
|
129
157
|
revision: number;
|
|
130
158
|
/** Dedicated CAS revision for service-owned secret membership. */
|
|
@@ -136,17 +164,21 @@ export interface IResolvedSecretManifestEntry {
|
|
|
136
164
|
secretVersionId: string;
|
|
137
165
|
key: string;
|
|
138
166
|
environment: TSecretEnvironment;
|
|
139
|
-
owner:
|
|
167
|
+
owner: TWorkloadSecretOwner;
|
|
140
168
|
delivery: TSecretDelivery;
|
|
141
169
|
}
|
|
142
170
|
/** Immutable, value-free runtime snapshot. */
|
|
143
171
|
export interface IResolvedSecretManifest {
|
|
144
|
-
schemaVersion:
|
|
172
|
+
schemaVersion: 2;
|
|
145
173
|
id: string;
|
|
146
174
|
digest: TSha256Digest;
|
|
147
175
|
organizationId: string;
|
|
148
176
|
serviceId: string;
|
|
149
177
|
clusterId: string;
|
|
178
|
+
imageRolloutId: string;
|
|
179
|
+
imageRolloutGeneration: number;
|
|
180
|
+
requestedImageDigest: TSha256Digest;
|
|
181
|
+
invocationDigest: TSha256Digest;
|
|
150
182
|
secretRolloutId: string;
|
|
151
183
|
secretRolloutGeneration: number;
|
|
152
184
|
entries: IResolvedSecretManifestEntry[];
|
|
@@ -156,6 +188,10 @@ export interface IResolvedSecretManifestReference {
|
|
|
156
188
|
manifestId: string;
|
|
157
189
|
manifestDigest: TSha256Digest;
|
|
158
190
|
clusterId: string;
|
|
191
|
+
imageRolloutId: string;
|
|
192
|
+
imageRolloutGeneration: number;
|
|
193
|
+
requestedImageDigest: TSha256Digest;
|
|
194
|
+
invocationDigest: TSha256Digest;
|
|
159
195
|
secretRolloutId: string;
|
|
160
196
|
secretRolloutGeneration: number;
|
|
161
197
|
}
|
|
@@ -175,15 +211,22 @@ export interface IClusterSecretDeploymentState {
|
|
|
175
211
|
}
|
|
176
212
|
/** Server-managed per-cluster authority switched with an expected revision CAS. */
|
|
177
213
|
export interface IServiceSecretDeploymentPlan {
|
|
178
|
-
schemaVersion:
|
|
214
|
+
schemaVersion: 2;
|
|
179
215
|
revision: number;
|
|
180
216
|
clusterStates: IClusterSecretDeploymentState[];
|
|
181
217
|
updatedAt: number;
|
|
182
218
|
}
|
|
183
219
|
export declare const resolvedSecretManifestReferencesEqual: (leftArg: IResolvedSecretManifestReference | undefined, rightArg: IResolvedSecretManifestReference | undefined) => boolean;
|
|
184
220
|
export declare const isResolvedSecretManifestReferenceAccepted: (stateArg: IClusterSecretDeploymentState, referenceArg: IResolvedSecretManifestReference, nowArg: number) => boolean;
|
|
221
|
+
export declare const validateSecretMutationId: (mutationIdArg: unknown) => string[];
|
|
222
|
+
export declare const validateSecretOwner: (ownerArg: unknown) => string[];
|
|
185
223
|
export declare const validateSecretManagementScope: (sourceArg: TSecretManagementSource, scopeArg: unknown) => string[];
|
|
186
224
|
export declare const validateSecretDelivery: (deliveryArg: unknown) => string[];
|
|
225
|
+
export declare const validateSecretValueInput: (valueInputArg: unknown) => string[];
|
|
226
|
+
/** Checks the SmartCrypto context digest without opening or decrypting the envelope. */
|
|
227
|
+
export declare const verifySecretEnvelopeContext: (envelopeArg: unknown, contextArg: unknown) => Promise<boolean>;
|
|
228
|
+
/** Files accept arbitrary bytes; launcher values must be valid UTF-8 without NUL. */
|
|
229
|
+
export declare const validateSecretValueBytes: (valueBytesArg: unknown, deliveryArg: TSecretDelivery) => string[];
|
|
187
230
|
/**
|
|
188
231
|
* One shared precedence rule for resolution and runtime verification.
|
|
189
232
|
* A manifest is authoritative once published; before publication an attachment
|
|
@@ -195,7 +238,6 @@ export declare const resolveSecretDelivery: (deliveryArg: {
|
|
|
195
238
|
manifestDelivery?: TSecretDelivery;
|
|
196
239
|
}) => TSecretDelivery;
|
|
197
240
|
export declare const validateServiceSecretConfiguration: (configurationArg: unknown) => string[];
|
|
198
|
-
export declare const validateServiceSecretMode: (serviceDataArg: unknown) => string[];
|
|
199
241
|
export declare const validateSecretSetAttachmentOwnership: (configurationArg: IServiceSecretConfiguration, serviceOrganizationIdArg: string, secretSetsArg: ISecretSetMetadata[]) => string[];
|
|
200
242
|
export declare const createResolvedSecretManifestDigestInput: (manifestArg: IResolvedSecretManifest) => string;
|
|
201
243
|
/** Shared canonical digest; the digest field itself is excluded from the input. */
|
|
@@ -203,3 +245,134 @@ export declare const computeResolvedSecretManifestDigest: (manifestArg: IResolve
|
|
|
203
245
|
export declare const verifyResolvedSecretManifestDigest: (manifestArg: IResolvedSecretManifest) => Promise<boolean>;
|
|
204
246
|
export declare const validateResolvedSecretManifest: (manifestArg: unknown) => string[];
|
|
205
247
|
export declare const validateServiceSecretDeploymentPlan: (planArg: unknown, expectedTargetClusterIdsArg?: string[]) => string[];
|
|
248
|
+
export declare const dockerSecretResourceNameDomain: "serve.zone/docker-secret-resource/v1";
|
|
249
|
+
export declare const workloadInitEnvironmentMapPath: "/run/serve.zone/workloadinit-map-v1.json";
|
|
250
|
+
export declare const workloadRuntimeAssetRoot: "/opt/serve.zone/runtime-assets";
|
|
251
|
+
export declare const workloadInitExecutablePath: "/opt/serve.zone/runtime-assets/workloadinit/v1/workloadinit";
|
|
252
|
+
export declare const workloadInitEnvironmentMapMode: 292;
|
|
253
|
+
export declare const workloadRuntimeAssetsReadOnly: true;
|
|
254
|
+
/** Stable resource name; no logical key or value material appears in Docker. */
|
|
255
|
+
export declare const createDockerSecretResourceName: (secretVersionIdArg: string) => Promise<`szsv-${string}`>;
|
|
256
|
+
export declare const createLauncherSecretSourcePath: (resourceArg: string) => `/run/serve.zone/secrets/${string}`;
|
|
257
|
+
export interface IWorkloadInitEnvironmentMapEntryV1 {
|
|
258
|
+
variableName: string;
|
|
259
|
+
resource: string;
|
|
260
|
+
source: string;
|
|
261
|
+
}
|
|
262
|
+
export interface IWorkloadInitEnvironmentMapV1 {
|
|
263
|
+
schemaVersion: 1;
|
|
264
|
+
manifestId: string;
|
|
265
|
+
manifestDigest: TSha256Digest;
|
|
266
|
+
entries: IWorkloadInitEnvironmentMapEntryV1[];
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* The nonsecret map is generated only from launcher deliveries. Direct file
|
|
270
|
+
* deliveries mount their version resource at the declared target without the
|
|
271
|
+
* launcher. Runtime assets are mounted read-only; no shell, symlink, or
|
|
272
|
+
* aggregate material file participates in delivery.
|
|
273
|
+
*/
|
|
274
|
+
export declare const createWorkloadInitEnvironmentMap: (manifestArg: IResolvedSecretManifest) => Promise<IWorkloadInitEnvironmentMapV1>;
|
|
275
|
+
export declare const verifyWorkloadInitEnvironmentMap: (mapArg: unknown, manifestArg: IResolvedSecretManifest) => Promise<boolean>;
|
|
276
|
+
export interface IWorkloadInitWrappedInvocation {
|
|
277
|
+
command: [typeof workloadInitExecutablePath];
|
|
278
|
+
args: string[];
|
|
279
|
+
}
|
|
280
|
+
export declare const createWorkloadInitWrappedInvocation: (originalArgvArg: string[]) => IWorkloadInitWrappedInvocation;
|
|
281
|
+
/**
|
|
282
|
+
* A Docker secret resource and its nonsecret map remain while any desired,
|
|
283
|
+
* applied, or previous-accepted retained manifest references them. Deletion is
|
|
284
|
+
* allowed only after no retained reference exists and Docker confirms the
|
|
285
|
+
* corresponding rollout or service removal.
|
|
286
|
+
*/
|
|
287
|
+
export interface ISecretRuntimeResourceRetention {
|
|
288
|
+
resource: string;
|
|
289
|
+
retainedManifestIds: string[];
|
|
290
|
+
dockerRemovalConfirmed: boolean;
|
|
291
|
+
}
|
|
292
|
+
export type TSecretRecipientLifecycleState = 'active' | 'retiring' | 'revoked';
|
|
293
|
+
interface ISecretRecipientMetadataBase {
|
|
294
|
+
schemaVersion: 1;
|
|
295
|
+
recipientKeyId: string;
|
|
296
|
+
/** Canonical unpadded base64url raw 32-byte X25519 public key. */
|
|
297
|
+
publicKey: string;
|
|
298
|
+
generation: number;
|
|
299
|
+
activatedAt: number;
|
|
300
|
+
}
|
|
301
|
+
export interface IActiveSecretRecipientMetadata extends ISecretRecipientMetadataBase {
|
|
302
|
+
lifecycleState: 'active';
|
|
303
|
+
acceptUntil?: never;
|
|
304
|
+
revokedAt?: never;
|
|
305
|
+
}
|
|
306
|
+
export interface IRetiringSecretRecipientMetadata extends ISecretRecipientMetadataBase {
|
|
307
|
+
lifecycleState: 'retiring';
|
|
308
|
+
acceptUntil: number;
|
|
309
|
+
revokedAt?: never;
|
|
310
|
+
}
|
|
311
|
+
export interface IRevokedSecretRecipientMetadata extends ISecretRecipientMetadataBase {
|
|
312
|
+
lifecycleState: 'revoked';
|
|
313
|
+
acceptUntil?: never;
|
|
314
|
+
revokedAt: number;
|
|
315
|
+
}
|
|
316
|
+
export type TSecretRecipientMetadata = IActiveSecretRecipientMetadata | IRetiringSecretRecipientMetadata | IRevokedSecretRecipientMetadata;
|
|
317
|
+
export type TSecretIngressRecipient = TSecretRecipientMetadata;
|
|
318
|
+
export declare const secretRecipientLimits: Readonly<{
|
|
319
|
+
maximumRecipients: 64;
|
|
320
|
+
}>;
|
|
321
|
+
export declare const validateSecretRecipientMetadata: (recipientArg: unknown) => string[];
|
|
322
|
+
export declare const validateSecretRecipientSet: (recipientsArg: unknown) => string[];
|
|
323
|
+
/** New envelopes target only active recipients. */
|
|
324
|
+
export declare const canIssueNewSecretEnvelope: (recipientArg: TSecretRecipientMetadata) => boolean;
|
|
325
|
+
export declare const validateSecretValueInputForRecipient: (valueInputArg: unknown, recipientArg: TSecretRecipientMetadata, expectedContextArg: Uint8Array) => Promise<string[]>;
|
|
326
|
+
/** Retiring recipients open only already-issued envelopes before their deadline. */
|
|
327
|
+
export declare const canOpenIssuedSecretEnvelope: (recipientArg: TSecretRecipientMetadata, issuedAtArg: number, nowArg: number) => boolean;
|
|
328
|
+
export declare const createSecretCreateEnvelopeContext: (contextArg: {
|
|
329
|
+
mutationId: string;
|
|
330
|
+
target: TSecretMutationTarget;
|
|
331
|
+
key: string;
|
|
332
|
+
environment: TSecretEnvironment;
|
|
333
|
+
delivery: TSecretDelivery;
|
|
334
|
+
expectedTargetSecretsRevision: number;
|
|
335
|
+
}) => Uint8Array;
|
|
336
|
+
export declare const createSecretRotateEnvelopeContext: (contextArg: {
|
|
337
|
+
mutationId: string;
|
|
338
|
+
secretId: string;
|
|
339
|
+
expectedSecretRevision: number;
|
|
340
|
+
expectedActiveVersionId: string;
|
|
341
|
+
expectedTargetSecretsRevision: number;
|
|
342
|
+
}) => Uint8Array;
|
|
343
|
+
export declare const createAppStoreInstallSecretEnvelopeContext: (contextArg: {
|
|
344
|
+
mutationId: string;
|
|
345
|
+
appId: string;
|
|
346
|
+
appVersion: string;
|
|
347
|
+
serviceId: string;
|
|
348
|
+
key: string;
|
|
349
|
+
delivery: TSecretDelivery;
|
|
350
|
+
generation?: {
|
|
351
|
+
encoding: TSecretGeneratedEncoding;
|
|
352
|
+
bytes: number;
|
|
353
|
+
};
|
|
354
|
+
}) => Uint8Array;
|
|
355
|
+
export declare const createResolvedSecretMaterialEnvelopeContext: (contextArg: {
|
|
356
|
+
recipientKeyId: string;
|
|
357
|
+
organizationId: string;
|
|
358
|
+
clusterId: string;
|
|
359
|
+
serviceId: string;
|
|
360
|
+
imageRolloutId: string;
|
|
361
|
+
imageRolloutGeneration: number;
|
|
362
|
+
requestedImageDigest: TSha256Digest;
|
|
363
|
+
secretRolloutId: string;
|
|
364
|
+
secretRolloutGeneration: number;
|
|
365
|
+
manifestId: string;
|
|
366
|
+
manifestDigest: TSha256Digest;
|
|
367
|
+
secretId: string;
|
|
368
|
+
secretVersionId: string;
|
|
369
|
+
}) => Uint8Array;
|
|
370
|
+
export declare const createSecretRecipientEnrollmentChallengeContext: (contextArg: {
|
|
371
|
+
enrollmentId: string;
|
|
372
|
+
clusterId: string;
|
|
373
|
+
recipientKeyId: string;
|
|
374
|
+
publicKey: string;
|
|
375
|
+
generation: number;
|
|
376
|
+
expiresAt: number;
|
|
377
|
+
}) => Uint8Array;
|
|
378
|
+
export {};
|