@serve.zone/interfaces 32.25.0 → 32.27.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 +45 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/clusternode.d.ts +15 -0
- package/dist_ts/data/clusternode.js +1 -1
- package/dist_ts/data/serviceruntime.d.ts +18 -5
- package/dist_ts/data/serviceruntime.js +4 -2
- package/dist_ts/platform/database.d.ts +26 -0
- package/dist_ts/platform/database.js +49 -2
- package/dist_ts/platform/index.d.ts +1 -0
- package/dist_ts/platform/index.js +2 -1
- package/dist_ts/platform/objectstorageenvironment.d.ts +59 -0
- package/dist_ts/platform/objectstorageenvironment.js +116 -41
- package/dist_ts/requests/node.d.ts +29 -0
- package/dist_ts/runtime.corestore.d.ts +36 -0
- package/dist_ts/runtime.corestore.js +79 -2
- package/package.json +3 -3
- package/readme.md +72 -10
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/clusternode.ts +16 -0
- package/ts/data/serviceruntime.ts +19 -4
- package/ts/platform/database.ts +79 -0
- package/ts/platform/index.ts +1 -0
- package/ts/platform/objectstorageenvironment.ts +199 -54
- package/ts/requests/node.ts +33 -0
- package/ts/runtime.corestore.ts +108 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IPlatformBinding } from './types.js';
|
|
2
2
|
import type { IPlatformObjectStorageEndpoint, TObjectStorageEndpointEnvironment, TObjectStorageEndpointEnvironmentKey } from './objectstorage.js';
|
|
3
|
+
import type { TServiceRuntimeRefusal, TServiceRuntimeWaitingReason } from '../data/serviceruntime.js';
|
|
3
4
|
import type { TObjectStorageRetentionEnvironment, TObjectStorageRetentionEnvironmentKey } from './objectstorageretention.js';
|
|
4
5
|
/**
|
|
5
6
|
* Every non-secret environment name an object-storage binding can give a workload: the nine
|
|
@@ -32,6 +33,9 @@ export type TObjectStorageBindingEnvironment = TObjectStorageEndpointEnvironment
|
|
|
32
33
|
* The evidence's reconciliation generation and binding-request digest are read from its own
|
|
33
34
|
* authority: they are what Cloudly checked when it admitted the evidence, and the binding document
|
|
34
35
|
* does not repeat them. Everything the binding does state is checked again here.
|
|
36
|
+
*
|
|
37
|
+
* `composeObjectStorageServiceEnvironment()` answers the same questions with a service runtime
|
|
38
|
+
* reason instead of an error.
|
|
35
39
|
*/
|
|
36
40
|
export declare const createObjectStorageBindingEnvironment: (bindingArg: IPlatformBinding, endpointArg: IPlatformObjectStorageEndpoint) => Promise<TObjectStorageBindingEnvironment>;
|
|
37
41
|
/**
|
|
@@ -47,3 +51,58 @@ export declare const validateObjectStorageBindingEnvironment: (environmentArg: u
|
|
|
47
51
|
* would otherwise have one value silently replace the other. The inputs are not changed.
|
|
48
52
|
*/
|
|
49
53
|
export declare const mergeObjectStorageBindingEnvironment: (environmentArg: Readonly<Record<string, string>>, bindingEnvironmentArg: TObjectStorageBindingEnvironment) => Record<string, string>;
|
|
54
|
+
/** One enabled object-storage binding of a service and the endpoint of the node it is placed on. */
|
|
55
|
+
export interface IObjectStorageBindingEnvironmentSource {
|
|
56
|
+
binding: IPlatformBinding;
|
|
57
|
+
/**
|
|
58
|
+
* The `IClusterNode.data.corestoreObjectStorage` of the node the binding is placed on, `null`
|
|
59
|
+
* when that node states none. A binding placed on no node is not a source: its service waits as
|
|
60
|
+
* `bindings-pending`.
|
|
61
|
+
*/
|
|
62
|
+
endpoint: IPlatformObjectStorageEndpoint | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The service runtime waiting reason an object-storage environment reports:
|
|
66
|
+
* `objectstorage-retention-pending`, a binding that declares compliance retention whose evidence
|
|
67
|
+
* has not arrived.
|
|
68
|
+
*/
|
|
69
|
+
export type TObjectStorageEnvironmentWaitingReason = Extract<TServiceRuntimeWaitingReason, 'objectstorage-retention-pending'>;
|
|
70
|
+
/**
|
|
71
|
+
* The service runtime refusals an object-storage environment reports.
|
|
72
|
+
* `objectstorage-endpoint-missing` is a binding whose node states no valid
|
|
73
|
+
* `corestoreObjectStorage`; `objectstorage-binding-invalid` a binding
|
|
74
|
+
* `createObjectStorageBindingEnvironment()` refuses (not `objectstorage`, no canonical bucket, no
|
|
75
|
+
* canonical retention intent, or evidence that does not prove this binding);
|
|
76
|
+
* `objectstorage-environment-conflict` a name the service's own environment or another binding
|
|
77
|
+
* already sets.
|
|
78
|
+
*/
|
|
79
|
+
export type TObjectStorageEnvironmentRefusal = Extract<TServiceRuntimeRefusal, 'objectstorage-endpoint-missing' | 'objectstorage-binding-invalid' | 'objectstorage-environment-conflict'>;
|
|
80
|
+
/** A service's environment with every object-storage binding added, or the one reason it is not. */
|
|
81
|
+
export type TObjectStorageServiceEnvironmentComposition = {
|
|
82
|
+
status: 'composed';
|
|
83
|
+
environment: Record<string, string>;
|
|
84
|
+
} | {
|
|
85
|
+
status: 'waiting';
|
|
86
|
+
reason: TObjectStorageEnvironmentWaitingReason;
|
|
87
|
+
bindingId: string;
|
|
88
|
+
message: string;
|
|
89
|
+
} | {
|
|
90
|
+
status: 'refused';
|
|
91
|
+
reason: TObjectStorageEnvironmentRefusal;
|
|
92
|
+
bindingId: string;
|
|
93
|
+
message: string;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The service's own environment with the environment of every enabled object-storage binding
|
|
97
|
+
* added, or the service runtime reason it cannot be — so a producer reports the contract's
|
|
98
|
+
* verdict instead of classifying its errors.
|
|
99
|
+
*
|
|
100
|
+
* Each binding's names are `createObjectStorageBindingEnvironment()`'s from its node's endpoint,
|
|
101
|
+
* added as `mergeObjectStorageBindingEnvironment()` adds them. Bindings are taken in id order, so
|
|
102
|
+
* the verdict does not depend on the order of `sourcesArg`. A refusal outranks a wait, because a
|
|
103
|
+
* wait resolves on its own and a refusal never does: a binding waiting for retention evidence
|
|
104
|
+
* already claims all twenty of its names, so a collision with it is refused now, not once its
|
|
105
|
+
* evidence arrives. The first refusal is answered, otherwise the first wait, otherwise the
|
|
106
|
+
* composed environment. The inputs are not changed.
|
|
107
|
+
*/
|
|
108
|
+
export declare const composeObjectStorageServiceEnvironment: (serviceEnvironmentArg: Readonly<Record<string, string>>, sourcesArg: readonly IObjectStorageBindingEnvironmentSource[]) => Promise<TObjectStorageServiceEnvironmentComposition>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createObjectStorageEndpointEnvironment, objectStorageEndpointEnvironmentKeys, validateObjectStorageEndpointEnvironment, validatePlatformObjectStorageBucketName, } from './objectstorage.js';
|
|
2
|
-
import { createObjectStorageRetentionEnvironment, objectStorageRetentionEnvironmentKeys, validateObjectStorageRetentionEnvironment, validateObjectStorageRetentionIntent, } from './objectstorageretention.js';
|
|
1
|
+
import { createObjectStorageEndpointEnvironment, objectStorageEndpointEnvironmentKeys, validateObjectStorageEndpointEnvironment, validatePlatformObjectStorageBucketName, validatePlatformObjectStorageEndpoint, } from './objectstorage.js';
|
|
2
|
+
import { createObjectStorageRetentionEnvironment, objectStorageRetentionEnvironmentKeys, validateObjectStorageRetentionEnvironment, validateObjectStorageRetentionEvidence, validateObjectStorageRetentionIntent, } from './objectstorageretention.js';
|
|
3
3
|
import { isPlainRecord, readDataProperties } from '../private/dataproperties.js';
|
|
4
4
|
/**
|
|
5
5
|
* Every non-secret environment name an object-storage binding can give a workload: the nine
|
|
@@ -10,65 +10,98 @@ export const objectStorageBindingEnvironmentKeys = Object.freeze([
|
|
|
10
10
|
...objectStorageRetentionEnvironmentKeys,
|
|
11
11
|
]);
|
|
12
12
|
/**
|
|
13
|
-
* The
|
|
14
|
-
*
|
|
15
|
-
* `bindingArg` is the Cloudly binding document and `endpointArg` the
|
|
16
|
-
* `IClusterNode.data.corestoreObjectStorage` of the node the binding is placed on. Refused by
|
|
17
|
-
* name, never guessed:
|
|
18
|
-
*
|
|
19
|
-
* - a binding that is not `objectstorage` or carries no canonical `objectstorageBucketName`;
|
|
20
|
-
* - an endpoint that `validatePlatformObjectStorageEndpoint()` refuses;
|
|
21
|
-
* - a binding that declares `objectstorageRetention` without `evidence`. Its bucket's retention is
|
|
22
|
-
* not proven yet, so the workload is not given an environment that would let it run as if its
|
|
23
|
-
* bucket were ordinary storage; the caller waits for the evidence.
|
|
24
|
-
* - evidence that does not prove the binding's own service, binding id, bucket and intent.
|
|
25
|
-
*
|
|
26
|
-
* A binding without `objectstorageRetention` gets the endpoint names alone: it promised no
|
|
27
|
-
* retention, so there is nothing to state.
|
|
28
|
-
*
|
|
29
|
-
* The evidence's reconciliation generation and binding-request digest are read from its own
|
|
30
|
-
* authority: they are what Cloudly checked when it admitted the evidence, and the binding document
|
|
31
|
-
* does not repeat them. Everything the binding does state is checked again here.
|
|
13
|
+
* The one place a binding's environment is decided. `createObjectStorageBindingEnvironment()`
|
|
14
|
+
* throws its message, `composeObjectStorageServiceEnvironment()` reports its reason.
|
|
32
15
|
*/
|
|
33
|
-
|
|
16
|
+
const resolveBindingEnvironment = async (bindingArg, endpointArg) => {
|
|
34
17
|
const binding = readDataProperties(bindingArg);
|
|
35
18
|
if (binding === null || binding.capability !== 'objectstorage') {
|
|
36
|
-
|
|
19
|
+
return { status: 'refused', reason: 'objectstorage-binding-invalid',
|
|
20
|
+
message: 'objectstorage binding environment requires an objectstorage binding' };
|
|
37
21
|
}
|
|
38
22
|
const bindingName = typeof binding.id === 'string' ? binding.id : '(unnamed)';
|
|
39
23
|
if (validatePlatformObjectStorageBucketName(binding.objectstorageBucketName).length > 0) {
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
return { status: 'refused', reason: 'objectstorage-binding-invalid',
|
|
25
|
+
message: `objectstorage binding ${bindingName} carries no canonical bucket name; Cloudly owns `
|
|
26
|
+
+ 'it and no environment invents one' };
|
|
27
|
+
}
|
|
28
|
+
if (endpointArg === null) {
|
|
29
|
+
return { status: 'refused', reason: 'objectstorage-endpoint-missing',
|
|
30
|
+
message: `objectstorage binding ${bindingName} is placed on a node that states no `
|
|
31
|
+
+ 'corestoreObjectStorage endpoint' };
|
|
32
|
+
}
|
|
33
|
+
const endpointErrors = validatePlatformObjectStorageEndpoint(endpointArg);
|
|
34
|
+
if (endpointErrors.length > 0) {
|
|
35
|
+
return { status: 'refused', reason: 'objectstorage-endpoint-missing', message: endpointErrors[0] };
|
|
42
36
|
}
|
|
43
37
|
const bucketName = binding.objectstorageBucketName;
|
|
44
38
|
const endpointEnvironment = createObjectStorageEndpointEnvironment(endpointArg, bucketName);
|
|
45
39
|
const retention = binding.objectstorageRetention;
|
|
46
40
|
if (retention === undefined) {
|
|
47
|
-
return endpointEnvironment;
|
|
41
|
+
return { status: 'composed', environment: endpointEnvironment };
|
|
48
42
|
}
|
|
49
43
|
const retentionBinding = readDataProperties(retention);
|
|
50
44
|
if (retentionBinding === null
|
|
51
45
|
|| validateObjectStorageRetentionIntent(retentionBinding.intent).length > 0) {
|
|
52
|
-
|
|
46
|
+
return { status: 'refused', reason: 'objectstorage-binding-invalid',
|
|
47
|
+
message: `objectstorage binding ${bindingName} must declare canonical compliance-retention `
|
|
48
|
+
+ 'intent' };
|
|
53
49
|
}
|
|
54
50
|
const evidence = retentionBinding.evidence;
|
|
55
51
|
if (evidence === undefined) {
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
return { status: 'waiting', reason: 'objectstorage-retention-pending',
|
|
53
|
+
message: `objectstorage binding ${bindingName} declares compliance retention without `
|
|
54
|
+
+ 'verified evidence; its workload environment waits for the evidence' };
|
|
58
55
|
}
|
|
59
56
|
const authority = isPlainRecord(evidence) ? readDataProperties(evidence.authority) : null;
|
|
60
57
|
if (authority === null) {
|
|
61
|
-
|
|
58
|
+
return { status: 'refused', reason: 'objectstorage-binding-invalid',
|
|
59
|
+
message: 'objectstorage retention evidence must use its exact schema' };
|
|
62
60
|
}
|
|
63
|
-
const
|
|
61
|
+
const expectation = {
|
|
64
62
|
serviceId: binding.serviceId,
|
|
65
63
|
bindingId: binding.id,
|
|
66
64
|
reconciliationGeneration: authority.reconciliationGeneration,
|
|
67
65
|
bindingRequestDigest: authority.bindingRequestDigest,
|
|
68
66
|
bucketName,
|
|
69
67
|
intent: retentionBinding.intent,
|
|
70
|
-
}
|
|
71
|
-
|
|
68
|
+
};
|
|
69
|
+
const evidenceErrors = await validateObjectStorageRetentionEvidence(evidence, expectation);
|
|
70
|
+
if (evidenceErrors.length > 0) {
|
|
71
|
+
return { status: 'refused', reason: 'objectstorage-binding-invalid', message: evidenceErrors[0] };
|
|
72
|
+
}
|
|
73
|
+
const retentionEnvironment = await createObjectStorageRetentionEnvironment(evidence, expectation);
|
|
74
|
+
return { status: 'composed', environment: { ...endpointEnvironment, ...retentionEnvironment } };
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The environment Cloudly composes into a workload's runtime configuration for one binding.
|
|
78
|
+
*
|
|
79
|
+
* `bindingArg` is the Cloudly binding document and `endpointArg` the
|
|
80
|
+
* `IClusterNode.data.corestoreObjectStorage` of the node the binding is placed on. Refused by
|
|
81
|
+
* name, never guessed:
|
|
82
|
+
*
|
|
83
|
+
* - a binding that is not `objectstorage` or carries no canonical `objectstorageBucketName`;
|
|
84
|
+
* - an endpoint that `validatePlatformObjectStorageEndpoint()` refuses;
|
|
85
|
+
* - a binding that declares `objectstorageRetention` without `evidence`. Its bucket's retention is
|
|
86
|
+
* not proven yet, so the workload is not given an environment that would let it run as if its
|
|
87
|
+
* bucket were ordinary storage; the caller waits for the evidence.
|
|
88
|
+
* - evidence that does not prove the binding's own service, binding id, bucket and intent.
|
|
89
|
+
*
|
|
90
|
+
* A binding without `objectstorageRetention` gets the endpoint names alone: it promised no
|
|
91
|
+
* retention, so there is nothing to state.
|
|
92
|
+
*
|
|
93
|
+
* The evidence's reconciliation generation and binding-request digest are read from its own
|
|
94
|
+
* authority: they are what Cloudly checked when it admitted the evidence, and the binding document
|
|
95
|
+
* does not repeat them. Everything the binding does state is checked again here.
|
|
96
|
+
*
|
|
97
|
+
* `composeObjectStorageServiceEnvironment()` answers the same questions with a service runtime
|
|
98
|
+
* reason instead of an error.
|
|
99
|
+
*/
|
|
100
|
+
export const createObjectStorageBindingEnvironment = async (bindingArg, endpointArg) => {
|
|
101
|
+
const resolution = await resolveBindingEnvironment(bindingArg, endpointArg);
|
|
102
|
+
if (resolution.status !== 'composed')
|
|
103
|
+
throw new Error(resolution.message);
|
|
104
|
+
return resolution.environment;
|
|
72
105
|
};
|
|
73
106
|
/**
|
|
74
107
|
* Validates one binding's environment: the nine endpoint names, the eleven retention names all or
|
|
@@ -99,6 +132,9 @@ export const validateObjectStorageBindingEnvironment = async (environmentArg, pa
|
|
|
99
132
|
}
|
|
100
133
|
return errors;
|
|
101
134
|
};
|
|
135
|
+
const findEnvironmentCollisions = (claimedKeysArg, keysArg) => keysArg.filter((keyArg) => claimedKeysArg.has(keyArg)).sort();
|
|
136
|
+
const describeEnvironmentCollisions = (collisionsArg) => (`objectstorage binding environment collides with ${collisionsArg.join(', ')} already set on the `
|
|
137
|
+
+ 'workload');
|
|
102
138
|
/**
|
|
103
139
|
* A workload environment with one binding's environment added.
|
|
104
140
|
*
|
|
@@ -107,13 +143,52 @@ export const validateObjectStorageBindingEnvironment = async (environmentArg, pa
|
|
|
107
143
|
* would otherwise have one value silently replace the other. The inputs are not changed.
|
|
108
144
|
*/
|
|
109
145
|
export const mergeObjectStorageBindingEnvironment = (environmentArg, bindingEnvironmentArg) => {
|
|
110
|
-
const collisions = Object.keys(bindingEnvironmentArg)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (collisions.length > 0) {
|
|
114
|
-
throw new Error(`objectstorage binding environment collides with ${collisions.join(', ')} already set on the `
|
|
115
|
-
+ 'workload');
|
|
116
|
-
}
|
|
146
|
+
const collisions = findEnvironmentCollisions(new Set(Object.keys(environmentArg)), Object.keys(bindingEnvironmentArg));
|
|
147
|
+
if (collisions.length > 0)
|
|
148
|
+
throw new Error(describeEnvironmentCollisions(collisions));
|
|
117
149
|
return { ...environmentArg, ...bindingEnvironmentArg };
|
|
118
150
|
};
|
|
119
|
-
|
|
151
|
+
/**
|
|
152
|
+
* The service's own environment with the environment of every enabled object-storage binding
|
|
153
|
+
* added, or the service runtime reason it cannot be — so a producer reports the contract's
|
|
154
|
+
* verdict instead of classifying its errors.
|
|
155
|
+
*
|
|
156
|
+
* Each binding's names are `createObjectStorageBindingEnvironment()`'s from its node's endpoint,
|
|
157
|
+
* added as `mergeObjectStorageBindingEnvironment()` adds them. Bindings are taken in id order, so
|
|
158
|
+
* the verdict does not depend on the order of `sourcesArg`. A refusal outranks a wait, because a
|
|
159
|
+
* wait resolves on its own and a refusal never does: a binding waiting for retention evidence
|
|
160
|
+
* already claims all twenty of its names, so a collision with it is refused now, not once its
|
|
161
|
+
* evidence arrives. The first refusal is answered, otherwise the first wait, otherwise the
|
|
162
|
+
* composed environment. The inputs are not changed.
|
|
163
|
+
*/
|
|
164
|
+
export const composeObjectStorageServiceEnvironment = async (serviceEnvironmentArg, sourcesArg) => {
|
|
165
|
+
const sources = [...sourcesArg].sort((leftArg, rightArg) => (leftArg.binding.id < rightArg.binding.id ? -1 : leftArg.binding.id > rightArg.binding.id ? 1 : 0));
|
|
166
|
+
let environment = { ...serviceEnvironmentArg };
|
|
167
|
+
const claimedKeys = new Set(Object.keys(environment));
|
|
168
|
+
let wait = null;
|
|
169
|
+
for (const source of sources) {
|
|
170
|
+
const bindingId = source.binding.id;
|
|
171
|
+
const resolution = await resolveBindingEnvironment(source.binding, source.endpoint);
|
|
172
|
+
if (resolution.status === 'refused') {
|
|
173
|
+
return { status: 'refused', reason: resolution.reason, bindingId, message: resolution.message };
|
|
174
|
+
}
|
|
175
|
+
const keys = resolution.status === 'composed'
|
|
176
|
+
? Object.keys(resolution.environment)
|
|
177
|
+
: objectStorageBindingEnvironmentKeys;
|
|
178
|
+
const collisions = findEnvironmentCollisions(claimedKeys, keys);
|
|
179
|
+
if (collisions.length > 0) {
|
|
180
|
+
return { status: 'refused', reason: 'objectstorage-environment-conflict', bindingId,
|
|
181
|
+
message: describeEnvironmentCollisions(collisions) };
|
|
182
|
+
}
|
|
183
|
+
for (const key of keys)
|
|
184
|
+
claimedKeys.add(key);
|
|
185
|
+
if (resolution.status === 'composed') {
|
|
186
|
+
environment = { ...environment, ...resolution.environment };
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
wait ??= { status: 'waiting', reason: resolution.reason, bindingId, message: resolution.message };
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return wait ?? { status: 'composed', environment };
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2JqZWN0c3RvcmFnZWVudmlyb25tZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvcGxhdGZvcm0vb2JqZWN0c3RvcmFnZWVudmlyb25tZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1BLE9BQU8sRUFDTCxzQ0FBc0MsRUFDdEMsb0NBQW9DLEVBQ3BDLHdDQUF3QyxFQUN4Qyx1Q0FBdUMsRUFDdkMscUNBQXFDLEdBQ3RDLE1BQU0sb0JBQW9CLENBQUM7QUFTNUIsT0FBTyxFQUNMLHVDQUF1QyxFQUN2QyxxQ0FBcUMsRUFDckMseUNBQXlDLEVBQ3pDLHNDQUFzQyxFQUN0QyxvQ0FBb0MsR0FDckMsTUFBTSw2QkFBNkIsQ0FBQztBQUNyQyxPQUFPLEVBQUUsYUFBYSxFQUFFLGtCQUFrQixFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFFakY7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sbUNBQW1DLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQztJQUMvRCxHQUFHLG9DQUFvQztJQUN2QyxHQUFHLHFDQUFxQztDQUNoQyxDQUFDLENBQUM7QUF3Qlo7OztHQUdHO0FBQ0gsTUFBTSx5QkFBeUIsR0FBRyxLQUFLLEVBQ3JDLFVBQTRCLEVBQzVCLFdBQWtELEVBQ1YsRUF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QU8sRUFBRSxDQUFDO1FBQ3BHLENBQUM7SUFDSCxDQUFDO0lBQ0QsT0FBTyxJQUFJLElBQUksRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLFdBQVcsRUFBRSxDQUFDO0FBQ3JELENBQUMsQ0FBQyJ9
|
|
@@ -5,6 +5,7 @@ import type { IClusterNode, INodeAction, INodeMetricsSample, TNodeActionName } f
|
|
|
5
5
|
import type { IDeployment } from '../data/deployment.js';
|
|
6
6
|
import type { IIdentity } from '../data/user.js';
|
|
7
7
|
import type { IPlatformObjectStorageEndpoint } from '../platform/objectstorage.js';
|
|
8
|
+
import type { IPlatformDatabaseEndpoint } from '../platform/database.js';
|
|
8
9
|
import type { INodeCredentialMetadata, INodeCredentialMutationPreconditions, INodeCredentialMutationResult, TNodeCredentialPurpose } from '../data/nodecredential.js';
|
|
9
10
|
import type { INodeRuntimeRetirement } from '../data/noderetirement.js';
|
|
10
11
|
import type { INodeRuntimeBindingRead, INodeRuntimeBindingRequest } from '../data/noderuntimebinding.js';
|
|
@@ -246,6 +247,34 @@ export interface IReq_Any_Cloudly_SetClusterNodeCorestoreObjectStorageEndpoint e
|
|
|
246
247
|
node: IClusterNode;
|
|
247
248
|
};
|
|
248
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* An administrator states where a workload on one node reaches the node's Corestore database:
|
|
252
|
+
* `IClusterNode.data.corestoreDatabase`.
|
|
253
|
+
*
|
|
254
|
+
* A request of its own, separate from `setClusterNodeCorestoreEndpoint` and
|
|
255
|
+
* `setClusterNodeCorestoreObjectStorageEndpoint`: each sets one fact and never touches the others.
|
|
256
|
+
*
|
|
257
|
+
* Cloudly validates it with `validatePlatformDatabaseEndpoint` before it writes and takes the
|
|
258
|
+
* node's own real-write fence inside the writing transaction, as for the other two endpoints.
|
|
259
|
+
* `database: null` clears it, which is the same fact as never having set one: no database
|
|
260
|
+
* credential can be published for a binding on this node. A changed endpoint changes the binding
|
|
261
|
+
* request of every database binding placed on the node, so each is granted and published again,
|
|
262
|
+
* addressed to the new endpoint. The endpoint says where, never with what — no credential travels
|
|
263
|
+
* in this request or in the node document.
|
|
264
|
+
*/
|
|
265
|
+
export interface IReq_Any_Cloudly_SetClusterNodeCorestoreDatabaseEndpoint extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_SetClusterNodeCorestoreDatabaseEndpoint> {
|
|
266
|
+
method: 'setClusterNodeCorestoreDatabaseEndpoint';
|
|
267
|
+
request: {
|
|
268
|
+
identity: IIdentity;
|
|
269
|
+
nodeId: string;
|
|
270
|
+
/** The node's database endpoint, or `null` to state that it has none. */
|
|
271
|
+
database: IPlatformDatabaseEndpoint | null;
|
|
272
|
+
};
|
|
273
|
+
response: {
|
|
274
|
+
/** The node as it now stands, so a caller needs no second read to see what it set. */
|
|
275
|
+
node: IClusterNode;
|
|
276
|
+
};
|
|
277
|
+
}
|
|
249
278
|
export interface IReq_Any_Cloudly_CreateNodeAction extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_CreateNodeAction> {
|
|
250
279
|
method: 'createNodeAction';
|
|
251
280
|
request: {
|
|
@@ -2,6 +2,7 @@ import * as plugins from './plugins.js';
|
|
|
2
2
|
import type { IActiveSecretRecipientMetadata, ICorestoreDatabaseAllocationReference, IIdentityCredential, ISecretVersionReference } from './data/index.js';
|
|
3
3
|
import type { ISecretEnvelopeAdmissionBinding } from './runtime.js';
|
|
4
4
|
import type { IObjectStorageRetentionIntent, IObjectStorageRetentionEvidenceExpectation, IObjectStorageRetentionEvidence } from './platform/objectstorageretention.js';
|
|
5
|
+
import type { IPlatformDatabaseEndpoint } from './platform/database.js';
|
|
5
6
|
export type TCorestoreCredentialCapability = 'database' | 'objectstorage';
|
|
6
7
|
export declare const corestoreProviderConfigIds: Readonly<{
|
|
7
8
|
readonly database: "cloudly-corestore-database";
|
|
@@ -93,6 +94,14 @@ interface ICorestoreCredentialBindingRequestBase {
|
|
|
93
94
|
}
|
|
94
95
|
export type TCorestoreCredentialBindingRequest = ICorestoreCredentialBindingRequestBase & {
|
|
95
96
|
capability: 'database';
|
|
97
|
+
/**
|
|
98
|
+
* Where a workload reaches the database: the `corestoreDatabase` of the node the binding is
|
|
99
|
+
* placed on. Corestore addresses the binding's connection values to it, and it is part of
|
|
100
|
+
* the request digest, so a changed endpoint is a changed request that is granted and
|
|
101
|
+
* published again. A request without it names no address a workload can reach; whether one
|
|
102
|
+
* is admitted is the provider's decision, never a default this contract supplies.
|
|
103
|
+
*/
|
|
104
|
+
endpoint?: IPlatformDatabaseEndpoint;
|
|
96
105
|
} | ICorestoreCredentialBindingRequestBase & {
|
|
97
106
|
capability: 'objectstorage';
|
|
98
107
|
bucketName: string;
|
|
@@ -129,6 +138,33 @@ export interface ICorestoreObjectStorageCredentialPlaintextMaterial {
|
|
|
129
138
|
}
|
|
130
139
|
export type TCorestoreCredentialPlaintextMaterial = ICorestoreDatabaseCredentialPlaintextMaterial | ICorestoreObjectStorageCredentialPlaintextMaterial;
|
|
131
140
|
export declare const validateCorestoreDatabaseCredentialMaterial: (materialArg: unknown) => string[];
|
|
141
|
+
/** What a database binding's connection values are made of, besides where the database is. */
|
|
142
|
+
export interface ICorestoreDatabaseCredentialIdentity {
|
|
143
|
+
databaseName: string;
|
|
144
|
+
username: string;
|
|
145
|
+
password: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The connection URI of one database binding, addressed to `endpointArg`:
|
|
149
|
+
* `mongodb://<username>:<password>@<host>:<port>/<databaseName>?authSource=<databaseName>&directConnection=true`,
|
|
150
|
+
* the username, password and database name URI-component encoded, an IPv6 host in brackets.
|
|
151
|
+
* This is the one form Corestore writes and Cloudly checks, so the two can never disagree.
|
|
152
|
+
*/
|
|
153
|
+
export declare const createCorestoreDatabaseUri: (endpointArg: IPlatformDatabaseEndpoint, identityArg: ICorestoreDatabaseCredentialIdentity) => string;
|
|
154
|
+
/**
|
|
155
|
+
* The eleven connection values of one database binding, addressed to `endpointArg`: the three URI
|
|
156
|
+
* aliases from `createCorestoreDatabaseUri()`, `MONGODB_HOST` the endpoint host without brackets,
|
|
157
|
+
* `MONGODB_PORT` its port in decimal, and the database, username and password under both alias
|
|
158
|
+
* families. Throws the first reason the result would not be valid material; nothing is defaulted.
|
|
159
|
+
*/
|
|
160
|
+
export declare const createCorestoreDatabaseCredentialValues: (endpointArg: IPlatformDatabaseEndpoint, identityArg: ICorestoreDatabaseCredentialIdentity) => TCorestoreDatabaseCredentialValues;
|
|
161
|
+
/**
|
|
162
|
+
* Validates database material and that it is addressed to `endpointArg`: every value is the one
|
|
163
|
+
* `createCorestoreDatabaseCredentialValues()` derives from the endpoint and the material's own
|
|
164
|
+
* database name, username and password. Material a provider addressed to any other host or port —
|
|
165
|
+
* its own public host above all — is refused by name.
|
|
166
|
+
*/
|
|
167
|
+
export declare const validateCorestoreDatabaseCredentialMaterialEndpoint: (materialArg: unknown, endpointArg: IPlatformDatabaseEndpoint) => string[];
|
|
132
168
|
export declare const validateCorestoreObjectStorageCredentialMaterial: (materialArg: unknown, retentionExpectationArg?: IObjectStorageRetentionEvidenceExpectation) => Promise<string[]>;
|
|
133
169
|
export declare const validateCorestoreCredentialPlaintextMaterial: (materialArg: unknown, retentionExpectationArg?: IObjectStorageRetentionEvidenceExpectation) => Promise<string[]>;
|
|
134
170
|
export interface ICorestoreCredentialSecretValue {
|