@coffre/core 0.14.4 → 0.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{access-CembYDiI.js → access-BrdZKp1d.js} +6 -1
- package/dist/{access-CU3xEOLH.d.ts → access-qkMZa-6Z.d.ts} +6 -1
- package/dist/access.d.ts +2 -2
- package/dist/access.js +2 -2
- package/dist/schemas.js +1 -1
- package/dist/vault.d.ts +31 -5
- package/dist/vault.js +7 -1
- package/package.json +3 -3
- package/src/access.ts +6 -0
- package/src/vault.ts +24 -1
|
@@ -617,6 +617,11 @@ const DELEGABLE_ROLES = delegableRoles();
|
|
|
617
617
|
*/
|
|
618
618
|
const MAX_PERSONAL_TOKEN_MINUTES = 10080;
|
|
619
619
|
/**
|
|
620
|
+
* How long a `coffre login` code waits to be approved. The server expires it
|
|
621
|
+
* then, and the CLI's sign-in hint says so before it has asked for one.
|
|
622
|
+
*/
|
|
623
|
+
const DEVICE_TTL_SECONDS = 600;
|
|
624
|
+
/**
|
|
620
625
|
* A credential's scope, by path as the API names it, in words, each role
|
|
621
626
|
* with its places: `developer on market/dev, api/dev; viewer on market/prod`.
|
|
622
627
|
*/
|
|
@@ -905,4 +910,4 @@ function makesProjects(holder) {
|
|
|
905
910
|
return holder.credentialScope == null && administers(holder.role) && environments === "all" && (projects === "all" || "except" in projects);
|
|
906
911
|
}
|
|
907
912
|
//#endregion
|
|
908
|
-
export {
|
|
913
|
+
export { roleGrants as $, guarded as A, issuedGrant as B, credentialScopeInWords as C, delegableRoles as D, delegable as E, isBuiltinRole as F, normalDefinition as G, makesProjects as H, isCredentialScope as I, ownsProject as J, normalScope as K, isInstanceRole as L, holds as M, inScope as N, givesService as O, instanceRoleGrants as P, readsWholeLog as Q, isRole as R, covers as S, definitionProblem as T, managesService as U, issuesCredential as V, mayManageAccess as W, protects as X, protectedWithin as Y, readsSensitive as Z, UNWRITTEN_FORK_MS as _, EVERY_ENVIRONMENT as a, unscoped as at, allows as b, INSTANCE_ROLE_NAMES as c, convertEveryProjectGrants as ct, NOTHING as d, runsInstance as et, PERMISSIONS as f, ROLE_NAMES as g, ROLE_ID as h, EVERYWHERE as i, setsUpServices as it, heldColumns as j, grantKind as k, MAX_PERSONAL_TOKEN_MINUTES as l, ROLES as m, DELEGABLE_ROLES as n, scopeInWords as nt, FIXED_ROLES as o, useOnly as ot, PROJECT_ONLY_PERMISSIONS as p, ownsInstance as q, DEVICE_TTL_SECONDS as r, scopeWithReads as rt, INSTANCE_ROLES as s, withinCredential as st, DEFAULT_POLICY as t, scopeDefinition as tt, MAX_SCOPE_PLACES as u, administers as v, definitionOf as w, assignableToEnvironment as x, admits as y, isScope as z };
|
|
@@ -503,6 +503,11 @@ declare const DELEGABLE_ROLES: readonly Role[];
|
|
|
503
503
|
* rather than keep one around.
|
|
504
504
|
*/
|
|
505
505
|
declare const MAX_PERSONAL_TOKEN_MINUTES: number;
|
|
506
|
+
/**
|
|
507
|
+
* How long a `coffre login` code waits to be approved. The server expires it
|
|
508
|
+
* then, and the CLI's sign-in hint says so before it has asked for one.
|
|
509
|
+
*/
|
|
510
|
+
declare const DEVICE_TTL_SECONDS: number;
|
|
506
511
|
/**
|
|
507
512
|
* A credential's scope, by path as the API names it, in words, each role
|
|
508
513
|
* with its places: `developer on market/dev, api/dev; viewer on market/prod`.
|
|
@@ -731,4 +736,4 @@ declare function readsWholeLog(holder: Holdings): boolean;
|
|
|
731
736
|
*/
|
|
732
737
|
declare function makesProjects(holder: Holdings): boolean;
|
|
733
738
|
//#endregion
|
|
734
|
-
export {
|
|
739
|
+
export { isBuiltinRole as $, RoleDefinition as A, Narrowed as At, covers as B, Permission as C, unscoped as Ct, ROLE_ID as D, ConversionInput as Dt, ROLES as E, Conversion as Et, UNWRITTEN_FORK_MS as F, delegableRoles as G, definitionOf as H, administers as I, guarded as J, givesService as K, admits as L, ScopeGrant as M, ServiceAccount as N, ROLE_NAMES as O, ConvertedGrant as Ot, ServiceSetting as P, instanceRoleGrants as Q, allows as R, PROJECT_ONLY_PERMISSIONS as S, setsUpServices as St, Policy as T, withinCredential as Tt, definitionProblem as U, credentialScopeInWords as V, delegable as W, holds as X, heldColumns as Y, inScope as Z, InstanceRole as _, roleGrants as _t, DEFAULT_POLICY as a, issuesCredential as at, NOTHING as b, scopeInWords as bt, EVERYWHERE as c, mayManageAccess as ct, Filter as d, ownsInstance as dt, isCredentialScope as et, GrantPlace as f, ownsProject as ft, INSTANCE_ROLE_NAMES as g, readsWholeLog as gt, INSTANCE_ROLES as h, readsSensitive as ht, CredentialScope as i, issuedGrant as it, Scope as j, convertEveryProjectGrants as jt, Role as k, EveryProjectGrant as kt, EVERY_ENVIRONMENT as l, normalDefinition as lt, Holdings as m, protects as mt, CallerKind as n, isRole as nt, DELEGABLE_ROLES as o, makesProjects as ot, HeldKey as p, protectedWithin as pt, grantKind as q, Columns as r, isScope as rt, DEVICE_TTL_SECONDS as s, managesService as st, BuiltinRole as t, isInstanceRole as tt, FIXED_ROLES as u, normalScope as ut, MAX_PERSONAL_TOKEN_MINUTES as v, runsInstance as vt, Place as w, useOnly as wt, PERMISSIONS as x, scopeWithReads as xt, MAX_SCOPE_PLACES as y, scopeDefinition as yt, assignableToEnvironment as z };
|
package/dist/access.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { BuiltinRole, CallerKind, Columns, type Conversion, type ConversionInput, type ConvertedGrant, CredentialScope, DEFAULT_POLICY, DELEGABLE_ROLES, EVERYWHERE, EVERY_ENVIRONMENT, type EveryProjectGrant, FIXED_ROLES, Filter, GrantPlace, HeldKey, Holdings, INSTANCE_ROLES, INSTANCE_ROLE_NAMES, InstanceRole, MAX_PERSONAL_TOKEN_MINUTES, MAX_SCOPE_PLACES, NOTHING, type Narrowed, PERMISSIONS, PROJECT_ONLY_PERMISSIONS, Permission, Place, Policy, ROLES, ROLE_ID, ROLE_NAMES, Role, RoleDefinition, Scope, ScopeGrant, ServiceAccount, ServiceSetting, UNWRITTEN_FORK_MS, administers, admits, allows, assignableToEnvironment, convertEveryProjectGrants, covers, credentialScopeInWords, definitionOf, definitionProblem, delegable, delegableRoles, givesService, grantKind, guarded, heldColumns, holds, inScope, instanceRoleGrants, isBuiltinRole, isCredentialScope, isInstanceRole, isRole, isScope, issuedGrant, issuesCredential, makesProjects, managesService, mayManageAccess, normalDefinition, normalScope, ownsInstance, ownsProject, protectedWithin, protects, readsSensitive, readsWholeLog, roleGrants, runsInstance, scopeDefinition, scopeInWords, scopeWithReads, setsUpServices, unscoped, useOnly, withinCredential };
|
|
1
|
+
import { $ as isBuiltinRole, A as RoleDefinition, At as Narrowed, B as covers, C as Permission, Ct as unscoped, D as ROLE_ID, Dt as ConversionInput, E as ROLES, Et as Conversion, F as UNWRITTEN_FORK_MS, G as delegableRoles, H as definitionOf, I as administers, J as guarded, K as givesService, L as admits, M as ScopeGrant, N as ServiceAccount, O as ROLE_NAMES, Ot as ConvertedGrant, P as ServiceSetting, Q as instanceRoleGrants, R as allows, S as PROJECT_ONLY_PERMISSIONS, St as setsUpServices, T as Policy, Tt as withinCredential, U as definitionProblem, V as credentialScopeInWords, W as delegable, X as holds, Y as heldColumns, Z as inScope, _ as InstanceRole, _t as roleGrants, a as DEFAULT_POLICY, at as issuesCredential, b as NOTHING, bt as scopeInWords, c as EVERYWHERE, ct as mayManageAccess, d as Filter, dt as ownsInstance, et as isCredentialScope, f as GrantPlace, ft as ownsProject, g as INSTANCE_ROLE_NAMES, gt as readsWholeLog, h as INSTANCE_ROLES, ht as readsSensitive, i as CredentialScope, it as issuedGrant, j as Scope, jt as convertEveryProjectGrants, k as Role, kt as EveryProjectGrant, l as EVERY_ENVIRONMENT, lt as normalDefinition, m as Holdings, mt as protects, n as CallerKind, nt as isRole, o as DELEGABLE_ROLES, ot as makesProjects, p as HeldKey, pt as protectedWithin, q as grantKind, r as Columns, rt as isScope, s as DEVICE_TTL_SECONDS, st as managesService, t as BuiltinRole, tt as isInstanceRole, u as FIXED_ROLES, ut as normalScope, v as MAX_PERSONAL_TOKEN_MINUTES, vt as runsInstance, w as Place, wt as useOnly, x as PERMISSIONS, xt as scopeWithReads, y as MAX_SCOPE_PLACES, yt as scopeDefinition, z as assignableToEnvironment } from "./access-qkMZa-6Z.js";
|
|
2
|
+
export { BuiltinRole, CallerKind, Columns, type Conversion, type ConversionInput, type ConvertedGrant, CredentialScope, DEFAULT_POLICY, DELEGABLE_ROLES, DEVICE_TTL_SECONDS, EVERYWHERE, EVERY_ENVIRONMENT, type EveryProjectGrant, FIXED_ROLES, Filter, GrantPlace, HeldKey, Holdings, INSTANCE_ROLES, INSTANCE_ROLE_NAMES, InstanceRole, MAX_PERSONAL_TOKEN_MINUTES, MAX_SCOPE_PLACES, NOTHING, type Narrowed, PERMISSIONS, PROJECT_ONLY_PERMISSIONS, Permission, Place, Policy, ROLES, ROLE_ID, ROLE_NAMES, Role, RoleDefinition, Scope, ScopeGrant, ServiceAccount, ServiceSetting, UNWRITTEN_FORK_MS, administers, admits, allows, assignableToEnvironment, convertEveryProjectGrants, covers, credentialScopeInWords, definitionOf, definitionProblem, delegable, delegableRoles, givesService, grantKind, guarded, heldColumns, holds, inScope, instanceRoleGrants, isBuiltinRole, isCredentialScope, isInstanceRole, isRole, isScope, issuedGrant, issuesCredential, makesProjects, managesService, mayManageAccess, normalDefinition, normalScope, ownsInstance, ownsProject, protectedWithin, protects, readsSensitive, readsWholeLog, roleGrants, runsInstance, scopeDefinition, scopeInWords, scopeWithReads, setsUpServices, unscoped, useOnly, withinCredential };
|
package/dist/access.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { DEFAULT_POLICY, DELEGABLE_ROLES, EVERYWHERE, EVERY_ENVIRONMENT, FIXED_ROLES, INSTANCE_ROLES, INSTANCE_ROLE_NAMES, MAX_PERSONAL_TOKEN_MINUTES, MAX_SCOPE_PLACES, NOTHING, PERMISSIONS, PROJECT_ONLY_PERMISSIONS, ROLES, ROLE_ID, ROLE_NAMES, UNWRITTEN_FORK_MS, administers, admits, allows, assignableToEnvironment, convertEveryProjectGrants, covers, credentialScopeInWords, definitionOf, definitionProblem, delegable, delegableRoles, givesService, grantKind, guarded, heldColumns, holds, inScope, instanceRoleGrants, isBuiltinRole, isCredentialScope, isInstanceRole, isRole, isScope, issuedGrant, issuesCredential, makesProjects, managesService, mayManageAccess, normalDefinition, normalScope, ownsInstance, ownsProject, protectedWithin, protects, readsSensitive, readsWholeLog, roleGrants, runsInstance, scopeDefinition, scopeInWords, scopeWithReads, setsUpServices, unscoped, useOnly, withinCredential };
|
|
1
|
+
import { $ as roleGrants, A as guarded, B as issuedGrant, C as credentialScopeInWords, D as delegableRoles, E as delegable, F as isBuiltinRole, G as normalDefinition, H as makesProjects, I as isCredentialScope, J as ownsProject, K as normalScope, L as isInstanceRole, M as holds, N as inScope, O as givesService, P as instanceRoleGrants, Q as readsWholeLog, R as isRole, S as covers, T as definitionProblem, U as managesService, V as issuesCredential, W as mayManageAccess, X as protects, Y as protectedWithin, Z as readsSensitive, _ as UNWRITTEN_FORK_MS, a as EVERY_ENVIRONMENT, at as unscoped, b as allows, c as INSTANCE_ROLE_NAMES, ct as convertEveryProjectGrants, d as NOTHING, et as runsInstance, f as PERMISSIONS, g as ROLE_NAMES, h as ROLE_ID, i as EVERYWHERE, it as setsUpServices, j as heldColumns, k as grantKind, l as MAX_PERSONAL_TOKEN_MINUTES, m as ROLES, n as DELEGABLE_ROLES, nt as scopeInWords, o as FIXED_ROLES, ot as useOnly, p as PROJECT_ONLY_PERMISSIONS, q as ownsInstance, r as DEVICE_TTL_SECONDS, rt as scopeWithReads, s as INSTANCE_ROLES, st as withinCredential, t as DEFAULT_POLICY, tt as scopeDefinition, u as MAX_SCOPE_PLACES, v as administers, w as definitionOf, x as assignableToEnvironment, y as admits, z as isScope } from "./access-BrdZKp1d.js";
|
|
2
|
+
export { DEFAULT_POLICY, DELEGABLE_ROLES, DEVICE_TTL_SECONDS, EVERYWHERE, EVERY_ENVIRONMENT, FIXED_ROLES, INSTANCE_ROLES, INSTANCE_ROLE_NAMES, MAX_PERSONAL_TOKEN_MINUTES, MAX_SCOPE_PLACES, NOTHING, PERMISSIONS, PROJECT_ONLY_PERMISSIONS, ROLES, ROLE_ID, ROLE_NAMES, UNWRITTEN_FORK_MS, administers, admits, allows, assignableToEnvironment, convertEveryProjectGrants, covers, credentialScopeInWords, definitionOf, definitionProblem, delegable, delegableRoles, givesService, grantKind, guarded, heldColumns, holds, inScope, instanceRoleGrants, isBuiltinRole, isCredentialScope, isInstanceRole, isRole, isScope, issuedGrant, issuesCredential, makesProjects, managesService, mayManageAccess, normalDefinition, normalScope, ownsInstance, ownsProject, protectedWithin, protects, readsSensitive, readsWholeLog, roleGrants, runsInstance, scopeDefinition, scopeInWords, scopeWithReads, setsUpServices, unscoped, useOnly, withinCredential };
|
package/dist/schemas.js
CHANGED
package/dist/vault.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as RoleDefinition, P as ServiceSetting, T as Policy, _ as InstanceRole, f as GrantPlace, i as CredentialScope, j as Scope, k as Role, n as CallerKind } from "./access-qkMZa-6Z.js";
|
|
2
2
|
//#region src/access-fault.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Why the vault's members and grants do not follow from its log, as facts
|
|
@@ -101,10 +101,7 @@ export interface Vault {
|
|
|
101
101
|
* refuses `access_changed` and logs no read, and says, by naming it back,
|
|
102
102
|
* that it checked. A vault older than 0.14.1 names none: it checked none.
|
|
103
103
|
*/
|
|
104
|
-
unwrap(input: UnwrapInput): Promise<Outcome<
|
|
105
|
-
keys: string[];
|
|
106
|
-
accessRevision?: string;
|
|
107
|
-
}>>;
|
|
104
|
+
unwrap(input: UnwrapInput): Promise<Outcome<Unwrapped>>;
|
|
108
105
|
/**
|
|
109
106
|
* Wrap fresh data keys for new versions `principal` writes: all, or none.
|
|
110
107
|
* `seqs` are the `key.wrap` entries, one per key, which the app's
|
|
@@ -512,6 +509,35 @@ export type UnwrapInput = Correlation & Through & {
|
|
|
512
509
|
via?: Via;
|
|
513
510
|
through?: string;
|
|
514
511
|
}[];
|
|
512
|
+
/**
|
|
513
|
+
* The credential proxy's record of what the values go into, the app's
|
|
514
|
+
* `credential.use` entry: the vault appends it beside its reads, once it
|
|
515
|
+
* releases them, under the log's head it already holds, so that the app
|
|
516
|
+
* takes the head no more for it. Where it was, from where, and its
|
|
517
|
+
* metadata, JSON, as the app wrote them; its actor is `principal`. Named
|
|
518
|
+
* back (`used`) once appended: a vault older than 0.14.5 names nothing,
|
|
519
|
+
* and the app appends it itself.
|
|
520
|
+
*/
|
|
521
|
+
use?: UseRecord;
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* The longest `UseRecord.metadata` the vault appends, in characters: room for
|
|
525
|
+
* a use naming a few hundred keys. The app appends a longer one itself, under
|
|
526
|
+
* the head, as before 0.14.5.
|
|
527
|
+
*/
|
|
528
|
+
export declare const USE_METADATA_LENGTH = 16384;
|
|
529
|
+
/** The app's `credential.use` entry, for the vault to append (`UnwrapInput.use`). */
|
|
530
|
+
export type UseRecord = {
|
|
531
|
+
projectId: string | null;
|
|
532
|
+
environmentId: string | null;
|
|
533
|
+
sourceIp: string | null;
|
|
534
|
+
metadata: string;
|
|
535
|
+
};
|
|
536
|
+
/** An unwrap's answer: each item's key, the answer it was decided on, and whether it appended the use it was given. */
|
|
537
|
+
export type Unwrapped = {
|
|
538
|
+
keys: string[];
|
|
539
|
+
accessRevision?: string;
|
|
540
|
+
used?: true;
|
|
515
541
|
};
|
|
516
542
|
/** A reference, as a read names it: its id, and the seq of the vault's `reference.create` entry. */
|
|
517
543
|
export type Via = {
|
package/dist/vault.js
CHANGED
|
@@ -67,6 +67,12 @@ function handsBack(read) {
|
|
|
67
67
|
return !(read.purpose === "copy" && read.keepsSensitive === true);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
+
* The longest `UseRecord.metadata` the vault appends, in characters: room for
|
|
71
|
+
* a use naming a few hundred keys. The app appends a longer one itself, under
|
|
72
|
+
* the head, as before 0.14.5.
|
|
73
|
+
*/
|
|
74
|
+
const USE_METADATA_LENGTH = 16384;
|
|
75
|
+
/**
|
|
70
76
|
* An answer of `access` in a word: equal for two answers that say the same,
|
|
71
77
|
* whatever order the rows came back in, and different for any change to
|
|
72
78
|
* what they say, a grant lapsed, the policy's or the member's.
|
|
@@ -103,4 +109,4 @@ function policyRevision(seq, policy) {
|
|
|
103
109
|
/** A revision as `policyRevision` writes it. */
|
|
104
110
|
const POLICY_REVISION = /^(none|[1-9][0-9]{0,15})\.[0-9a-f]{16}$/;
|
|
105
111
|
//#endregion
|
|
106
|
-
export { ACCESS_ACTIONS, POLICY_REVISION, accessRevision, checkpointMessage, checkpointVerifier, describeAccessFault, handsBack, policyRevision, verifyCheckpoint };
|
|
112
|
+
export { ACCESS_ACTIONS, POLICY_REVISION, USE_METADATA_LENGTH, accessRevision, checkpointMessage, checkpointVerifier, describeAccessFault, handsBack, policyRevision, verifyCheckpoint };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffre/core",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.6",
|
|
4
4
|
"description": "What coffre's packages share: roles, envelopes, identity, the audit chain and the vault's contract.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"jose": "6.2.3",
|
|
84
84
|
"oauth4webapi": "3.8.8",
|
|
85
85
|
"zod": "4.4.3",
|
|
86
|
-
"@coffre/client": "0.14.
|
|
86
|
+
"@coffre/client": "0.14.6"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@hegeldev/hegel": "0.4.7",
|
|
90
90
|
"@types/node": "26.1.1",
|
|
91
91
|
"tsdown": "0.23.0",
|
|
92
92
|
"typescript": "5.9.3",
|
|
93
|
-
"@coffre/conformance": "0.14.
|
|
93
|
+
"@coffre/conformance": "0.14.6"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"build": "tsdown",
|
package/src/access.ts
CHANGED
|
@@ -559,6 +559,12 @@ export const DELEGABLE_ROLES: readonly Role[] = delegableRoles();
|
|
|
559
559
|
*/
|
|
560
560
|
export const MAX_PERSONAL_TOKEN_MINUTES = 7 * 24 * 60;
|
|
561
561
|
|
|
562
|
+
/**
|
|
563
|
+
* How long a `coffre login` code waits to be approved. The server expires it
|
|
564
|
+
* then, and the CLI's sign-in hint says so before it has asked for one.
|
|
565
|
+
*/
|
|
566
|
+
export const DEVICE_TTL_SECONDS = 10 * 60;
|
|
567
|
+
|
|
562
568
|
/**
|
|
563
569
|
* A credential's scope, by path as the API names it, in words, each role
|
|
564
570
|
* with its places: `developer on market/dev, api/dev; viewer on market/prod`.
|
package/src/vault.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface Vault {
|
|
|
33
33
|
* refuses `access_changed` and logs no read, and says, by naming it back,
|
|
34
34
|
* that it checked. A vault older than 0.14.1 names none: it checked none.
|
|
35
35
|
*/
|
|
36
|
-
unwrap(input: UnwrapInput): Promise<Outcome<
|
|
36
|
+
unwrap(input: UnwrapInput): Promise<Outcome<Unwrapped>>;
|
|
37
37
|
/**
|
|
38
38
|
* Wrap fresh data keys for new versions `principal` writes: all, or none.
|
|
39
39
|
* `seqs` are the `key.wrap` entries, one per key, which the app's
|
|
@@ -408,8 +408,31 @@ export type UnwrapInput = Correlation & Through & {
|
|
|
408
408
|
* logs the read there too, and decides on the value's own environment.
|
|
409
409
|
*/
|
|
410
410
|
items: { secretVersionId: string; via?: Via; through?: string }[];
|
|
411
|
+
/**
|
|
412
|
+
* The credential proxy's record of what the values go into, the app's
|
|
413
|
+
* `credential.use` entry: the vault appends it beside its reads, once it
|
|
414
|
+
* releases them, under the log's head it already holds, so that the app
|
|
415
|
+
* takes the head no more for it. Where it was, from where, and its
|
|
416
|
+
* metadata, JSON, as the app wrote them; its actor is `principal`. Named
|
|
417
|
+
* back (`used`) once appended: a vault older than 0.14.5 names nothing,
|
|
418
|
+
* and the app appends it itself.
|
|
419
|
+
*/
|
|
420
|
+
use?: UseRecord;
|
|
411
421
|
};
|
|
412
422
|
|
|
423
|
+
/**
|
|
424
|
+
* The longest `UseRecord.metadata` the vault appends, in characters: room for
|
|
425
|
+
* a use naming a few hundred keys. The app appends a longer one itself, under
|
|
426
|
+
* the head, as before 0.14.5.
|
|
427
|
+
*/
|
|
428
|
+
export const USE_METADATA_LENGTH = 16_384;
|
|
429
|
+
|
|
430
|
+
/** The app's `credential.use` entry, for the vault to append (`UnwrapInput.use`). */
|
|
431
|
+
export type UseRecord = { projectId: string | null; environmentId: string | null; sourceIp: string | null; metadata: string };
|
|
432
|
+
|
|
433
|
+
/** An unwrap's answer: each item's key, the answer it was decided on, and whether it appended the use it was given. */
|
|
434
|
+
export type Unwrapped = { keys: string[]; accessRevision?: string; used?: true };
|
|
435
|
+
|
|
413
436
|
/** A reference, as a read names it: its id, and the seq of the vault's `reference.create` entry. */
|
|
414
437
|
export type Via = { reference: string; seq: number };
|
|
415
438
|
|