@coffre/client 0.4.6 → 0.5.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/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as DeletionResult, B as OffboardingReport, C as AuthInfo, D as ConnectedApp, E as BindingView, F as InheritedGrant, G as SecretVersion, H as ReferenceView, I as ListedReference, J as SetResult, K as ServiceTokenRow, L as Me, M as DryRunOutcome, N as DryRunResult, O as Decision, P as IdentityRow, R as Member, S as AuditEntryView, T as BindingPlan, U as RemovedMember, V as ProjectSummary, W as SecretKey, Y as WorkloadIds, _ as byFolder, a as Params, b as Api, c as RouteOutput, d as planImport, f as Unreachable, g as shownMember, h as serviceName, i as ImportAction, j as DismissedKey, k as Deletion, l as Transport, m as apiMember, n as CoffreClient, o as RouteInput, p as unreachable, q as SessionRow, r as CoffreError, s as RouteKey, t as ClientOptions, u as createClient, v as foldersOf, w as AuthorizationView, x as ApprovalView, y as AccessValue, z as MissingKey } from "./index-D_Fqmy4Z.js";
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 IdentityRow, ImportAction, type InheritedGrant, type ListedReference, type Me, type Member, type MissingKey, type OffboardingReport, Params, type ProjectSummary, type ReferenceView, type RemovedMember, RouteInput, RouteKey, RouteOutput, type SecretKey, type SecretVersion, type ServiceTokenRow, type SessionRow, type SetResult, Transport, Unreachable, type WorkloadIds, apiMember, byFolder, createClient, foldersOf, planImport, serviceName, shownMember, unreachable };
1
+ import { A as DeletionResult, B as OffboardingReport, C as AuthInfo, D as ConnectedApp, E as BindingView, F as ListedReference, G as SecretVersion, H as ReferenceView, I as Me, J as SetResult, K as ServiceTokenRow, L as Member, M as DryRunOutcome, N as DryRunResult, O as Decision, P as IdentityRow, R as MemberAccess, S as AuditEntryView, T as BindingPlan, U as RemovedMember, V as ProjectSummary, W as SecretKey, X as WorkloadIds, Y as TokenPlan, _ as byFolder, a as Params, b as Api, c as RouteOutput, d as planImport, f as Unreachable, g as shownMember, h as serviceName, i as ImportAction, j as DismissedKey, k as Deletion, l as Transport, m as apiMember, n as CoffreClient, o as RouteInput, p as unreachable, q as SessionRow, r as CoffreError, s as RouteKey, t as ClientOptions, u as createClient, v as foldersOf, w as AuthorizationView, x as ApprovalView, y as AccessValue, z as MissingKey } from "./index-D0kM4Gfi.js";
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 IdentityRow, ImportAction, type ListedReference, type Me, type Member, type MemberAccess, type MissingKey, type OffboardingReport, Params, type ProjectSummary, type ReferenceView, type RemovedMember, RouteInput, RouteKey, RouteOutput, type SecretKey, type SecretVersion, type ServiceTokenRow, type SessionRow, type SetResult, type TokenPlan, Transport, Unreachable, type WorkloadIds, apiMember, byFolder, createClient, foldersOf, planImport, serviceName, shownMember, unreachable };
package/dist/index.js CHANGED
@@ -221,12 +221,19 @@ function createClient(options) {
221
221
  list: (path) => call("GET /members", {}, { path }),
222
222
  /** What they hold, and what to rotate if they leave. */
223
223
  get: (member) => call("GET /members/:member", { member }),
224
+ /** Their instance role and scope, and the grants you manage, in one read. */
225
+ access: (member) => call("GET /members/:member/access", { member }),
224
226
  add: (member, input = {}) => call("PUT /members/:member", { member }, input),
225
227
  /** Offboards; returns what to rotate. */
226
228
  remove: (member) => call("DELETE /members/:member", { member })
227
229
  },
228
230
  tokens: {
229
231
  list: (member) => call("GET /members/:member/tokens", { member }),
232
+ /** What the token would reach, as the server would issue it now; issues nothing. */
233
+ preview: (member, input) => {
234
+ const [method, route] = address("POST /members/:member/tokens", { member });
235
+ return send(method, `${route}?dryRun=1`, input);
236
+ },
230
237
  /** The value is in the answer, and only there. */
231
238
  issue: (member, input) => call("POST /members/:member/tokens", { member }, input),
232
239
  revoke: (member, id) => call("DELETE /members/:member/tokens/:id", {
@@ -317,6 +324,11 @@ set: (member, access) => call("PATCH /access/:member", { member }, access) },
317
324
  list: () => call("GET /apps", {}),
318
325
  disconnect: (id) => call("DELETE /apps/:id", { id })
319
326
  },
327
+ /** The instance's settings, for those who run it: where people set up service accounts themselves. */
328
+ settings: {
329
+ get: () => call("GET /settings", {}),
330
+ set: (input) => call("PUT /settings", {}, input)
331
+ },
320
332
  audit: {
321
333
  list: (query = {}) => call("GET /audit", {}, query),
322
334
  verify: () => call("GET /audit/verification", {}),
package/dist/routes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as Params, o as RouteInput, s as RouteKey } from "./index-D_Fqmy4Z.js";
1
+ import { a as Params, o as RouteInput, s as RouteKey } from "./index-D0kM4Gfi.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. */
package/dist/routes.js CHANGED
@@ -19,12 +19,14 @@ function getCalls({ places, secrets, members, services }) {
19
19
  input: { path: `${first.project}/${first.environment}` }
20
20
  }]],
21
21
  "GET /members/:member": members.map((member) => ({ params: { member } })),
22
+ "GET /members/:member/access": members.map((member) => ({ params: { member } })),
22
23
  "GET /members/:member/tokens": services.map((member) => ({ params: { member } })),
23
24
  "GET /members/:member/bindings": services.map((member) => ({ params: { member } })),
24
25
  "GET /workloads/lookup": [{
25
26
  params: {},
26
27
  input: { github: "acme/api" }
27
28
  }],
29
+ "GET /settings": [{ params: {} }],
28
30
  "GET /sessions": [{ params: {} }],
29
31
  "GET /identities": [{ params: {} }],
30
32
  "GET /device-logins/:code": [{ params: { code: "BCDF-GHJK" } }],
@@ -86,6 +88,7 @@ const EVERY_ROUTE = {
86
88
  "POST /reveals": true,
87
89
  "GET /members": true,
88
90
  "GET /members/:member": true,
91
+ "GET /members/:member/access": true,
89
92
  "PUT /members/:member": true,
90
93
  "DELETE /members/:member": true,
91
94
  "GET /members/:member/tokens": true,
@@ -95,6 +98,8 @@ const EVERY_ROUTE = {
95
98
  "POST /members/:member/bindings": true,
96
99
  "DELETE /members/:member/bindings/:id": true,
97
100
  "GET /workloads/lookup": true,
101
+ "GET /settings": true,
102
+ "PUT /settings": true,
98
103
  "PATCH /access/:member": true,
99
104
  "GET /sessions": true,
100
105
  "DELETE /sessions/:id": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffre/client",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
4
4
  "description": "The coffre API as typed function calls.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/api.ts CHANGED
@@ -13,9 +13,35 @@ export type Api = {
13
13
  };
14
14
  registered: boolean;
15
15
  tampered: boolean;
16
- instanceRole: "owner" | "root-admin" | "user";
16
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
17
+ scope: {
18
+ projects: "all" | {
19
+ only: string[];
20
+ } | {
21
+ except: string[];
22
+ };
23
+ environments: "all" | {
24
+ only: string[];
25
+ } | {
26
+ except: string[];
27
+ };
28
+ };
17
29
  isRootAdmin: boolean;
30
+ runsInstance: boolean;
18
31
  canReadAudit: boolean;
32
+ setsUpServices: boolean;
33
+ serviceSetup: null | {
34
+ projects: "all" | {
35
+ only: string[];
36
+ } | {
37
+ except: string[];
38
+ };
39
+ environments: "all" | {
40
+ only: string[];
41
+ } | {
42
+ except: string[];
43
+ };
44
+ };
19
45
  features: {
20
46
  mcp: string | null;
21
47
  workloads: boolean;
@@ -47,13 +73,6 @@ export type Api = {
47
73
  }[];
48
74
  secretCount: number | null;
49
75
  }[];
50
- everyProject: {
51
- member: string;
52
- place: string;
53
- role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
54
- roleName: string;
55
- expiresAt: string | null;
56
- }[];
57
76
  };
58
77
  };
59
78
  "PUT /projects/:project": {
@@ -67,13 +86,6 @@ export type Api = {
67
86
  archivedAt: string | null;
68
87
  };
69
88
  created: boolean;
70
- inherited: {
71
- member: string;
72
- place: string;
73
- role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
74
- roleName: string;
75
- expiresAt: string | null;
76
- }[];
77
89
  };
78
90
  };
79
91
  "PATCH /projects/:project": {
@@ -128,13 +140,6 @@ export type Api = {
128
140
  archivedAt: string | null;
129
141
  };
130
142
  created: boolean;
131
- inherited: {
132
- member: string;
133
- place: string;
134
- role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
135
- roleName: string;
136
- expiresAt: string | null;
137
- }[];
138
143
  forked: null | {
139
144
  from: string;
140
145
  keys: number;
@@ -155,13 +160,6 @@ export type Api = {
155
160
  name: string;
156
161
  archivedAt: string | null;
157
162
  };
158
- inherited: {
159
- member: string;
160
- place: string;
161
- role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
162
- roleName: string;
163
- expiresAt: string | null;
164
- }[];
165
163
  };
166
164
  };
167
165
  "DELETE /projects/:project/:environment": {
@@ -389,7 +387,21 @@ export type Api = {
389
387
  member: string;
390
388
  principalType: "service" | "user";
391
389
  principalId: string;
392
- instanceRole: "owner" | "root-admin" | "user";
390
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
391
+ scope: null | {
392
+ projects: "all" | {
393
+ only: string[];
394
+ } | {
395
+ except: string[];
396
+ };
397
+ environments: "all" | {
398
+ only: string[];
399
+ } | {
400
+ except: string[];
401
+ };
402
+ };
403
+ reachesByRole: boolean;
404
+ managed: boolean;
393
405
  isRootAdmin: boolean;
394
406
  tampered: boolean;
395
407
  grants: {
@@ -415,7 +427,19 @@ export type Api = {
415
427
  principalType: "service" | "user";
416
428
  principalId: string;
417
429
  status: "active" | "removed" | "tampered";
418
- instanceRole: "owner" | "root-admin" | "user";
430
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
431
+ scope: {
432
+ projects: "all" | {
433
+ only: string[];
434
+ } | {
435
+ except: string[];
436
+ };
437
+ environments: "all" | {
438
+ only: string[];
439
+ } | {
440
+ except: string[];
441
+ };
442
+ };
419
443
  isRootAdmin: boolean;
420
444
  removedAt: string | null;
421
445
  removedBy: string | null;
@@ -442,6 +466,9 @@ export type Api = {
442
466
  hint: string;
443
467
  expiresAt: string;
444
468
  lastUsedAt: string | null;
469
+ scope: null | {
470
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
471
+ };
445
472
  }[];
446
473
  apps: {
447
474
  id: string;
@@ -469,11 +496,35 @@ export type Api = {
469
496
  };
470
497
  "PUT /members/:member": {
471
498
  input: {
472
- owner?: boolean;
499
+ role?: "admin" | "auditor" | "developer" | "member" | "owner";
500
+ scope?: {
501
+ projects?: "all" | {
502
+ only: string[];
503
+ } | {
504
+ except: string[];
505
+ };
506
+ environments?: "all" | {
507
+ only: string[];
508
+ } | {
509
+ except: string[];
510
+ };
511
+ };
473
512
  };
474
513
  output: {
475
514
  member: string;
476
- instanceRole: "owner" | "user";
515
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner";
516
+ scope: {
517
+ projects: "all" | {
518
+ only: string[];
519
+ } | {
520
+ except: string[];
521
+ };
522
+ environments: "all" | {
523
+ only: string[];
524
+ } | {
525
+ except: string[];
526
+ };
527
+ };
477
528
  created: boolean;
478
529
  };
479
530
  };
@@ -487,11 +538,23 @@ export type Api = {
487
538
  identities: number;
488
539
  apps: number;
489
540
  };
490
- report: {
541
+ report: null | {
491
542
  principalType: "service" | "user";
492
543
  principalId: string;
493
544
  status: "active" | "removed" | "tampered";
494
- instanceRole: "owner" | "root-admin" | "user";
545
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
546
+ scope: {
547
+ projects: "all" | {
548
+ only: string[];
549
+ } | {
550
+ except: string[];
551
+ };
552
+ environments: "all" | {
553
+ only: string[];
554
+ } | {
555
+ except: string[];
556
+ };
557
+ };
495
558
  isRootAdmin: boolean;
496
559
  removedAt: string | null;
497
560
  removedBy: string | null;
@@ -518,6 +581,9 @@ export type Api = {
518
581
  hint: string;
519
582
  expiresAt: string;
520
583
  lastUsedAt: string | null;
584
+ scope: null | {
585
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
586
+ };
521
587
  }[];
522
588
  apps: {
523
589
  id: string;
@@ -556,6 +622,9 @@ export type Api = {
556
622
  expiresAt: string;
557
623
  lastUsedAt: string | null;
558
624
  lastUsedIp: string | null;
625
+ scope: null | {
626
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
627
+ };
559
628
  }[];
560
629
  };
561
630
  };
@@ -563,11 +632,21 @@ export type Api = {
563
632
  input: {
564
633
  expiresInDays: number;
565
634
  label?: string | null;
635
+ scope?: {
636
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
637
+ };
566
638
  };
567
639
  output: {
568
640
  id: string;
569
641
  token: string;
570
642
  expiresAt: string;
643
+ scope: {
644
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
645
+ };
646
+ } | {
647
+ scope: {
648
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
649
+ };
571
650
  };
572
651
  };
573
652
  "DELETE /members/:member/tokens/:id": {
@@ -585,7 +664,10 @@ export type Api = {
585
664
  issuer: string;
586
665
  jwksUri: string;
587
666
  claims: {
588
- [key: string]: string;
667
+ [key: string]: string | string[];
668
+ };
669
+ scope: null | {
670
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
589
671
  };
590
672
  label: string | null;
591
673
  createdAt: string;
@@ -598,9 +680,12 @@ export type Api = {
598
680
  input: {
599
681
  profile: "custom" | "github" | "github-reusable" | "github-reusable-organization" | "gitlab";
600
682
  claims: {
601
- [key: string]: string;
683
+ [key: string]: string | string[];
602
684
  };
603
685
  issuer?: string | null;
686
+ scope?: {
687
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
688
+ };
604
689
  label?: string | null;
605
690
  replaces?: string[];
606
691
  };
@@ -609,7 +694,10 @@ export type Api = {
609
694
  issuer: string;
610
695
  jwksUri: string;
611
696
  claims: {
612
- [key: string]: string;
697
+ [key: string]: string | string[];
698
+ };
699
+ scope: {
700
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
613
701
  };
614
702
  replaces: {
615
703
  id: string;
@@ -622,7 +710,10 @@ export type Api = {
622
710
  issuer: string;
623
711
  jwksUri: string;
624
712
  claims: {
625
- [key: string]: string;
713
+ [key: string]: string | string[];
714
+ };
715
+ scope: null | {
716
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
626
717
  };
627
718
  label: string | null;
628
719
  createdAt: string;
@@ -955,6 +1046,86 @@ export type Api = {
955
1046
  }[];
956
1047
  };
957
1048
  };
1049
+ "GET /members/:member/access": {
1050
+ input: undefined;
1051
+ output: {
1052
+ member: string;
1053
+ principalType: "service" | "user";
1054
+ principalId: string;
1055
+ status: "active" | "removed" | "tampered";
1056
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
1057
+ scope: null | {
1058
+ projects: "all" | {
1059
+ only: string[];
1060
+ } | {
1061
+ except: string[];
1062
+ };
1063
+ environments: "all" | {
1064
+ only: string[];
1065
+ } | {
1066
+ except: string[];
1067
+ };
1068
+ };
1069
+ isRootAdmin: boolean;
1070
+ managed: boolean;
1071
+ grants: {
1072
+ id: string;
1073
+ project: string;
1074
+ environment: string | null;
1075
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1076
+ roleName: string;
1077
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
1078
+ expiresAt: string | null;
1079
+ }[];
1080
+ };
1081
+ };
1082
+ "PUT /settings": {
1083
+ input: {
1084
+ serviceAccounts: {
1085
+ projects?: "all" | {
1086
+ only: string[];
1087
+ } | {
1088
+ except: string[];
1089
+ };
1090
+ environments?: "all" | {
1091
+ only: string[];
1092
+ } | {
1093
+ except: string[];
1094
+ };
1095
+ };
1096
+ };
1097
+ output: {
1098
+ serviceAccounts: {
1099
+ projects: "all" | {
1100
+ only: string[];
1101
+ } | {
1102
+ except: string[];
1103
+ };
1104
+ environments: "all" | {
1105
+ only: string[];
1106
+ } | {
1107
+ except: string[];
1108
+ };
1109
+ };
1110
+ };
1111
+ };
1112
+ "GET /settings": {
1113
+ input: undefined;
1114
+ output: {
1115
+ serviceAccounts: {
1116
+ projects: "all" | {
1117
+ only: string[];
1118
+ } | {
1119
+ except: string[];
1120
+ };
1121
+ environments: "all" | {
1122
+ only: string[];
1123
+ } | {
1124
+ except: string[];
1125
+ };
1126
+ };
1127
+ };
1128
+ };
958
1129
  };
959
1130
 
960
1131
  export type AccessValue = "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer" | null | {
@@ -1072,7 +1243,10 @@ export type BindingPlan = {
1072
1243
  issuer: string;
1073
1244
  jwksUri: string;
1074
1245
  claims: {
1075
- [key: string]: string;
1246
+ [key: string]: string | string[];
1247
+ };
1248
+ scope: {
1249
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1076
1250
  };
1077
1251
  replaces: {
1078
1252
  id: string;
@@ -1086,7 +1260,10 @@ export type BindingView = {
1086
1260
  issuer: string;
1087
1261
  jwksUri: string;
1088
1262
  claims: {
1089
- [key: string]: string;
1263
+ [key: string]: string | string[];
1264
+ };
1265
+ scope: null | {
1266
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1090
1267
  };
1091
1268
  label: string | null;
1092
1269
  createdAt: string;
@@ -1198,14 +1375,6 @@ export type IdentityRow = {
1198
1375
  lastSignInAt: string | null;
1199
1376
  };
1200
1377
 
1201
- export type InheritedGrant = {
1202
- member: string;
1203
- place: string;
1204
- role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1205
- roleName: string;
1206
- expiresAt: string | null;
1207
- };
1208
-
1209
1378
  export type Me = {
1210
1379
  principal: {
1211
1380
  type: "service" | "user";
@@ -1213,9 +1382,35 @@ export type Me = {
1213
1382
  };
1214
1383
  registered: boolean;
1215
1384
  tampered: boolean;
1216
- instanceRole: "owner" | "root-admin" | "user";
1385
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
1386
+ scope: {
1387
+ projects: "all" | {
1388
+ only: string[];
1389
+ } | {
1390
+ except: string[];
1391
+ };
1392
+ environments: "all" | {
1393
+ only: string[];
1394
+ } | {
1395
+ except: string[];
1396
+ };
1397
+ };
1217
1398
  isRootAdmin: boolean;
1399
+ runsInstance: boolean;
1218
1400
  canReadAudit: boolean;
1401
+ setsUpServices: boolean;
1402
+ serviceSetup: null | {
1403
+ projects: "all" | {
1404
+ only: string[];
1405
+ } | {
1406
+ except: string[];
1407
+ };
1408
+ environments: "all" | {
1409
+ only: string[];
1410
+ } | {
1411
+ except: string[];
1412
+ };
1413
+ };
1219
1414
  features: {
1220
1415
  mcp: string | null;
1221
1416
  workloads: boolean;
@@ -1231,7 +1426,21 @@ export type Member = {
1231
1426
  member: string;
1232
1427
  principalType: "service" | "user";
1233
1428
  principalId: string;
1234
- instanceRole: "owner" | "root-admin" | "user";
1429
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
1430
+ scope: null | {
1431
+ projects: "all" | {
1432
+ only: string[];
1433
+ } | {
1434
+ except: string[];
1435
+ };
1436
+ environments: "all" | {
1437
+ only: string[];
1438
+ } | {
1439
+ except: string[];
1440
+ };
1441
+ };
1442
+ reachesByRole: boolean;
1443
+ managed: boolean;
1235
1444
  isRootAdmin: boolean;
1236
1445
  tampered: boolean;
1237
1446
  grants: {
@@ -1245,6 +1454,52 @@ export type Member = {
1245
1454
  }[];
1246
1455
  };
1247
1456
 
1457
+ export type MemberAccess = {
1458
+ member: string;
1459
+ principalType: "service" | "user";
1460
+ principalId: string;
1461
+ status: "active" | "removed" | "tampered";
1462
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
1463
+ scope: null | {
1464
+ projects: "all" | {
1465
+ only: string[];
1466
+ } | {
1467
+ except: string[];
1468
+ };
1469
+ environments: "all" | {
1470
+ only: string[];
1471
+ } | {
1472
+ except: string[];
1473
+ };
1474
+ };
1475
+ isRootAdmin: boolean;
1476
+ managed: boolean;
1477
+ grants: {
1478
+ id: string;
1479
+ project: string;
1480
+ environment: string | null;
1481
+ role: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1482
+ roleName: string;
1483
+ permissions: ("audit.read" | "environment.manage" | "grant.manage" | "project.manage" | "secret.archive" | "secret.read" | "secret.write")[];
1484
+ expiresAt: string | null;
1485
+ }[];
1486
+ };
1487
+
1488
+ export type SettingsView = {
1489
+ serviceAccounts: {
1490
+ projects: "all" | {
1491
+ only: string[];
1492
+ } | {
1493
+ except: string[];
1494
+ };
1495
+ environments: "all" | {
1496
+ only: string[];
1497
+ } | {
1498
+ except: string[];
1499
+ };
1500
+ };
1501
+ };
1502
+
1248
1503
  export type MissingKey = {
1249
1504
  key: string;
1250
1505
  in: string[];
@@ -1255,7 +1510,19 @@ export type OffboardingReport = {
1255
1510
  principalType: "service" | "user";
1256
1511
  principalId: string;
1257
1512
  status: "active" | "removed" | "tampered";
1258
- instanceRole: "owner" | "root-admin" | "user";
1513
+ instanceRole: "admin" | "auditor" | "developer" | "member" | "owner" | "root-admin";
1514
+ scope: {
1515
+ projects: "all" | {
1516
+ only: string[];
1517
+ } | {
1518
+ except: string[];
1519
+ };
1520
+ environments: "all" | {
1521
+ only: string[];
1522
+ } | {
1523
+ except: string[];
1524
+ };
1525
+ };
1259
1526
  isRootAdmin: boolean;
1260
1527
  removedAt: string | null;
1261
1528
  removedBy: string | null;
@@ -1282,6 +1549,9 @@ export type OffboardingReport = {
1282
1549
  hint: string;
1283
1550
  expiresAt: string;
1284
1551
  lastUsedAt: string | null;
1552
+ scope: null | {
1553
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1554
+ };
1285
1555
  }[];
1286
1556
  apps: {
1287
1557
  id: string;
@@ -1396,6 +1666,9 @@ export type ServiceTokenRow = {
1396
1666
  expiresAt: string;
1397
1667
  lastUsedAt: string | null;
1398
1668
  lastUsedIp: string | null;
1669
+ scope: null | {
1670
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1671
+ };
1399
1672
  };
1400
1673
 
1401
1674
  export type SessionRow = {
@@ -1423,3 +1696,9 @@ export type SetResult = {
1423
1696
  };
1424
1697
  };
1425
1698
  };
1699
+
1700
+ export type TokenPlan = {
1701
+ scope: {
1702
+ [key: string]: "access-manager" | "auditor" | "developer" | "maintainer" | "owner" | "viewer";
1703
+ };
1704
+ };