@openupstream/sdk 0.9.1 → 0.10.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/README.md +25 -0
- package/dist/index.d.ts +36 -2
- package/dist/index.js +56 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +116 -11
- package/dist/internal.js +55 -5
- package/dist/internal.js.map +1 -1
- package/dist/keys.d.ts +54 -0
- package/dist/keys.js +84 -0
- package/dist/keys.js.map +1 -0
- package/dist/model.d.ts +297 -6
- package/dist/model.js +64 -4
- package/dist/model.js.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -40,3 +40,28 @@ Environment `npm-release` until a maintainer approves the run on GitHub,
|
|
|
40
40
|
then checks that the tag names the version, builds, tests and publishes
|
|
41
41
|
with npm trusted publishing and provenance: no npm token exists anywhere
|
|
42
42
|
(ARCHITECTURE.md, decision 80).
|
|
43
|
+
|
|
44
|
+
## Keys from inside a container
|
|
45
|
+
|
|
46
|
+
A Service or Job with a grant on a Key (`oup key grant`) encrypts and
|
|
47
|
+
decrypts with `@openupstream/sdk/keys`, in Node:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { keys } from '@openupstream/sdk/keys';
|
|
51
|
+
|
|
52
|
+
const stored = await keys().encrypt('site-passwords', password, { user: userId });
|
|
53
|
+
if (stored.ok) {
|
|
54
|
+
// stored.value is a string to keep anywhere; it names its Key and version.
|
|
55
|
+
}
|
|
56
|
+
const read = await keys().decryptText('site-passwords', ciphertext, { user: userId });
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The context is optional, not secret and recorded with the call; the same
|
|
60
|
+
one must be given to decrypt. A value has at most 4096 bytes. The client
|
|
61
|
+
finds the platform through `OUP_KEYS_URL` and `OUP_KEYS_TOKEN_FILE`, which
|
|
62
|
+
a container with a grant gets, reads the token on every call, and tries
|
|
63
|
+
again while the connection is refused, as it is in a container's first
|
|
64
|
+
second. Errors come back as `{ ok: false, error }` with a `kind` of
|
|
65
|
+
`no-identity` (no grant on any Key), `unreachable` or `status` (403 without
|
|
66
|
+
a grant for the operation, 404 for no such Key, 400 for what does not
|
|
67
|
+
decrypt, 429 above 20 calls a second).
|
package/dist/index.d.ts
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* The API surface is defined here first and implemented in control-plane/.
|
|
9
9
|
*/
|
|
10
|
-
export declare const SDK_VERSION = "0.
|
|
10
|
+
export declare const SDK_VERSION = "0.10.0";
|
|
11
11
|
export * from './model.js';
|
|
12
12
|
export * from './internal.js';
|
|
13
|
-
import type { Account, AccountInput, Bucket, BucketDetails, BucketInput, CliLogin, CustomDomainInput, DatabaseDetails, DatabaseInput, DatabasePatch, DatabaseProxy, DatabaseProxyInput, Domain, Id, JobDetails, JobInput, JobPatch, JobRun, JobRunInput, LogEntry, LogQuery, NodesReport, AccountToken, AccountTokenInput, AccountTokenPatch, AccountTokenRoll, AccountTokenWithSecret, Grant, GrantInput, Member, MemberPatch, Project, ProjectInput, ProjectUsage, Route, RouteInput, Secret, SecretInput, ServiceDetails, ServiceInput, ServicePatch, SiteDescriptionInput, SiteDetails, SiteInfo } from './model.js';
|
|
13
|
+
import type { Account, AccountInput, Bucket, BucketDetails, BucketInput, CliLogin, CustomDomainInput, DatabaseDetails, DatabaseInput, DatabasePatch, DatabaseProxy, DatabaseProxyInput, Domain, Id, JobDetails, JobInput, JobPatch, JobRun, JobRunInput, LogEntry, LogQuery, NodesReport, PlatformReport, AccountToken, AccountTokenInput, AccountTokenPatch, AccountTokenRoll, AccountTokenWithSecret, Grant, GrantInput, Member, MemberPatch, Project, ProjectInput, ProjectUsage, Route, RouteInput, Key, KeyCall, KeyGrantInput, KeyInput, Secret, SecretInput, ServiceDetails, ServiceInput, ServicePatch, SiteDescriptionInput, SiteDetails, SiteInfo } from './model.js';
|
|
14
14
|
/** The API is under `/api` of the platform's host (ARCHITECTURE.md, decision 120). */
|
|
15
15
|
export declare const DEFAULT_API_URL = "https://console.openupstream.com/api";
|
|
16
16
|
export interface ClientOptions {
|
|
@@ -92,6 +92,8 @@ export declare class OpenUpstreamClient {
|
|
|
92
92
|
listNodes(): Promise<ApiResult<NodesReport>>;
|
|
93
93
|
/** Names a Site, or removes its name with null; only for madAuth's `admin` role, signed in (ADR-0009). */
|
|
94
94
|
setSiteDescription(site: string, input: SiteDescriptionInput): Promise<ApiResult<SiteDetails>>;
|
|
95
|
+
/** The platform's own Project, read-only: its Databases and components; only for madAuth's `admin` role, signed in (decision 164). */
|
|
96
|
+
getPlatform(): Promise<ApiResult<PlatformReport>>;
|
|
95
97
|
listProjects(): Promise<ApiResult<Project[]>>;
|
|
96
98
|
createProject(input: ProjectInput): Promise<ApiResult<Project>>;
|
|
97
99
|
getProject(projectId: Id): Promise<ApiResult<Project>>;
|
|
@@ -166,6 +168,38 @@ export declare class OpenUpstreamClient {
|
|
|
166
168
|
/** Creates the Secret or replaces its value; the Project's Services get it in their environment. */
|
|
167
169
|
putSecret(projectId: Id, input: SecretInput): Promise<ApiResult<Secret>>;
|
|
168
170
|
deleteSecret(projectId: Id, name: string): Promise<ApiResult<void>>;
|
|
171
|
+
/** The Project's Keys, those pending deletion included; never their material. */
|
|
172
|
+
listKeys(projectId: Id): Promise<ApiResult<Key[]>>;
|
|
173
|
+
/** Creates a Key with its first version. */
|
|
174
|
+
createKey(projectId: Id, input: KeyInput): Promise<ApiResult<Key>>;
|
|
175
|
+
getKey(projectId: Id, keyId: Id): Promise<ApiResult<Key>>;
|
|
176
|
+
/** Adds a version, which encrypting uses from now on; what older versions encrypted still decrypts. */
|
|
177
|
+
rotateKey(projectId: Id, keyId: Id): Promise<ApiResult<Key>>;
|
|
178
|
+
/**
|
|
179
|
+
* Marks the Key pending deletion: it refuses every call from now on and
|
|
180
|
+
* is erased after KEY_LIMITS.deletionDays days, with everything it
|
|
181
|
+
* encrypted then unreadable for good. Returns the Key with `deletesAt`.
|
|
182
|
+
*/
|
|
183
|
+
deleteKey(projectId: Id, keyId: Id): Promise<ApiResult<Key>>;
|
|
184
|
+
/**
|
|
185
|
+
* Lets a Service or a Job of the Project (its id) encrypt, decrypt or
|
|
186
|
+
* both with the Key, or changes what it may; its pods then get their
|
|
187
|
+
* identity towards the key API, which restarts a Service once.
|
|
188
|
+
*/
|
|
189
|
+
putKeyGrant(projectId: Id, keyId: Id, holderId: Id, input: KeyGrantInput): Promise<ApiResult<Key>>;
|
|
190
|
+
/** Takes the grant away; the Service's or Job's next call is refused. */
|
|
191
|
+
deleteKeyGrant(projectId: Id, keyId: Id, holderId: Id): Promise<ApiResult<void>>;
|
|
192
|
+
/**
|
|
193
|
+
* The record of a Key's calls, newest first (kept 30 days): at most
|
|
194
|
+
* `limit` (100 by default, 1000 at most), those before the call
|
|
195
|
+
* `before` when given.
|
|
196
|
+
*/
|
|
197
|
+
listKeyCalls(projectId: Id, keyId: Id, query?: {
|
|
198
|
+
limit?: number;
|
|
199
|
+
before?: string;
|
|
200
|
+
}): Promise<ApiResult<KeyCall[]>>;
|
|
201
|
+
/** Takes a Key out of pending deletion, before it is erased. */
|
|
202
|
+
restoreKey(projectId: Id, keyId: Id): Promise<ApiResult<Key>>;
|
|
169
203
|
}
|
|
170
204
|
/**
|
|
171
205
|
* The API's `error`, followed by what its `issues` say about each field
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* The API surface is defined here first and implemented in control-plane/.
|
|
9
9
|
*/
|
|
10
|
-
export const SDK_VERSION = '0.
|
|
10
|
+
export const SDK_VERSION = '0.10.0';
|
|
11
11
|
export * from './model.js';
|
|
12
12
|
export * from './internal.js';
|
|
13
13
|
/** The API is under `/api` of the platform's host (ARCHITECTURE.md, decision 120). */
|
|
@@ -107,6 +107,10 @@ export class OpenUpstreamClient {
|
|
|
107
107
|
setSiteDescription(site, input) {
|
|
108
108
|
return this.#call('PUT', `/v1/admin/sites/${encodeURIComponent(site)}`, input);
|
|
109
109
|
}
|
|
110
|
+
/** The platform's own Project, read-only: its Databases and components; only for madAuth's `admin` role, signed in (decision 164). */
|
|
111
|
+
getPlatform() {
|
|
112
|
+
return this.#call('GET', '/v1/admin/platform');
|
|
113
|
+
}
|
|
110
114
|
listProjects() {
|
|
111
115
|
return this.#call('GET', '/v1/projects');
|
|
112
116
|
}
|
|
@@ -269,6 +273,57 @@ export class OpenUpstreamClient {
|
|
|
269
273
|
deleteSecret(projectId, name) {
|
|
270
274
|
return this.#call('DELETE', `/v1/projects/${encodeURIComponent(projectId)}/secrets/${encodeURIComponent(name)}`);
|
|
271
275
|
}
|
|
276
|
+
/** The Project's Keys, those pending deletion included; never their material. */
|
|
277
|
+
listKeys(projectId) {
|
|
278
|
+
return this.#call('GET', `/v1/projects/${encodeURIComponent(projectId)}/keys`);
|
|
279
|
+
}
|
|
280
|
+
/** Creates a Key with its first version. */
|
|
281
|
+
createKey(projectId, input) {
|
|
282
|
+
return this.#call('POST', `/v1/projects/${encodeURIComponent(projectId)}/keys`, input);
|
|
283
|
+
}
|
|
284
|
+
getKey(projectId, keyId) {
|
|
285
|
+
return this.#call('GET', `/v1/projects/${encodeURIComponent(projectId)}/keys/${encodeURIComponent(keyId)}`);
|
|
286
|
+
}
|
|
287
|
+
/** Adds a version, which encrypting uses from now on; what older versions encrypted still decrypts. */
|
|
288
|
+
rotateKey(projectId, keyId) {
|
|
289
|
+
return this.#call('POST', `/v1/projects/${encodeURIComponent(projectId)}/keys/${encodeURIComponent(keyId)}/rotate`);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Marks the Key pending deletion: it refuses every call from now on and
|
|
293
|
+
* is erased after KEY_LIMITS.deletionDays days, with everything it
|
|
294
|
+
* encrypted then unreadable for good. Returns the Key with `deletesAt`.
|
|
295
|
+
*/
|
|
296
|
+
deleteKey(projectId, keyId) {
|
|
297
|
+
return this.#call('DELETE', `/v1/projects/${encodeURIComponent(projectId)}/keys/${encodeURIComponent(keyId)}`);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Lets a Service or a Job of the Project (its id) encrypt, decrypt or
|
|
301
|
+
* both with the Key, or changes what it may; its pods then get their
|
|
302
|
+
* identity towards the key API, which restarts a Service once.
|
|
303
|
+
*/
|
|
304
|
+
putKeyGrant(projectId, keyId, holderId, input) {
|
|
305
|
+
return this.#call('PUT', `/v1/projects/${encodeURIComponent(projectId)}/keys/${encodeURIComponent(keyId)}/grants/${encodeURIComponent(holderId)}`, input);
|
|
306
|
+
}
|
|
307
|
+
/** Takes the grant away; the Service's or Job's next call is refused. */
|
|
308
|
+
deleteKeyGrant(projectId, keyId, holderId) {
|
|
309
|
+
return this.#call('DELETE', `/v1/projects/${encodeURIComponent(projectId)}/keys/${encodeURIComponent(keyId)}/grants/${encodeURIComponent(holderId)}`);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* The record of a Key's calls, newest first (kept 30 days): at most
|
|
313
|
+
* `limit` (100 by default, 1000 at most), those before the call
|
|
314
|
+
* `before` when given.
|
|
315
|
+
*/
|
|
316
|
+
listKeyCalls(projectId, keyId, query = {}) {
|
|
317
|
+
const search = new URLSearchParams({
|
|
318
|
+
...(query.limit === undefined ? {} : { limit: String(query.limit) }),
|
|
319
|
+
...(query.before === undefined ? {} : { before: query.before }),
|
|
320
|
+
}).toString();
|
|
321
|
+
return this.#call('GET', `/v1/projects/${encodeURIComponent(projectId)}/keys/${encodeURIComponent(keyId)}/calls${search === '' ? '' : `?${search}`}`);
|
|
322
|
+
}
|
|
323
|
+
/** Takes a Key out of pending deletion, before it is erased. */
|
|
324
|
+
restoreKey(projectId, keyId) {
|
|
325
|
+
return this.#call('POST', `/v1/projects/${encodeURIComponent(projectId)}/keys/${encodeURIComponent(keyId)}/restore`);
|
|
326
|
+
}
|
|
272
327
|
/** A GET whose answer is NDJSON, one entry per line, read as it arrives. */
|
|
273
328
|
async #stream(path, signal) {
|
|
274
329
|
const response = await fetch(`${this.baseUrl}${path}`, {
|
package/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AE,KAAK,EAAE,CAAC,EAAE,CAAC;gBACtE,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;YAChC,CAAC;QACL,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;QAChC,CAAC;IACL,CAAC;YAAS,CAAC;QACP,2EAA2E;QAC3E,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;AACL,CAAC"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* public API: it is served on its own port, never routed by ingress, and
|
|
5
5
|
* callers authenticate with their Kubernetes ServiceAccount token.
|
|
6
6
|
*/
|
|
7
|
-
import type { Account, Database, DatabaseAccess, DatabaseConnection, Domain, Id, Job, Member, Project, ResourceKind, Route, Service, Site, UsageUnit } from './model.js';
|
|
7
|
+
import type { Account, Database, DatabaseAccess, DatabaseConnection, DefinitionDatabaseAccess, Domain, Id, Job, Member, Project, ResourceKind, Route, Service, Site, UsageUnit } from './model.js';
|
|
8
8
|
/**
|
|
9
9
|
* Kubernetes names, by id (ARCHITECTURE.md, decision 42): the operators
|
|
10
10
|
* create these objects, the control plane reads and deletes them.
|
|
@@ -81,11 +81,21 @@ export declare const databaseConnection: (database: Pick<Database, "id" | "proje
|
|
|
81
81
|
* Nothing answers there while no standby is ready.
|
|
82
82
|
*/
|
|
83
83
|
export declare const databaseReadConnection: (database: Pick<Database, "id" | "projectId">) => DatabaseConnection;
|
|
84
|
+
/** The Kubernetes Secret with the values of the Secrets a Service's or a Job's definition names (decision 170); it exists only while the definition names one. */
|
|
85
|
+
export declare const serviceEnvSecret: (service: Pick<Service, "id">) => string;
|
|
86
|
+
export declare const jobEnvSecret: (job: Pick<Job, "id">) => string;
|
|
87
|
+
/** `DATABASE_URL_<NAME>`'s suffix: the Database's name upper-cased, `-` as `_`. */
|
|
88
|
+
export declare const databaseEnvSuffix: (database: {
|
|
89
|
+
readonly name: string;
|
|
90
|
+
}) => string;
|
|
84
91
|
/**
|
|
85
|
-
* The
|
|
86
|
-
*
|
|
92
|
+
* The names of the URLs the platform sets in every container of a Project
|
|
93
|
+
* with these live Databases (decision 97). A Secret or Variable of one of
|
|
94
|
+
* these names is overridden by the platform's value.
|
|
87
95
|
*/
|
|
88
|
-
export declare const
|
|
96
|
+
export declare const databaseEnvNames: (databases: readonly {
|
|
97
|
+
readonly name: string;
|
|
98
|
+
}[]) => string[];
|
|
89
99
|
/**
|
|
90
100
|
* The `kubernetes.io/dockerconfigjson` Secret in a Project's namespace with
|
|
91
101
|
* the registry credentials of all its Services and Jobs, each under its
|
|
@@ -215,12 +225,91 @@ export interface ServiceRow {
|
|
|
215
225
|
* before. The operator puts it on the pod template, so a change rolls the
|
|
216
226
|
* Service and its pods read the new values.
|
|
217
227
|
*/
|
|
218
|
-
readonly secretsVersion: string;
|
|
219
228
|
/** The Project's live Databases, oldest first: the Service gets a DATABASE_URL for each (decision 97). */
|
|
220
229
|
readonly databases: readonly RowDatabase[];
|
|
230
|
+
/**
|
|
231
|
+
* What its definition names for its containers (decision 170): the
|
|
232
|
+
* Secrets' names (their values are in `serviceEnvSecret`, which the
|
|
233
|
+
* control plane writes, when there is at least one), the plain
|
|
234
|
+
* Variables, and the version of the named Secrets' values last written
|
|
235
|
+
* there, which rolls the Service when it changes.
|
|
236
|
+
*/
|
|
237
|
+
readonly secrets: readonly string[];
|
|
238
|
+
readonly variables: Readonly<Record<string, string>>;
|
|
239
|
+
readonly envVersion: string;
|
|
240
|
+
/**
|
|
241
|
+
* Its rollout waits for its pre-deploy Job (decision 173): the Services
|
|
242
|
+
* operator leaves the Service's objects as they are, and creates none
|
|
243
|
+
* for a new one. Not part of the spec version.
|
|
244
|
+
*/
|
|
245
|
+
readonly held?: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Whether the Service has a grant on a Key (decision 168): its pods then
|
|
248
|
+
* run as a ServiceAccount of their own with a token for the key API.
|
|
249
|
+
* Absent from a control plane older than Keys.
|
|
250
|
+
*/
|
|
251
|
+
readonly keyAccess?: boolean;
|
|
221
252
|
}
|
|
222
|
-
/**
|
|
223
|
-
export
|
|
253
|
+
/** The audience of the token a pod presents to the key API (decision 168); the Kubernetes API accepts no such token. */
|
|
254
|
+
export declare const KEYS_AUDIENCE = "openupstream-keys";
|
|
255
|
+
/** The key API's port on the control plane's pods and its Kubernetes Service. */
|
|
256
|
+
export declare const KEYS_PORT = 8084;
|
|
257
|
+
/** Where a pod with a Key grant finds its token: the kubelet renews the file, so it is read on every call. */
|
|
258
|
+
export declare const KEYS_TOKEN_DIRECTORY = "/var/run/secrets/openupstream";
|
|
259
|
+
export declare const KEYS_TOKEN_FILE = "token";
|
|
260
|
+
/** How long such a token lasts; the kubelet replaces it well before. */
|
|
261
|
+
export declare const KEYS_TOKEN_SECONDS = 3600;
|
|
262
|
+
/** The environment variables a pod with a Key grant gets: the key API's URL and its token's path. */
|
|
263
|
+
export declare const KEYS_URL_ENV = "OUP_KEYS_URL";
|
|
264
|
+
export declare const KEYS_TOKEN_FILE_ENV = "OUP_KEYS_TOKEN_FILE";
|
|
265
|
+
/** The name of the control plane's pods' label and of their Kubernetes Service (control-plane/deploy). */
|
|
266
|
+
export declare const CONTROL_PLANE_NAME = "control-plane";
|
|
267
|
+
/** The key API as a pod of any Project reaches it. */
|
|
268
|
+
export declare const keysUrl: () => string;
|
|
269
|
+
/**
|
|
270
|
+
* A Database a Service's or Job's row names (decision 173). With `role`,
|
|
271
|
+
* the definition's own Postgres role there: its containers log in as it,
|
|
272
|
+
* with the password in `databaseRoleSecret(role)`. Without, as the
|
|
273
|
+
* Database's owner. `access` is absent from a control plane before
|
|
274
|
+
* decision 173, whose rows name every Database of the Project as owner.
|
|
275
|
+
*/
|
|
276
|
+
export type RowDatabase = Pick<Database, 'id' | 'name'> & {
|
|
277
|
+
readonly access?: DefinitionDatabaseAccess;
|
|
278
|
+
readonly role?: {
|
|
279
|
+
readonly id: Id;
|
|
280
|
+
readonly name: string;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
/** The name of a Service's or Job's own role in a Database: `svc_<name>` or `job_<name>`, the name's `-` as `_`. */
|
|
284
|
+
export declare const definitionRoleName: (definition: {
|
|
285
|
+
readonly kind: "service" | "job";
|
|
286
|
+
readonly name: string;
|
|
287
|
+
}) => string;
|
|
288
|
+
/** The group role a Service's or Job's own role is a member of, which lets it connect (made at a Database's creation). */
|
|
289
|
+
export declare const CONNECT_GROUP_ROLE = "oup_connect";
|
|
290
|
+
/**
|
|
291
|
+
* A Service's or Job's role in a Database, as the Databases operator adds
|
|
292
|
+
* it to the Cluster; without `login` it stays and cannot sign in. `dropped`
|
|
293
|
+
* once its Service or Job is deleted and its grants are taken away: the
|
|
294
|
+
* Cluster then drops it (`ensure: absent`).
|
|
295
|
+
*/
|
|
296
|
+
export interface DefinitionRoleRow {
|
|
297
|
+
readonly id: Id;
|
|
298
|
+
readonly name: string;
|
|
299
|
+
readonly login: boolean;
|
|
300
|
+
readonly dropped?: true;
|
|
301
|
+
}
|
|
302
|
+
/** The role the control plane connects as to delete a deleted Service's or Job's role: it may call the cleanup function and nothing else. */
|
|
303
|
+
export declare const ADMIN_ROLE = "oup_admin";
|
|
304
|
+
/** The role the cleanup function runs as: a member of the owner and of every Service's and Job's role, without a login. */
|
|
305
|
+
export declare const CLEANER_ROLE = "oup_cleaner";
|
|
306
|
+
/** The schema of the platform's in a Database, and its function that takes away a Service's or Job's role's grants. */
|
|
307
|
+
export declare const PLATFORM_SCHEMA = "oup";
|
|
308
|
+
export declare const CLEANUP_FUNCTION = "drop_owned";
|
|
309
|
+
/** The `kubernetes.io/basic-auth` Secret CloudNativePG reads `oup_admin`'s password from, written by the control plane. */
|
|
310
|
+
export declare const databaseAdminSecret: (database: Pick<Database, "id">) => string;
|
|
311
|
+
/** Where the control plane reaches a Database's primary, past the Pooler: one statement, and no pool of its own for it. */
|
|
312
|
+
export declare const databasePrimaryHost: (database: Pick<Database, "id" | "projectId">) => string;
|
|
224
313
|
/** Every node carries its Site's id in this label (ADR-0007). */
|
|
225
314
|
export declare const ZONE_LABEL = "topology.kubernetes.io/zone";
|
|
226
315
|
/** `true` on the nodes of a compute Site, where Databases, Services and Jobs run. */
|
|
@@ -240,7 +329,7 @@ export declare const SPEC_VERSION_ANNOTATION = "openupstream.io/spec-version";
|
|
|
240
329
|
* `deploying` until the Deployment carries the version its row asks for,
|
|
241
330
|
* so a change is not `running` before it has been applied and rolled out.
|
|
242
331
|
*/
|
|
243
|
-
export declare const serviceSpecVersion: (row: Pick<ServiceRow, "service" | "pinnedImage" | "site" | "
|
|
332
|
+
export declare const serviceSpecVersion: (row: Pick<ServiceRow, "service" | "pinnedImage" | "site" | "databases" | "keyAccess" | "secrets" | "variables" | "envVersion">) => string;
|
|
244
333
|
/** One Job as the Jobs operator needs it. */
|
|
245
334
|
export interface JobRow {
|
|
246
335
|
readonly project: Project;
|
|
@@ -251,6 +340,11 @@ export interface JobRow {
|
|
|
251
340
|
readonly site: Site;
|
|
252
341
|
/** The Project's live Databases, oldest first: its runs get a DATABASE_URL for each (decision 97). */
|
|
253
342
|
readonly databases: readonly RowDatabase[];
|
|
343
|
+
/** What its definition names for its runs (decision 170), as a ServiceRow's; a run reads the values when it starts, so there is no version. */
|
|
344
|
+
readonly secrets: readonly string[];
|
|
345
|
+
readonly variables: Readonly<Record<string, string>>;
|
|
346
|
+
/** Whether the Job has a grant on a Key (decision 168), as a ServiceRow's. */
|
|
347
|
+
readonly keyAccess?: boolean;
|
|
254
348
|
}
|
|
255
349
|
/**
|
|
256
350
|
* Everything of a Job's row that its CronJob is rendered from. The Jobs
|
|
@@ -259,7 +353,7 @@ export interface JobRow {
|
|
|
259
353
|
* template. The Secrets are not part of it: a run's pod reads them when it
|
|
260
354
|
* starts, so nothing needs to change when they do.
|
|
261
355
|
*/
|
|
262
|
-
export declare const jobSpecVersion: (row: Pick<JobRow, "job" | "pinnedImage" | "site" | "databases">) => string;
|
|
356
|
+
export declare const jobSpecVersion: (row: Pick<JobRow, "job" | "pinnedImage" | "site" | "databases" | "keyAccess" | "secrets" | "variables">) => string;
|
|
263
357
|
export interface DatabaseRow {
|
|
264
358
|
readonly project: Project;
|
|
265
359
|
readonly database: Database;
|
|
@@ -270,14 +364,25 @@ export interface DatabaseRow {
|
|
|
270
364
|
* so it no longer depends on the source's ObjectStore.
|
|
271
365
|
*/
|
|
272
366
|
readonly restoring?: boolean;
|
|
273
|
-
/**
|
|
274
|
-
|
|
367
|
+
/**
|
|
368
|
+
* The roles in this Database, oldest first: the callers' own (decision
|
|
369
|
+
* 126), then those of the Services and Jobs that name it (decision 173).
|
|
370
|
+
*/
|
|
371
|
+
readonly roles?: readonly (DatabaseRoleRow | DefinitionRoleRow)[];
|
|
275
372
|
/**
|
|
276
373
|
* The control plane holds the `app` user's password and writes its
|
|
277
374
|
* Secrets (decision 156): the Cluster then reads the verifier from
|
|
278
375
|
* `databaseAppVerifierSecret`. Absent for a Database from before.
|
|
279
376
|
*/
|
|
280
377
|
readonly appCredentials?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* The Database has what deleting a deleted Service's or Job's role
|
|
380
|
+
* takes (decision 173), made at its creation, and the control plane
|
|
381
|
+
* holds the password of the role it connects as: the operator then
|
|
382
|
+
* keeps the platform's two roles in the Cluster. Absent for a Database
|
|
383
|
+
* from before.
|
|
384
|
+
*/
|
|
385
|
+
readonly cleanup?: boolean;
|
|
281
386
|
/**
|
|
282
387
|
* The Project's tunnel host (tunnelHostname), on every row of a Project
|
|
283
388
|
* that has a role in any Database: the operator then runs the tunnel's
|
package/dist/internal.js
CHANGED
|
@@ -68,11 +68,23 @@ export const databaseReadConnection = (database) => ({
|
|
|
68
68
|
...databaseConnection(database),
|
|
69
69
|
host: `${readPoolerName(database)}.${projectNamespace(database.projectId)}.svc.cluster.local`,
|
|
70
70
|
});
|
|
71
|
+
/** The Kubernetes Secret with the values of the Secrets a Service's or a Job's definition names (decision 170); it exists only while the definition names one. */
|
|
72
|
+
export const serviceEnvSecret = (service) => `svc-${service.id}-env`;
|
|
73
|
+
export const jobEnvSecret = (job) => `job-${job.id}-env`;
|
|
74
|
+
/** `DATABASE_URL_<NAME>`'s suffix: the Database's name upper-cased, `-` as `_`. */
|
|
75
|
+
export const databaseEnvSuffix = (database) => database.name.toUpperCase().replaceAll('-', '_');
|
|
71
76
|
/**
|
|
72
|
-
* The
|
|
73
|
-
*
|
|
77
|
+
* The names of the URLs the platform sets in every container of a Project
|
|
78
|
+
* with these live Databases (decision 97). A Secret or Variable of one of
|
|
79
|
+
* these names is overridden by the platform's value.
|
|
74
80
|
*/
|
|
75
|
-
export const
|
|
81
|
+
export const databaseEnvNames = (databases) => databases.length === 0
|
|
82
|
+
? []
|
|
83
|
+
: ['DATABASE_URL', 'DATABASE_READ_URL', ...databases.flatMap((database) => [`DATABASE_URL_${databaseEnvSuffix(database)}`, `DATABASE_READ_URL_${databaseEnvSuffix(database)}`])];
|
|
84
|
+
/** A named Database in a spec version: who the containers log in as is part of it. */
|
|
85
|
+
const rowDatabaseVersion = (database) => `${database.id}=${database.name}${database.role === undefined ? '' : `:${database.role.name}`}`;
|
|
86
|
+
/** A map's entries by name, so two maps with the same entries give the same version. */
|
|
87
|
+
const sortedEntries = (map) => Object.entries(map).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
76
88
|
/**
|
|
77
89
|
* The `kubernetes.io/dockerconfigjson` Secret in a Project's namespace with
|
|
78
90
|
* the registry credentials of all its Services and Jobs, each under its
|
|
@@ -134,6 +146,37 @@ export const internalUsagePath = (accountId, month) => `${INTERNAL_ACCOUNTS_PATH
|
|
|
134
146
|
* metering reads the Resource from them.
|
|
135
147
|
*/
|
|
136
148
|
export const ingressRouteName = (domainId, resource) => `domain-${domainId}-${resource.kind === 'bucket' ? 'bucket' : 'svc'}-${resource.id}`;
|
|
149
|
+
/** The audience of the token a pod presents to the key API (decision 168); the Kubernetes API accepts no such token. */
|
|
150
|
+
export const KEYS_AUDIENCE = 'openupstream-keys';
|
|
151
|
+
/** The key API's port on the control plane's pods and its Kubernetes Service. */
|
|
152
|
+
export const KEYS_PORT = 8084;
|
|
153
|
+
/** Where a pod with a Key grant finds its token: the kubelet renews the file, so it is read on every call. */
|
|
154
|
+
export const KEYS_TOKEN_DIRECTORY = '/var/run/secrets/openupstream';
|
|
155
|
+
export const KEYS_TOKEN_FILE = 'token';
|
|
156
|
+
/** How long such a token lasts; the kubelet replaces it well before. */
|
|
157
|
+
export const KEYS_TOKEN_SECONDS = 3600;
|
|
158
|
+
/** The environment variables a pod with a Key grant gets: the key API's URL and its token's path. */
|
|
159
|
+
export const KEYS_URL_ENV = 'OUP_KEYS_URL';
|
|
160
|
+
export const KEYS_TOKEN_FILE_ENV = 'OUP_KEYS_TOKEN_FILE';
|
|
161
|
+
/** The name of the control plane's pods' label and of their Kubernetes Service (control-plane/deploy). */
|
|
162
|
+
export const CONTROL_PLANE_NAME = 'control-plane';
|
|
163
|
+
/** The key API as a pod of any Project reaches it. */
|
|
164
|
+
export const keysUrl = () => `http://${CONTROL_PLANE_NAME}.${projectNamespace(PLATFORM.project.id)}.svc.cluster.local:${KEYS_PORT}`;
|
|
165
|
+
/** The name of a Service's or Job's own role in a Database: `svc_<name>` or `job_<name>`, the name's `-` as `_`. */
|
|
166
|
+
export const definitionRoleName = (definition) => `${definition.kind === 'service' ? 'svc' : 'job'}_${definition.name.replaceAll('-', '_')}`;
|
|
167
|
+
/** The group role a Service's or Job's own role is a member of, which lets it connect (made at a Database's creation). */
|
|
168
|
+
export const CONNECT_GROUP_ROLE = 'oup_connect';
|
|
169
|
+
/** The role the control plane connects as to delete a deleted Service's or Job's role: it may call the cleanup function and nothing else. */
|
|
170
|
+
export const ADMIN_ROLE = 'oup_admin';
|
|
171
|
+
/** The role the cleanup function runs as: a member of the owner and of every Service's and Job's role, without a login. */
|
|
172
|
+
export const CLEANER_ROLE = 'oup_cleaner';
|
|
173
|
+
/** The schema of the platform's in a Database, and its function that takes away a Service's or Job's role's grants. */
|
|
174
|
+
export const PLATFORM_SCHEMA = 'oup';
|
|
175
|
+
export const CLEANUP_FUNCTION = 'drop_owned';
|
|
176
|
+
/** The `kubernetes.io/basic-auth` Secret CloudNativePG reads `oup_admin`'s password from, written by the control plane. */
|
|
177
|
+
export const databaseAdminSecret = (database) => `${clusterName(database)}-admin`;
|
|
178
|
+
/** Where the control plane reaches a Database's primary, past the Pooler: one statement, and no pool of its own for it. */
|
|
179
|
+
export const databasePrimaryHost = (database) => `${clusterName(database)}-rw.${projectNamespace(database.projectId)}.svc.cluster.local`;
|
|
137
180
|
/** Every node carries its Site's id in this label (ADR-0007). */
|
|
138
181
|
export const ZONE_LABEL = 'topology.kubernetes.io/zone';
|
|
139
182
|
/** `true` on the nodes of a compute Site, where Databases, Services and Jobs run. */
|
|
@@ -160,8 +203,12 @@ export const serviceSpecVersion = (row) => [
|
|
|
160
203
|
row.service.cpuMillicores,
|
|
161
204
|
row.service.port,
|
|
162
205
|
row.site,
|
|
163
|
-
|
|
164
|
-
|
|
206
|
+
// What it names for its containers, and the version of its named Secrets that is in the cluster.
|
|
207
|
+
`env:${row.envVersion}`,
|
|
208
|
+
JSON.stringify([row.secrets, sortedEntries(row.variables)]),
|
|
209
|
+
...row.databases.map(rowDatabaseVersion),
|
|
210
|
+
// Only when set, so a Service without a grant keeps the version an operator from before Keys computes.
|
|
211
|
+
...(row.keyAccess === true ? ['keys'] : []),
|
|
165
212
|
].join('|');
|
|
166
213
|
/**
|
|
167
214
|
* Everything of a Job's row that its CronJob is rendered from. The Jobs
|
|
@@ -181,6 +228,9 @@ export const jobSpecVersion = (row) => JSON.stringify([
|
|
|
181
228
|
row.job.timeZone,
|
|
182
229
|
row.site,
|
|
183
230
|
row.databases,
|
|
231
|
+
// Only when set, as in serviceSpecVersion.
|
|
232
|
+
...(row.keyAccess === true ? ['keys'] : []),
|
|
233
|
+
{ secrets: row.secrets, variables: sortedEntries(row.variables) },
|
|
184
234
|
]);
|
|
185
235
|
/**
|
|
186
236
|
* The platform's own Account, Project and Databases: the control plane's
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAa,EAAU,EAAE,CAAC,WAAW,SAAS,EAAE,CAAC;AAElF,qGAAqG;AACrG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,MAAM,QAAQ,CAAC,EAAE,EAAE,CAAC;AAE3F,kGAAkG;AAClG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC;AAExG;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;AAEvG;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,GAAG,2BAA2B,CAAC,GAAG,IAAI,CAAC,CAAC;AAE9H,2EAA2E;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC;AAE5G;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAa,EAAE,cAAsB,EAAU,E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AAsC;QACjD,IAAI,EAAE,UAAU;QAChB,SAAS,EAAE,sBAAsB;KACpC;IACD,QAAQ,EAAE;QACN,EAAE,EAAE,sCAAsC;QAC1C,SAAS,EAAE,sCAAsC;QACjD,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,sBAAsB;KACpC;IACD,YAAY,EAAE;QACV,EAAE,EAAE,sCAAsC;QAC1C,SAAS,EAAE,sCAAsC;QACjD,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,sBAAsB;KACpC;IACD,+FAA+F;IAC/F,eAAe,EAAE;QACb,EAAE,EAAE,sCAAsC;QAC1C,SAAS,EAAE,sCAAsC;QACjD,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,sBAAsB;KACpC;CAOJ,CAAC;AAEF,kHAAkH;AAClH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAc,EAAiB,EAAE,CAAC;IAC3D,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;IAC3E,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE;CAClF,CAAC"}
|
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Strings given with a value when it is encrypted, which must be given again, equal, to decrypt it. Not secret, and recorded. */
|
|
2
|
+
export type KeyContext = Readonly<Record<string, string>>;
|
|
3
|
+
export type KeysError =
|
|
4
|
+
/** This container has no grant on any Key: the two environment variables are missing. */
|
|
5
|
+
{
|
|
6
|
+
readonly kind: 'no-identity';
|
|
7
|
+
readonly message: string;
|
|
8
|
+
}
|
|
9
|
+
/** The key API could not be reached, also after trying again. */
|
|
10
|
+
| {
|
|
11
|
+
readonly kind: 'unreachable';
|
|
12
|
+
readonly message: string;
|
|
13
|
+
}
|
|
14
|
+
/** The key API's answer: 403 without a grant for the operation, 404 for no such Key, 400 for what cannot be decrypted, 429 above the rate limit, … */
|
|
15
|
+
| {
|
|
16
|
+
readonly kind: 'status';
|
|
17
|
+
readonly status: number;
|
|
18
|
+
readonly message: string;
|
|
19
|
+
};
|
|
20
|
+
export type KeysResult<T> = {
|
|
21
|
+
readonly ok: true;
|
|
22
|
+
readonly value: T;
|
|
23
|
+
} | {
|
|
24
|
+
readonly ok: false;
|
|
25
|
+
readonly error: KeysError;
|
|
26
|
+
};
|
|
27
|
+
export interface KeysOptions {
|
|
28
|
+
/** The process's environment by default. */
|
|
29
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
30
|
+
readonly fetch?: typeof fetch;
|
|
31
|
+
readonly readToken?: (path: string) => Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* How often a call that could not connect is tried again, a second
|
|
34
|
+
* apart (5 by default). A container's connections in its first second
|
|
35
|
+
* are refused, until the platform's network knows its address.
|
|
36
|
+
*/
|
|
37
|
+
readonly retries?: number;
|
|
38
|
+
readonly retryDelayMs?: number;
|
|
39
|
+
/** How long one attempt may take before it counts as not connected (10 s by default). */
|
|
40
|
+
readonly timeoutMs?: number;
|
|
41
|
+
}
|
|
42
|
+
/** The client for the key API of the container it runs in. */
|
|
43
|
+
export declare function keys(options?: KeysOptions): {
|
|
44
|
+
/**
|
|
45
|
+
* Encrypts at most KEY_CALL_LIMITS.maxPlaintextBytes bytes with the
|
|
46
|
+
* Key `key` of this Project. The result is a string to store
|
|
47
|
+
* anywhere; it names its Key and version.
|
|
48
|
+
*/
|
|
49
|
+
encrypt(key: string, plaintext: Uint8Array | string, context?: KeyContext): Promise<KeysResult<string>>;
|
|
50
|
+
/** Decrypts what `encrypt` returned, given the same context. */
|
|
51
|
+
decrypt(key: string, ciphertext: string, context?: KeyContext): Promise<KeysResult<Uint8Array>>;
|
|
52
|
+
/** `decrypt` for a value that was text. */
|
|
53
|
+
decryptText(key: string, ciphertext: string, context?: KeyContext): Promise<KeysResult<string>>;
|
|
54
|
+
};
|
package/dist/keys.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encrypting and decrypting with a Key from inside a Service or Job
|
|
3
|
+
* (`@openupstream/sdk/keys`; ARCHITECTURE.md, "Keys"). An entry point of
|
|
4
|
+
* its own, since it reads a file and so runs in Node only; the rest of the
|
|
5
|
+
* sdk also runs in a browser.
|
|
6
|
+
*
|
|
7
|
+
* A container whose Service or Job has a grant on a Key (`oup key grant`)
|
|
8
|
+
* gets `OUP_KEYS_URL` and `OUP_KEYS_TOKEN_FILE`. The platform replaces the
|
|
9
|
+
* token in that file about once an hour, so it is read on every call.
|
|
10
|
+
*/
|
|
11
|
+
import { readFile } from 'node:fs/promises';
|
|
12
|
+
import { KEYS_TOKEN_FILE_ENV, KEYS_URL_ENV } from './internal.js';
|
|
13
|
+
import { errorMessage } from './index.js';
|
|
14
|
+
import { KEY_CALL_LIMITS } from './model.js';
|
|
15
|
+
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
16
|
+
/** The client for the key API of the container it runs in. */
|
|
17
|
+
export function keys(options = {}) {
|
|
18
|
+
const env = options.env ?? process.env;
|
|
19
|
+
const request = options.fetch ?? fetch;
|
|
20
|
+
const readToken = options.readToken ?? ((path) => readFile(path, 'utf8'));
|
|
21
|
+
const retries = options.retries ?? 5;
|
|
22
|
+
const retryDelayMs = options.retryDelayMs ?? 1000;
|
|
23
|
+
const timeoutMs = options.timeoutMs ?? 10_000;
|
|
24
|
+
const call = async (key, operation, body) => {
|
|
25
|
+
const url = env[KEYS_URL_ENV];
|
|
26
|
+
const tokenFile = env[KEYS_TOKEN_FILE_ENV];
|
|
27
|
+
if (url === undefined || url === '' || tokenFile === undefined || tokenFile === '') {
|
|
28
|
+
return {
|
|
29
|
+
ok: false,
|
|
30
|
+
error: { kind: 'no-identity', message: `${KEYS_URL_ENV} and ${KEYS_TOKEN_FILE_ENV} are not set: this Service or Job has no grant on a Key (oup key grant)` },
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const attempt = async (left) => {
|
|
34
|
+
const sent = await readToken(tokenFile)
|
|
35
|
+
.then((token) => request(`${url}/v1/keys/${encodeURIComponent(key)}/${operation}`, {
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: { authorization: `Bearer ${token.trim()}`, 'content-type': 'application/json' },
|
|
38
|
+
body: JSON.stringify(body),
|
|
39
|
+
// A connection that is accepted but never answered must not hold the caller for good.
|
|
40
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
41
|
+
}))
|
|
42
|
+
.then((response) => ({ response }), (error) => ({ failure: error instanceof Error ? error.message : String(error) }));
|
|
43
|
+
if ('failure' in sent) {
|
|
44
|
+
if (left > 0) {
|
|
45
|
+
await wait(retryDelayMs);
|
|
46
|
+
return attempt(left - 1);
|
|
47
|
+
}
|
|
48
|
+
return { ok: false, error: { kind: 'unreachable', message: sent.failure } };
|
|
49
|
+
}
|
|
50
|
+
const answer = await sent.response.json().catch(() => undefined);
|
|
51
|
+
return sent.response.ok ? { ok: true, value: answer } : { ok: false, error: { kind: 'status', status: sent.response.status, message: errorMessage(answer, sent.response.statusText || `HTTP ${sent.response.status}`) } };
|
|
52
|
+
};
|
|
53
|
+
return attempt(retries);
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
/**
|
|
57
|
+
* Encrypts at most KEY_CALL_LIMITS.maxPlaintextBytes bytes with the
|
|
58
|
+
* Key `key` of this Project. The result is a string to store
|
|
59
|
+
* anywhere; it names its Key and version.
|
|
60
|
+
*/
|
|
61
|
+
async encrypt(key, plaintext, context) {
|
|
62
|
+
const bytes = typeof plaintext === 'string' ? Buffer.from(plaintext, 'utf8') : Buffer.from(plaintext);
|
|
63
|
+
if (bytes.length > KEY_CALL_LIMITS.maxPlaintextBytes) {
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
error: { kind: 'status', status: 400, message: `a plaintext has at most ${KEY_CALL_LIMITS.maxPlaintextBytes} bytes; encrypt larger data with a key of your own and that key with the Key` },
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const result = await call(key, 'encrypt', { plaintext: bytes.toString('base64'), ...(context === undefined ? {} : { context }) });
|
|
70
|
+
return result.ok ? { ok: true, value: result.value.ciphertext } : result;
|
|
71
|
+
},
|
|
72
|
+
/** Decrypts what `encrypt` returned, given the same context. */
|
|
73
|
+
async decrypt(key, ciphertext, context) {
|
|
74
|
+
const result = await call(key, 'decrypt', { ciphertext, ...(context === undefined ? {} : { context }) });
|
|
75
|
+
return result.ok ? { ok: true, value: new Uint8Array(Buffer.from(result.value.plaintext, 'base64')) } : result;
|
|
76
|
+
},
|
|
77
|
+
/** `decrypt` for a value that was text. */
|
|
78
|
+
async decryptText(key, ciphertext, context) {
|
|
79
|
+
const result = await this.decrypt(key, ciphertext, context);
|
|
80
|
+
return result.ok ? { ok: true, value: Buffer.from(result.value).toString('utf8') } : result;
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=keys.js.map
|
package/dist/keys.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClE,OA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
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* One pod of a platform Database or component (`GET /v1/admin/platform`):
|
|
77
|
+
* where it runs and whether it runs.
|
|
78
|
+
*/
|
|
79
|
+
export interface PlatformInstance {
|
|
80
|
+
/** The pod's name. */
|
|
81
|
+
name: string;
|
|
82
|
+
/** Its node's Site; null before it is scheduled, or on a node without one. */
|
|
83
|
+
site: Site | null;
|
|
84
|
+
/** Running with every container started, and not being deleted. */
|
|
85
|
+
running: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** An instance of a platform Database: its primary, or the standby. */
|
|
88
|
+
export interface PlatformDatabaseInstance extends PlatformInstance {
|
|
89
|
+
/** CloudNativePG's current primary; false for the standby, and for every instance while the Cluster cannot be read. */
|
|
90
|
+
primary: boolean;
|
|
91
|
+
}
|
|
92
|
+
/** One of the platform's own Databases, read live like a customer's (`GET /v1/admin/platform`). */
|
|
93
|
+
export interface PlatformDatabase {
|
|
94
|
+
id: Id;
|
|
95
|
+
name: string;
|
|
96
|
+
/** Where the primary runs when nothing has failed. */
|
|
97
|
+
homeSite: Site;
|
|
98
|
+
memoryMb: number;
|
|
99
|
+
storageGb: number;
|
|
100
|
+
state: DatabaseState;
|
|
101
|
+
/** The primary runs outside the Home site: a failover moved it, and it stays there until a switchover moves it back. */
|
|
102
|
+
failedOver: boolean;
|
|
103
|
+
instances: PlatformDatabaseInstance[];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* - `running`: every replica available
|
|
107
|
+
* - `deploying`: a rollout is under way
|
|
108
|
+
* - `degraded`: some replicas available, not all
|
|
109
|
+
* - `down`: none available
|
|
110
|
+
* - `absent`: no Deployment of that name (e.g. an installation without the dashboard)
|
|
111
|
+
* - `unknown`: the platform could not check just now
|
|
112
|
+
*/
|
|
113
|
+
export type PlatformComponentState = 'running' | 'deploying' | 'degraded' | 'down' | 'absent' | 'unknown';
|
|
114
|
+
/** A component of the platform: a Deployment in the platform Project's namespace. */
|
|
115
|
+
export interface PlatformComponent {
|
|
116
|
+
/** The Deployment's name: `control-plane`, `madauth` or `dashboard`. */
|
|
117
|
+
name: string;
|
|
118
|
+
state: PlatformComponentState;
|
|
119
|
+
/** The replicas it asks for, and those available; 0 and 0 when absent or unknown. */
|
|
120
|
+
replicas: number;
|
|
121
|
+
availableReplicas: number;
|
|
122
|
+
instances: PlatformInstance[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The platform's own Account and Project, read-only, for the installation's
|
|
126
|
+
* admins, who are never Members of it (decision 164): its Databases and the
|
|
127
|
+
* platform's components, where each runs and how it is.
|
|
128
|
+
*/
|
|
129
|
+
export interface PlatformReport {
|
|
130
|
+
account: {
|
|
131
|
+
id: Id;
|
|
132
|
+
name: string;
|
|
133
|
+
};
|
|
134
|
+
project: {
|
|
135
|
+
id: Id;
|
|
136
|
+
name: string;
|
|
137
|
+
};
|
|
138
|
+
databases: PlatformDatabase[];
|
|
139
|
+
components: PlatformComponent[];
|
|
140
|
+
/** The compute Sites with their descriptions, to name the Sites above. */
|
|
141
|
+
sites: SiteInfo[];
|
|
142
|
+
}
|
|
75
143
|
/** The customer: pays, receives one invoice, owns Projects. */
|
|
76
144
|
export interface Account {
|
|
77
145
|
id: Id;
|
|
@@ -194,6 +262,19 @@ export interface Project {
|
|
|
194
262
|
/** DNS label, unique within the Account. */
|
|
195
263
|
name: string;
|
|
196
264
|
createdAt: Timestamp;
|
|
265
|
+
/**
|
|
266
|
+
* How many Resources of each kind the Project holds (`GET /v1/projects`
|
|
267
|
+
* only); left out for a caller who reaches the Project through a grant
|
|
268
|
+
* alone, who sees nothing else of it (decision 139).
|
|
269
|
+
*/
|
|
270
|
+
resources?: ProjectResources;
|
|
271
|
+
}
|
|
272
|
+
/** A Project's Resources counted per kind; deleted ones do not count. */
|
|
273
|
+
export interface ProjectResources {
|
|
274
|
+
databases: number;
|
|
275
|
+
services: number;
|
|
276
|
+
jobs: number;
|
|
277
|
+
buckets: number;
|
|
197
278
|
}
|
|
198
279
|
/** Postgres always runs with at least this much memory. */
|
|
199
280
|
export declare const DATABASE_MIN_MEMORY_MB = 256;
|
|
@@ -351,7 +432,8 @@ export interface BucketInput {
|
|
|
351
432
|
/**
|
|
352
433
|
* How to reach a Bucket with any S3 client: virtual-hosted style only, at
|
|
353
434
|
* `endpoint` (the Bucket's own hostname), with the Bucket's key. The key
|
|
354
|
-
* reads and writes this Bucket and no other
|
|
435
|
+
* reads and writes this Bucket and no other, and sets its CORS rules
|
|
436
|
+
* (`PutBucketCors`).
|
|
355
437
|
*/
|
|
356
438
|
export interface BucketAccess {
|
|
357
439
|
/** `https://<name>.s3.<customer domain>`. */
|
|
@@ -420,8 +502,49 @@ export interface Service {
|
|
|
420
502
|
homeSite: Site | null;
|
|
421
503
|
/** Whether the image is pulled with registry credentials. */
|
|
422
504
|
registryAuth: boolean;
|
|
505
|
+
/** The Project's Secrets its containers read, by name: each is an environment variable of that name (decision 170). */
|
|
506
|
+
secrets: string[];
|
|
507
|
+
/** Its plain settings, environment variables anyone who may read the Project can see; not for credentials. */
|
|
508
|
+
variables: Record<string, string>;
|
|
509
|
+
/**
|
|
510
|
+
* The Databases of its Project that its containers reach, in its order
|
|
511
|
+
* (decision 173): each as a Postgres role of its own, or as the
|
|
512
|
+
* Database's owner. One that names none gets no `DATABASE_URL` and
|
|
513
|
+
* holds no database password. The first one's URL is also
|
|
514
|
+
* `DATABASE_URL`.
|
|
515
|
+
*/
|
|
516
|
+
databases: NamedDatabase[];
|
|
517
|
+
/**
|
|
518
|
+
* Its pre-deploy Job (decision 173): a Job of its Project that is run,
|
|
519
|
+
* and waited for, before each of its rollouts; null when it has none.
|
|
520
|
+
*/
|
|
521
|
+
preDeployJobId: Id | null;
|
|
522
|
+
/**
|
|
523
|
+
* The pre-deploy run of its latest deploy: `pending` until it is
|
|
524
|
+
* started (it waits for the Job to be ready), `running`, then
|
|
525
|
+
* `succeeded` or `failed`. Unless it succeeded, the Service runs what
|
|
526
|
+
* it ran before. Null when its latest deploy had no pre-deploy Job.
|
|
527
|
+
*/
|
|
528
|
+
preDeploy: {
|
|
529
|
+
state: PreDeployState;
|
|
530
|
+
runId: string | null;
|
|
531
|
+
} | null;
|
|
423
532
|
createdAt: Timestamp;
|
|
424
533
|
}
|
|
534
|
+
/**
|
|
535
|
+
* Limits of what a Service's or Job's definition names for its containers'
|
|
536
|
+
* environment (decision 170). The values of the Secrets a definition names
|
|
537
|
+
* share one Kubernetes Secret, hence their total.
|
|
538
|
+
*/
|
|
539
|
+
export declare const ENVIRONMENT_LIMITS: {
|
|
540
|
+
readonly maxSecrets: 256;
|
|
541
|
+
readonly maxVariables: 256;
|
|
542
|
+
readonly maxVariableValueBytes: number;
|
|
543
|
+
readonly maxVariablesTotalBytes: number;
|
|
544
|
+
readonly maxNamedSecretsTotalBytes: number;
|
|
545
|
+
};
|
|
546
|
+
/** Names starting with this are the platform's own variables and cannot be a Secret's or a Variable's in a definition. */
|
|
547
|
+
export declare const RESERVED_ENVIRONMENT_PREFIX = "OUP_";
|
|
425
548
|
/** Creates a Service; the tag is resolved to a digest while the request waits. */
|
|
426
549
|
export interface ServiceInput {
|
|
427
550
|
name: string;
|
|
@@ -434,6 +557,14 @@ export interface ServiceInput {
|
|
|
434
557
|
cpuMillicores: number;
|
|
435
558
|
homeSite?: Site;
|
|
436
559
|
registryAuth?: RegistryAuth;
|
|
560
|
+
/** Names of Secrets of the Project; default none. An unknown name is refused. */
|
|
561
|
+
secrets?: string[];
|
|
562
|
+
/** Default none. */
|
|
563
|
+
variables?: Record<string, string>;
|
|
564
|
+
/** The Databases it reaches; default none. An unknown name is refused. */
|
|
565
|
+
databases?: NamedDatabaseInput[];
|
|
566
|
+
/** A Job of the Project to run before each rollout; default none. */
|
|
567
|
+
preDeployJobId?: Id;
|
|
437
568
|
}
|
|
438
569
|
/**
|
|
439
570
|
* Changes a Service. A new `image` or `registryAuth` resolves the tag again;
|
|
@@ -448,16 +579,58 @@ export interface ServicePatch {
|
|
|
448
579
|
cpuMillicores?: number;
|
|
449
580
|
homeSite?: Site | null;
|
|
450
581
|
registryAuth?: RegistryAuth | null;
|
|
582
|
+
/** Replaces the whole list. */
|
|
583
|
+
secrets?: string[];
|
|
584
|
+
/** Replaces the whole map. */
|
|
585
|
+
variables?: Record<string, string>;
|
|
586
|
+
/** Replaces the whole list. */
|
|
587
|
+
databases?: NamedDatabaseInput[];
|
|
588
|
+
/** Another pre-deploy Job, or null for none. */
|
|
589
|
+
preDeployJobId?: Id | null;
|
|
451
590
|
}
|
|
452
591
|
/**
|
|
453
592
|
* Read live from its Deployment: `deploying` until the first replica is
|
|
454
593
|
* up and while a new version rolls out, `running` with every replica
|
|
455
594
|
* available, `degraded` with some, `unknown` when Kubernetes cannot be asked.
|
|
595
|
+
* Before a rollout of a Service with a pre-deploy Job: `pre-deploy` while
|
|
596
|
+
* that Job's run is waited for, `pre-deploy-failed` when it failed, and
|
|
597
|
+
* the Service then keeps running what it ran before.
|
|
456
598
|
*/
|
|
457
|
-
|
|
599
|
+
/**
|
|
600
|
+
* How a Service or Job reaches a Database it names (decision 173): `own`,
|
|
601
|
+
* as a Postgres role of its own (`svc_<name>`, `job_<name>`) that can
|
|
602
|
+
* connect and nothing else until the Database's owner grants it rights in
|
|
603
|
+
* SQL; `owner`, as the role that owns the Database, for what changes the
|
|
604
|
+
* schema and gives those rights.
|
|
605
|
+
*/
|
|
606
|
+
export declare const DEFINITION_DATABASE_ACCESS: readonly ["own", "owner"];
|
|
607
|
+
export type DefinitionDatabaseAccess = (typeof DEFINITION_DATABASE_ACCESS)[number];
|
|
608
|
+
/** A Database a Service or Job names, by its name. */
|
|
609
|
+
export interface NamedDatabase {
|
|
610
|
+
name: string;
|
|
611
|
+
access: DefinitionDatabaseAccess;
|
|
612
|
+
}
|
|
613
|
+
/** A Database to name: `access` is `own` when left out. */
|
|
614
|
+
export interface NamedDatabaseInput {
|
|
615
|
+
name: string;
|
|
616
|
+
access?: DefinitionDatabaseAccess;
|
|
617
|
+
}
|
|
618
|
+
/** A Service or Job names at most this many Databases. */
|
|
619
|
+
export declare const MAX_NAMED_DATABASES = 16;
|
|
620
|
+
/** The longest name of a Service or Job that can have a role of its own: Postgres's names end at 63, and the role's has a prefix of 4. */
|
|
621
|
+
export declare const MAX_NAME_WITH_OWN_ROLE = 59;
|
|
622
|
+
export type ServiceState = 'pre-deploy' | 'pre-deploy-failed' | 'deploying' | 'running' | 'degraded' | 'unknown';
|
|
623
|
+
/** How the pre-deploy run of a Service's deploy stands. */
|
|
624
|
+
export type PreDeployState = 'pending' | 'running' | 'succeeded' | 'failed';
|
|
458
625
|
/** A Service as the API returns it. */
|
|
459
626
|
export interface ServiceDetails extends Service {
|
|
460
627
|
state: ServiceState;
|
|
628
|
+
/**
|
|
629
|
+
* Those of its `secrets` and `variables` whose value its containers do
|
|
630
|
+
* not get, because the platform sets a variable of that name for the
|
|
631
|
+
* Project's Databases (`DATABASE_URL…`, decision 97) and its value wins.
|
|
632
|
+
*/
|
|
633
|
+
overridden: string[];
|
|
461
634
|
}
|
|
462
635
|
/** Limits of a Job, checked by the API; memory and CPU as for a Service. */
|
|
463
636
|
export declare const JOB_LIMITS: {
|
|
@@ -508,6 +681,12 @@ export interface Job {
|
|
|
508
681
|
homeSite: Site | null;
|
|
509
682
|
/** Whether the image is pulled with registry credentials. */
|
|
510
683
|
registryAuth: boolean;
|
|
684
|
+
/** The Project's Secrets its runs read, by name, as a Service's. */
|
|
685
|
+
secrets: string[];
|
|
686
|
+
/** Its plain settings, as a Service's. A run's own `env` wins over both. */
|
|
687
|
+
variables: Record<string, string>;
|
|
688
|
+
/** The Databases its runs reach, as a Service's. */
|
|
689
|
+
databases: NamedDatabase[];
|
|
511
690
|
createdAt: Timestamp;
|
|
512
691
|
}
|
|
513
692
|
/** Creates a Job; the tag is resolved to a digest while the request waits. */
|
|
@@ -524,6 +703,12 @@ export interface JobInput {
|
|
|
524
703
|
timeZone?: string;
|
|
525
704
|
homeSite?: Site;
|
|
526
705
|
registryAuth?: RegistryAuth;
|
|
706
|
+
/** Names of Secrets of the Project; default none. */
|
|
707
|
+
secrets?: string[];
|
|
708
|
+
/** Default none. */
|
|
709
|
+
variables?: Record<string, string>;
|
|
710
|
+
/** The Databases its runs reach; default none. */
|
|
711
|
+
databases?: NamedDatabaseInput[];
|
|
527
712
|
}
|
|
528
713
|
/**
|
|
529
714
|
* Changes a Job. A new `image` or `registryAuth` resolves the tag again;
|
|
@@ -541,6 +726,12 @@ export interface JobPatch {
|
|
|
541
726
|
timeZone?: string | null;
|
|
542
727
|
homeSite?: Site | null;
|
|
543
728
|
registryAuth?: RegistryAuth | null;
|
|
729
|
+
/** Replaces the whole list. */
|
|
730
|
+
secrets?: string[];
|
|
731
|
+
/** Replaces the whole map. */
|
|
732
|
+
variables?: Record<string, string>;
|
|
733
|
+
/** Replaces the whole list. */
|
|
734
|
+
databases?: NamedDatabaseInput[];
|
|
544
735
|
}
|
|
545
736
|
/**
|
|
546
737
|
* Read live from its CronJob: `deploying` until the Jobs operator has
|
|
@@ -551,6 +742,8 @@ export type JobState = 'deploying' | 'ready' | 'unknown';
|
|
|
551
742
|
/** A Job as the API returns it. */
|
|
552
743
|
export interface JobDetails extends Job {
|
|
553
744
|
state: JobState;
|
|
745
|
+
/** Those of its `secrets` and `variables` that the platform's own variables override, as a Service's. */
|
|
746
|
+
overridden: string[];
|
|
554
747
|
}
|
|
555
748
|
/**
|
|
556
749
|
* Read live from its Kubernetes Job: `pending` until its container runs
|
|
@@ -632,12 +825,12 @@ export interface LogQuery {
|
|
|
632
825
|
/** A Secret's name is an environment variable name (the schema checks the same). */
|
|
633
826
|
export declare const SECRET_NAME: RegExp;
|
|
634
827
|
/**
|
|
635
|
-
* At most this many bytes (UTF-8) per value
|
|
636
|
-
* together
|
|
637
|
-
* Secret (1 MiB at most) and into every container's environment.
|
|
828
|
+
* At most this many bytes (UTF-8) per value. The values one Service or Job
|
|
829
|
+
* names together are limited by ENVIRONMENT_LIMITS.maxNamedSecretsTotalBytes.
|
|
638
830
|
*/
|
|
639
831
|
export declare const SECRET_VALUE_MAX_BYTES: number;
|
|
640
|
-
|
|
832
|
+
/** At most this many Secrets per Project: what bounds a Project's Secrets, since no limit is on their size together. */
|
|
833
|
+
export declare const SECRETS_MAX_PER_PROJECT = 1000;
|
|
641
834
|
/**
|
|
642
835
|
* A Secret's value is write-only: the API accepts it and hands it to the
|
|
643
836
|
* Project's Services and jobs as an environment variable, but never returns it.
|
|
@@ -649,11 +842,109 @@ export interface Secret {
|
|
|
649
842
|
name: string;
|
|
650
843
|
createdAt: Timestamp;
|
|
651
844
|
updatedAt: Timestamp;
|
|
845
|
+
/** The Services and Jobs that name it: only their containers get it, and a change restarts those Services. Empty: unused. */
|
|
846
|
+
usedBy: {
|
|
847
|
+
kind: 'service' | 'job';
|
|
848
|
+
id: Id;
|
|
849
|
+
name: string;
|
|
850
|
+
}[];
|
|
652
851
|
}
|
|
653
852
|
export interface SecretInput {
|
|
654
853
|
name: string;
|
|
655
854
|
value: string;
|
|
656
855
|
}
|
|
856
|
+
/** Limits of Keys (ARCHITECTURE.md, decision 167). */
|
|
857
|
+
export declare const KEY_LIMITS: {
|
|
858
|
+
/** Keys per Project, those pending deletion included. */
|
|
859
|
+
readonly maxPerProject: 20;
|
|
860
|
+
/** How long a deleted Key refuses every call and can still be restored, before it is erased. */
|
|
861
|
+
readonly deletionDays: 7;
|
|
862
|
+
/** Versions of one Key: every one is kept for the Key's life, so `rotate` is refused above this. */
|
|
863
|
+
readonly maxVersions: 1000;
|
|
864
|
+
};
|
|
865
|
+
/** Limits of one call of the key API (decision 167). */
|
|
866
|
+
export declare const KEY_CALL_LIMITS: {
|
|
867
|
+
/** A plaintext, decoded: larger data is encrypted with a key of the customer's own, which is encrypted with the Key. */
|
|
868
|
+
readonly maxPlaintextBytes: 4096;
|
|
869
|
+
readonly maxContextEntries: 16;
|
|
870
|
+
/** A context's names and values together, as UTF-8. */
|
|
871
|
+
readonly maxContextBytes: 1024;
|
|
872
|
+
/** A request's body. */
|
|
873
|
+
readonly maxBodyBytes: number;
|
|
874
|
+
/** How long a call's record is kept (decision 169). */
|
|
875
|
+
readonly retentionDays: 30;
|
|
876
|
+
/** Records one listing returns at most, and by default. */
|
|
877
|
+
readonly maxListed: 1000;
|
|
878
|
+
readonly defaultListed: 100;
|
|
879
|
+
};
|
|
880
|
+
/**
|
|
881
|
+
* One call of the key API as its record has it (decision 169): who used the
|
|
882
|
+
* Key, for what and how it ended. Never a plaintext or a ciphertext.
|
|
883
|
+
*/
|
|
884
|
+
export interface KeyCall {
|
|
885
|
+
/** Grows with time; the `before` of the next page. */
|
|
886
|
+
id: string;
|
|
887
|
+
at: Timestamp;
|
|
888
|
+
holder: 'service' | 'job';
|
|
889
|
+
holderId: Id;
|
|
890
|
+
/** The Service's or Job's name when it called; null if it could not be read. */
|
|
891
|
+
holderName: string | null;
|
|
892
|
+
operation: 'encrypt' | 'decrypt';
|
|
893
|
+
/**
|
|
894
|
+
* `ok`; `forbidden` (no grant for the operation); `pending-deletion`;
|
|
895
|
+
* `invalid` (a body that is no such request); `cannot-decrypt` (another
|
|
896
|
+
* context, another Key or a changed ciphertext); `rate-limited` (calls
|
|
897
|
+
* above the limit, one record per minute with their number in `calls`).
|
|
898
|
+
*/
|
|
899
|
+
outcome: 'ok' | 'forbidden' | 'pending-deletion' | 'invalid' | 'cannot-decrypt' | 'rate-limited';
|
|
900
|
+
/** The Key's version that encrypted or was asked to decrypt; null when the call did not get that far. */
|
|
901
|
+
version: number | null;
|
|
902
|
+
/** 1, or for `rate-limited` how many calls the record stands for. */
|
|
903
|
+
calls: number;
|
|
904
|
+
/** The context as sent, which is not secret and is stored; null when none could be read. */
|
|
905
|
+
context: Record<string, string> | null;
|
|
906
|
+
}
|
|
907
|
+
/** What a grant on a Key allows. Not ordered: `encrypt` does not include `decrypt`, nor the reverse. */
|
|
908
|
+
export declare const KEY_ACCESS: readonly ["encrypt", "decrypt", "both"];
|
|
909
|
+
export type KeyAccess = (typeof KEY_ACCESS)[number];
|
|
910
|
+
/** A Service's or a Job's grant on a Key (decision 168): its pods may call the key API for that Key. */
|
|
911
|
+
export interface KeyGrant {
|
|
912
|
+
holder: 'service' | 'job';
|
|
913
|
+
/** The Service's or Job's id. */
|
|
914
|
+
id: Id;
|
|
915
|
+
name: string;
|
|
916
|
+
access: KeyAccess;
|
|
917
|
+
createdAt: Timestamp;
|
|
918
|
+
}
|
|
919
|
+
export interface KeyGrantInput {
|
|
920
|
+
access: KeyAccess;
|
|
921
|
+
}
|
|
922
|
+
/** `active`, or `pending-deletion` from its delete until it is erased or restored. */
|
|
923
|
+
export type KeyState = 'active' | 'pending-deletion';
|
|
924
|
+
/**
|
|
925
|
+
* An encryption key of a Project that never leaves the platform
|
|
926
|
+
* (ARCHITECTURE.md, "Keys"): the API creates, rotates and deletes it and
|
|
927
|
+
* never returns its material.
|
|
928
|
+
*/
|
|
929
|
+
export interface Key {
|
|
930
|
+
id: Id;
|
|
931
|
+
projectId: Id;
|
|
932
|
+
/** DNS label, unique within the Project, also while the Key is pending deletion. */
|
|
933
|
+
name: string;
|
|
934
|
+
/** The newest version, which encrypting uses; `rotate` adds one, and older ones keep decrypting. */
|
|
935
|
+
version: number;
|
|
936
|
+
state: KeyState;
|
|
937
|
+
/** When a Key pending deletion is erased, and what it encrypted becomes unreadable; null while it is active. */
|
|
938
|
+
deletesAt: Timestamp | null;
|
|
939
|
+
createdAt: Timestamp;
|
|
940
|
+
/** When the newest version was added: at creation, then at each rotation. */
|
|
941
|
+
rotatedAt: Timestamp;
|
|
942
|
+
/** The Services and Jobs of the Project that may use it, by name. */
|
|
943
|
+
grants: KeyGrant[];
|
|
944
|
+
}
|
|
945
|
+
export interface KeyInput {
|
|
946
|
+
name: string;
|
|
947
|
+
}
|
|
657
948
|
/**
|
|
658
949
|
* Where `oup login` signs in (`GET /v1/login`, no token needed): madAuth's
|
|
659
950
|
* issuer and the CLI's client ID there, for the device authorization grant.
|
package/dist/model.js
CHANGED
|
@@ -74,6 +74,40 @@ export const SERVICE_LIMITS = {
|
|
|
74
74
|
minCpuMillicores: 50,
|
|
75
75
|
maxCpuMillicores: 8000,
|
|
76
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* Limits of what a Service's or Job's definition names for its containers'
|
|
79
|
+
* environment (decision 170). The values of the Secrets a definition names
|
|
80
|
+
* share one Kubernetes Secret, hence their total.
|
|
81
|
+
*/
|
|
82
|
+
export const ENVIRONMENT_LIMITS = {
|
|
83
|
+
maxSecrets: 256,
|
|
84
|
+
maxVariables: 256,
|
|
85
|
+
maxVariableValueBytes: 32 * 1024,
|
|
86
|
+
maxVariablesTotalBytes: 256 * 1024,
|
|
87
|
+
maxNamedSecretsTotalBytes: 512 * 1024,
|
|
88
|
+
};
|
|
89
|
+
/** Names starting with this are the platform's own variables and cannot be a Secret's or a Variable's in a definition. */
|
|
90
|
+
export const RESERVED_ENVIRONMENT_PREFIX = 'OUP_';
|
|
91
|
+
/**
|
|
92
|
+
* Read live from its Deployment: `deploying` until the first replica is
|
|
93
|
+
* up and while a new version rolls out, `running` with every replica
|
|
94
|
+
* available, `degraded` with some, `unknown` when Kubernetes cannot be asked.
|
|
95
|
+
* Before a rollout of a Service with a pre-deploy Job: `pre-deploy` while
|
|
96
|
+
* that Job's run is waited for, `pre-deploy-failed` when it failed, and
|
|
97
|
+
* the Service then keeps running what it ran before.
|
|
98
|
+
*/
|
|
99
|
+
/**
|
|
100
|
+
* How a Service or Job reaches a Database it names (decision 173): `own`,
|
|
101
|
+
* as a Postgres role of its own (`svc_<name>`, `job_<name>`) that can
|
|
102
|
+
* connect and nothing else until the Database's owner grants it rights in
|
|
103
|
+
* SQL; `owner`, as the role that owns the Database, for what changes the
|
|
104
|
+
* schema and gives those rights.
|
|
105
|
+
*/
|
|
106
|
+
export const DEFINITION_DATABASE_ACCESS = ['own', 'owner'];
|
|
107
|
+
/** A Service or Job names at most this many Databases. */
|
|
108
|
+
export const MAX_NAMED_DATABASES = 16;
|
|
109
|
+
/** The longest name of a Service or Job that can have a role of its own: Postgres's names end at 63, and the role's has a prefix of 4. */
|
|
110
|
+
export const MAX_NAME_WITH_OWN_ROLE = 59;
|
|
77
111
|
/** Limits of a Job, checked by the API; memory and CPU as for a Service. */
|
|
78
112
|
export const JOB_LIMITS = {
|
|
79
113
|
minMemoryMb: SERVICE_LIMITS.minMemoryMb,
|
|
@@ -101,12 +135,38 @@ export const LOG_LIMITS = {
|
|
|
101
135
|
/** A Secret's name is an environment variable name (the schema checks the same). */
|
|
102
136
|
export const SECRET_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,254}$/;
|
|
103
137
|
/**
|
|
104
|
-
* At most this many bytes (UTF-8) per value
|
|
105
|
-
* together
|
|
106
|
-
* Secret (1 MiB at most) and into every container's environment.
|
|
138
|
+
* At most this many bytes (UTF-8) per value. The values one Service or Job
|
|
139
|
+
* names together are limited by ENVIRONMENT_LIMITS.maxNamedSecretsTotalBytes.
|
|
107
140
|
*/
|
|
108
141
|
export const SECRET_VALUE_MAX_BYTES = 64 * 1024;
|
|
109
|
-
|
|
142
|
+
/** At most this many Secrets per Project: what bounds a Project's Secrets, since no limit is on their size together. */
|
|
143
|
+
export const SECRETS_MAX_PER_PROJECT = 1000;
|
|
144
|
+
/** Limits of Keys (ARCHITECTURE.md, decision 167). */
|
|
145
|
+
export const KEY_LIMITS = {
|
|
146
|
+
/** Keys per Project, those pending deletion included. */
|
|
147
|
+
maxPerProject: 20,
|
|
148
|
+
/** How long a deleted Key refuses every call and can still be restored, before it is erased. */
|
|
149
|
+
deletionDays: 7,
|
|
150
|
+
/** Versions of one Key: every one is kept for the Key's life, so `rotate` is refused above this. */
|
|
151
|
+
maxVersions: 1000,
|
|
152
|
+
};
|
|
153
|
+
/** Limits of one call of the key API (decision 167). */
|
|
154
|
+
export const KEY_CALL_LIMITS = {
|
|
155
|
+
/** A plaintext, decoded: larger data is encrypted with a key of the customer's own, which is encrypted with the Key. */
|
|
156
|
+
maxPlaintextBytes: 4096,
|
|
157
|
+
maxContextEntries: 16,
|
|
158
|
+
/** A context's names and values together, as UTF-8. */
|
|
159
|
+
maxContextBytes: 1024,
|
|
160
|
+
/** A request's body. */
|
|
161
|
+
maxBodyBytes: 16 * 1024,
|
|
162
|
+
/** How long a call's record is kept (decision 169). */
|
|
163
|
+
retentionDays: 30,
|
|
164
|
+
/** Records one listing returns at most, and by default. */
|
|
165
|
+
maxListed: 1000,
|
|
166
|
+
defaultListed: 100,
|
|
167
|
+
};
|
|
168
|
+
/** What a grant on a Key allows. Not ordered: `encrypt` does not include `decrypt`, nor the reverse. */
|
|
169
|
+
export const KEY_ACCESS = ['encrypt', 'decrypt', 'both'];
|
|
110
170
|
/** Where the TXT ownership proof for `hostname` has to be published. */
|
|
111
171
|
export function txtRecordName(hostname) {
|
|
112
172
|
return `_openupstream.${hostname}`;
|
package/dist/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,MAAM,CAAC,MAAM,OAAO,GAAG,iDAAiD,CAAC;AAWzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,mBAAmB;IACnB,iCAAiC;IACjC,yBAAyB;IACzB,oBAAoB;IACpB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,0BAA0B;IAC1B,yBAAyB;IACzB,mBAAmB;CACb,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,MAAM,CAAC,MAAM,OAAO,GAAG,iDAAiD,CAAC;AAWzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,mBAAmB;IACnB,iCAAiC;IACjC,yBAAyB;IACzB,oBAAoB;IACpB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,0BAA0B;IAC1B,yBAAyB;IACzB,mBAAmB;CAC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D;AACxD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,wHAAwH;IACxH,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,EAAE;IACrB,uDAAuD;IACvD,eAAe,EAAE,IAAI;IACrB,wBAAwB;IACxB,YAAY,EAAE,EAAE,GAAG,IAAI;IACvB,uDAAuD;IACvD,aAAa,EAAE,EAAE;IACjB,2DAA2D;IAC3D,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,GAAG;CACZ,CAAC;AA8BX,wGAAwG;AACxG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAyFlE,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC1C,OAAO,iBAAiB,QAAQ,EAAE,CAAC;AACvC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,uFAAuF,CAAC;AAahH,2GAA2G;AAC3G,MAAM,CAAC,MAAM,WAAW,GAAG,8BAA8B,CAAC;AAsC1D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAU,CAAC;AAmEhF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,CAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openupstream/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "TypeScript client for the openupstream API",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./keys": {
|
|
22
|
+
"types": "./dist/keys.d.ts",
|
|
23
|
+
"import": "./dist/keys.js"
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
"files": [
|