@coffre/client 0.11.0 → 0.12.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.
@@ -437,6 +437,7 @@ type Api = {
437
437
  "POST /reveals": {
438
438
  input: {
439
439
  path: string;
440
+ keys?: string[];
440
441
  };
441
442
  output: {
442
443
  operationId: string;
@@ -2840,8 +2841,8 @@ declare function createClient(options: ClientOptions): {
2840
2841
  loosenable: boolean;
2841
2842
  rotateAfterDays: number | null;
2842
2843
  }>;
2843
- /** Decrypts one secret, or every secret in an environment. Logged in your name. */
2844
- reveal: (path: string) => Promise<{
2844
+ /** Decrypts one secret, or every secret in an environment, or, `keys` named, those of it only. Logged in your name. */
2845
+ reveal: (path: string, keys?: string[]) => Promise<{
2845
2846
  operationId: string;
2846
2847
  values: {
2847
2848
  [key: string]: string;
@@ -3292,14 +3293,16 @@ declare function createClient(options: ClientOptions): {
3292
3293
  keyAudience?: true;
3293
3294
  sessionHours?: number;
3294
3295
  replicas?: number;
3295
- sessionDays? /**
3296
+ sessionDays?: number;
3297
+ overlapMinutes?: number;
3298
+ mintedBy?
3299
+ /**
3296
3300
  * The instance's roles, in two columns, an environment's that is not
3297
3301
  * protected and one's that is (docs/design/roles.md). Any member lists
3298
3302
  * them; an Owner of the whole instance edits them. `instance` is about
3299
3303
  * instance roles, a person's across every project in their scope.
3300
- */ : number;
3301
- overlapMinutes?: number;
3302
- mintedBy?: string;
3304
+ */
3305
+ : string;
3303
3306
  approve?: true;
3304
3307
  onContention?: "alert";
3305
3308
  unsignedUploads?: true;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as RolesView, A as Decision, B as KeysPlan, C as ApprovalView, D as BindingPlan, E as AuthorizationView, F as DryRunResult, G as MissingKey, H as Me, I as EnvironmentView, J as ProjectSummary, K as OffboardingReport, L as IdentityRow, M as DeletionResult, N as DismissedKey, O as BindingView, P as DryRunOutcome, Q as RoleView, R as ImpactLine, S as Api, T as AuthInfo, U as Member, V as ListedReference, W as MemberAccess, X as RemovedMember, Y as ReferenceView, Z as RoleImpact, _ as byFolder, a as Params, at as TokenRow, b as olderThan, c as RouteOutput, d as planImport, et as SecretKey, f as Unreachable, g as shownMember, h as serviceName, i as ImportAction, it as TokenPlan, j as Deletion, k as ConnectedApp, l as Transport, m as apiMember, n as CoffreClient, nt as SessionRow, o as RouteInput, ot as WorkloadIds, p as unreachable, q as PersonalConfig, r as CoffreError, rt as SetResult, s as RouteKey, t as ClientOptions, tt as SecretVersion, u as createClient, v as foldersOf, w as AuditEntryView, x as AccessValue, y as ageInDays, z as InheritResult } from "./index--nfmYCFv.js";
1
+ import { $ as RolesView, A as Decision, B as KeysPlan, C as ApprovalView, D as BindingPlan, E as AuthorizationView, F as DryRunResult, G as MissingKey, H as Me, I as EnvironmentView, J as ProjectSummary, K as OffboardingReport, L as IdentityRow, M as DeletionResult, N as DismissedKey, O as BindingView, P as DryRunOutcome, Q as RoleView, R as ImpactLine, S as Api, T as AuthInfo, U as Member, V as ListedReference, W as MemberAccess, X as RemovedMember, Y as ReferenceView, Z as RoleImpact, _ as byFolder, a as Params, at as TokenRow, b as olderThan, c as RouteOutput, d as planImport, et as SecretKey, f as Unreachable, g as shownMember, h as serviceName, i as ImportAction, it as TokenPlan, j as Deletion, k as ConnectedApp, l as Transport, m as apiMember, n as CoffreClient, nt as SessionRow, o as RouteInput, ot as WorkloadIds, p as unreachable, q as PersonalConfig, r as CoffreError, rt as SetResult, s as RouteKey, t as ClientOptions, tt as SecretVersion, u as createClient, v as foldersOf, w as AuditEntryView, x as AccessValue, y as ageInDays, z as InheritResult } from "./index-DxSvWq3r.js";
2
2
  export { type AccessValue, type Api, type ApprovalView, type AuditEntryView, type AuthInfo, type AuthorizationView, type BindingPlan, type BindingView, ClientOptions, CoffreClient, CoffreError, type ConnectedApp, type Decision, type Deletion, type DeletionResult, type DismissedKey, type DryRunOutcome, type DryRunResult, type EnvironmentView, type IdentityRow, type ImpactLine, ImportAction, type InheritResult, type KeysPlan, type ListedReference, type Me, type Member, type MemberAccess, type MissingKey, type OffboardingReport, Params, type PersonalConfig, type ProjectSummary, type ReferenceView, type RemovedMember, type RoleImpact, type RoleView, type RolesView, RouteInput, RouteKey, RouteOutput, type SecretKey, type SecretVersion, type SessionRow, type SetResult, type TokenPlan, type TokenRow, Transport, Unreachable, type WorkloadIds, ageInDays, apiMember, byFolder, createClient, foldersOf, olderThan, planImport, serviceName, shownMember, unreachable };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as serviceName, c as foldersOf, d as Unreachable, f as unreachable, i as apiMember, l as ageInDays, n as createClient, o as shownMember, r as planImport, s as byFolder, t as CoffreError, u as olderThan } from "./src-CDyZe9vW.js";
1
+ import { a as serviceName, c as foldersOf, d as Unreachable, f as unreachable, i as apiMember, l as ageInDays, n as createClient, o as shownMember, r as planImport, s as byFolder, t as CoffreError, u as olderThan } from "./src-CjUBSxZs.js";
2
2
  export { CoffreError, Unreachable, ageInDays, apiMember, byFolder, createClient, foldersOf, olderThan, planImport, serviceName, shownMember, unreachable };
package/dist/routes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Params, o as RouteInput, s as RouteKey } from "./index--nfmYCFv.js";
1
+ import { a as Params, o as RouteInput, s as RouteKey } from "./index-DxSvWq3r.js";
2
2
  //#region src/routes.d.ts
3
3
  export type GetKey = Extract<RouteKey, `GET ${string}`>;
4
4
  /** Each GET route, with what to ask it. */
@@ -226,8 +226,11 @@ function createClient(options) {
226
226
  secrets: {
227
227
  /** Keys, versions and who changed what; never values. */
228
228
  list: (path) => call("GET /secrets/:project/:environment", place(path)),
229
- /** Decrypts one secret, or every secret in an environment. Logged in your name. */
230
- reveal: (path) => call("POST /reveals", {}, { path }),
229
+ /** Decrypts one secret, or every secret in an environment, or, `keys` named, those of it only. Logged in your name. */
230
+ reveal: (path, keys) => call("POST /reveals", {}, keys === void 0 ? { path } : {
231
+ path,
232
+ keys
233
+ }),
231
234
  /** One transaction, a version and an audit entry per key; `null` archives. */
232
235
  set: (path, values) => call("PATCH /secrets/:project/:environment", place(path), values),
233
236
  /**
@@ -1,4 +1,4 @@
1
- import { n as upgradeHeaders, r as upgradeRefused } from "./workload-w4QPSyjj.js";
1
+ import { n as upgradeHeaders, r as upgradeRefused } from "./workload-rRw-uFfr.js";
2
2
  import { Buffer } from "node:buffer";
3
3
  import { Duplex } from "node:stream";
4
4
  //#region src/workload-postgres.ts
@@ -1,4 +1,4 @@
1
- import { t as CoffreError } from "./src-CDyZe9vW.js";
1
+ import { t as CoffreError } from "./src-CjUBSxZs.js";
2
2
  import { base64url, bodyDigest, bodyLine, createProof, generateProofKey, thumbprint } from "./dpop.js";
3
3
  //#region src/workload-proofs.ts
4
4
  /** `<audience>#jkt=<thumbprint>`: an audience only this key can use (section 4.2). */
@@ -1,3 +1,3 @@
1
- import { r as CoffreError } from "./index--nfmYCFv.js";
1
+ import { r as CoffreError } from "./index-DxSvWq3r.js";
2
2
  import { C as vercel, S as oidc, _ as fly, a as fromCoffre, b as keyAudience, c as workload, d as PlatformProof, f as Proof, g as enrollment, h as azure, i as WorkloadOptions, l as AwsCredentials, m as aws, n as UsedCredential, o as upgradeHeaders, p as ProofContext, r as Workload, s as upgradeRefused, t as NarrowOptions, u as KUBERNETES_TOKEN, v as gcp, x as kubernetes, y as github } from "./workload-9LPBYMmN.js";
3
3
  export { type AwsCredentials, CoffreError, KUBERNETES_TOKEN, NarrowOptions, type PlatformProof, type Proof, type ProofContext, UsedCredential, Workload, WorkloadOptions, aws, azure, enrollment, fly, fromCoffre, gcp, github, keyAudience, kubernetes, oidc, upgradeHeaders, upgradeRefused, vercel, workload };
package/dist/workload.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as CoffreError } from "./src-CDyZe9vW.js";
2
- import { a as KUBERNETES_TOKEN, c as enrollment, d as github, f as keyAudience, h as vercel, i as workload, l as fly, m as oidc, n as upgradeHeaders, o as aws, p as kubernetes, r as upgradeRefused, s as azure, t as fromCoffre, u as gcp } from "./workload-w4QPSyjj.js";
1
+ import { t as CoffreError } from "./src-CjUBSxZs.js";
2
+ import { a as KUBERNETES_TOKEN, c as enrollment, d as github, f as keyAudience, h as vercel, i as workload, l as fly, m as oidc, n as upgradeHeaders, o as aws, p as kubernetes, r as upgradeRefused, s as azure, t as fromCoffre, u as gcp } from "./workload-rRw-uFfr.js";
3
3
  export { CoffreError, KUBERNETES_TOKEN, aws, azure, enrollment, fly, fromCoffre, gcp, github, keyAudience, kubernetes, oidc, upgradeHeaders, upgradeRefused, vercel, workload };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/client",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "The coffre API as typed function calls.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/api.ts CHANGED
@@ -440,6 +440,7 @@ export type Api = {
440
440
  "POST /reveals": {
441
441
  input: {
442
442
  path: string;
443
+ keys?: string[];
443
444
  };
444
445
  output: {
445
446
  operationId: string;
package/src/index.ts CHANGED
@@ -240,8 +240,8 @@ export function createClient(options: ClientOptions) {
240
240
  secrets: {
241
241
  /** Keys, versions and who changed what; never values. */
242
242
  list: (path: string) => call('GET /secrets/:project/:environment', place(path)),
243
- /** Decrypts one secret, or every secret in an environment. Logged in your name. */
244
- reveal: (path: string) => call('POST /reveals', {}, { path }),
243
+ /** Decrypts one secret, or every secret in an environment, or, `keys` named, those of it only. Logged in your name. */
244
+ reveal: (path: string, keys?: string[]) => call('POST /reveals', {}, keys === undefined ? { path } : { path, keys }),
245
245
  /** One transaction, a version and an audit entry per key; `null` archives. */
246
246
  set: (path: string, values: RouteInput<'PATCH /secrets/:project/:environment'>) =>
247
247
  call('PATCH /secrets/:project/:environment', place(path), values) as Promise<SetResult>,