@fabrika/iam-contract 0.9.0-dev.36 → 0.9.0-dev.37
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/package.json +4 -4
- package/src/index.ts +13 -1
- package/types/src/index.d.ts +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/iam-contract",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"test": "bun test"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@fabrika/app": "0.9.0-dev.
|
|
31
|
-
"@fabrika/auth-core": "0.9.0-dev.
|
|
32
|
-
"@fabrika/proxy-core": "0.9.0-dev.
|
|
30
|
+
"@fabrika/app": "0.9.0-dev.37",
|
|
31
|
+
"@fabrika/auth-core": "0.9.0-dev.37",
|
|
32
|
+
"@fabrika/proxy-core": "0.9.0-dev.37"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/index.ts
CHANGED
|
@@ -69,8 +69,10 @@ export interface GrantDto {
|
|
|
69
69
|
permissions: string[] | null
|
|
70
70
|
/** Scope dimension; null = global (both rise/fall together). */
|
|
71
71
|
scopeType: string | null
|
|
72
|
-
/** Opaque, app-owned scope value; null = global. */
|
|
72
|
+
/** Opaque, app-owned scope value; null = global. The first of `scopeValues` (ADR-0085). */
|
|
73
73
|
scopeValue: string | null
|
|
74
|
+
/** Every value of `scopeType` the grant holds, sorted; null = global. A grant of one value lists one. */
|
|
75
|
+
scopeValues: string[] | null
|
|
74
76
|
/** App id this grant applies to; null = all apps (cross-app). */
|
|
75
77
|
app: string | null
|
|
76
78
|
grantedBy: string | null
|
|
@@ -161,6 +163,9 @@ export interface SessionList extends CursorList<SessionDto> {
|
|
|
161
163
|
|
|
162
164
|
// ── Grants ────────────────────────────────────────────────────────────────────
|
|
163
165
|
|
|
166
|
+
/** The most scope values one grant holds (ADR-0085). */
|
|
167
|
+
export const MAX_GRANT_SCOPE_VALUES = 100
|
|
168
|
+
|
|
164
169
|
export interface CreateGrantRequest {
|
|
165
170
|
principalId: string
|
|
166
171
|
/** A named role/policy key — XOR `permissions` (supply exactly one). */
|
|
@@ -171,6 +176,8 @@ export interface CreateGrantRequest {
|
|
|
171
176
|
scopeType?: string | null
|
|
172
177
|
/** Opaque, app-owned scope value; null / omitted = global. */
|
|
173
178
|
scopeValue?: string | null
|
|
179
|
+
/** Several values of `scopeType`, one grant (ADR-0085); XOR `scopeValue`, at most `MAX_GRANT_SCOPE_VALUES`. */
|
|
180
|
+
scopeValues?: string[]
|
|
174
181
|
/** App id (a registered app id); null / omitted = all apps (cross-app). */
|
|
175
182
|
app?: string | null
|
|
176
183
|
expiresAt?: number | null
|
|
@@ -210,7 +217,10 @@ export interface GrantRequestDto {
|
|
|
210
217
|
roleKey: string | null
|
|
211
218
|
permissions: string[] | null
|
|
212
219
|
scopeType: string | null
|
|
220
|
+
/** The first requested value; `scopeValues` holds every one. */
|
|
213
221
|
scopeValue: string | null
|
|
222
|
+
/** Every requested value, sorted (ADR-0085); null for a global grant. */
|
|
223
|
+
scopeValues: string[] | null
|
|
214
224
|
/** The grant's own expiry; null for none. */
|
|
215
225
|
grantExpiresAt: number | null
|
|
216
226
|
requestedBy: string
|
|
@@ -377,6 +387,8 @@ export interface ProvisionApiKeyRequest {
|
|
|
377
387
|
scopeType?: string | null
|
|
378
388
|
/** Opaque, app-owned scope value; null / omitted = global. */
|
|
379
389
|
scopeValue?: string | null
|
|
390
|
+
/** Several values of `scopeType`, one grant (ADR-0085); XOR `scopeValue`, at most `MAX_GRANT_SCOPE_VALUES`. */
|
|
391
|
+
scopeValues?: string[]
|
|
380
392
|
/** App id (a registered app id); null / omitted = all apps. */
|
|
381
393
|
app?: string | null
|
|
382
394
|
expiresAt?: number | null
|
package/types/src/index.d.ts
CHANGED
|
@@ -36,8 +36,10 @@ export interface GrantDto {
|
|
|
36
36
|
permissions: string[] | null;
|
|
37
37
|
/** Scope dimension; null = global (both rise/fall together). */
|
|
38
38
|
scopeType: string | null;
|
|
39
|
-
/** Opaque, app-owned scope value; null = global. */
|
|
39
|
+
/** Opaque, app-owned scope value; null = global. The first of `scopeValues` (ADR-0085). */
|
|
40
40
|
scopeValue: string | null;
|
|
41
|
+
/** Every value of `scopeType` the grant holds, sorted; null = global. A grant of one value lists one. */
|
|
42
|
+
scopeValues: string[] | null;
|
|
41
43
|
/** App id this grant applies to; null = all apps (cross-app). */
|
|
42
44
|
app: string | null;
|
|
43
45
|
grantedBy: string | null;
|
|
@@ -127,6 +129,8 @@ export interface SessionList extends CursorList<SessionDto> {
|
|
|
127
129
|
/** App sessions belonging to the sign-ins on this page, when `signInsOnly` is requested. */
|
|
128
130
|
applications: SessionDto[];
|
|
129
131
|
}
|
|
132
|
+
/** The most scope values one grant holds (ADR-0085). */
|
|
133
|
+
export declare const MAX_GRANT_SCOPE_VALUES = 100;
|
|
130
134
|
export interface CreateGrantRequest {
|
|
131
135
|
principalId: string;
|
|
132
136
|
/** A named role/policy key — XOR `permissions` (supply exactly one). */
|
|
@@ -137,6 +141,8 @@ export interface CreateGrantRequest {
|
|
|
137
141
|
scopeType?: string | null;
|
|
138
142
|
/** Opaque, app-owned scope value; null / omitted = global. */
|
|
139
143
|
scopeValue?: string | null;
|
|
144
|
+
/** Several values of `scopeType`, one grant (ADR-0085); XOR `scopeValue`, at most `MAX_GRANT_SCOPE_VALUES`. */
|
|
145
|
+
scopeValues?: string[];
|
|
140
146
|
/** App id (a registered app id); null / omitted = all apps (cross-app). */
|
|
141
147
|
app?: string | null;
|
|
142
148
|
expiresAt?: number | null;
|
|
@@ -169,7 +175,10 @@ export interface GrantRequestDto {
|
|
|
169
175
|
roleKey: string | null;
|
|
170
176
|
permissions: string[] | null;
|
|
171
177
|
scopeType: string | null;
|
|
178
|
+
/** The first requested value; `scopeValues` holds every one. */
|
|
172
179
|
scopeValue: string | null;
|
|
180
|
+
/** Every requested value, sorted (ADR-0085); null for a global grant. */
|
|
181
|
+
scopeValues: string[] | null;
|
|
173
182
|
/** The grant's own expiry; null for none. */
|
|
174
183
|
grantExpiresAt: number | null;
|
|
175
184
|
requestedBy: string;
|
|
@@ -313,6 +322,8 @@ export interface ProvisionApiKeyRequest {
|
|
|
313
322
|
scopeType?: string | null;
|
|
314
323
|
/** Opaque, app-owned scope value; null / omitted = global. */
|
|
315
324
|
scopeValue?: string | null;
|
|
325
|
+
/** Several values of `scopeType`, one grant (ADR-0085); XOR `scopeValue`, at most `MAX_GRANT_SCOPE_VALUES`. */
|
|
326
|
+
scopeValues?: string[];
|
|
316
327
|
/** App id (a registered app id); null / omitted = all apps. */
|
|
317
328
|
app?: string | null;
|
|
318
329
|
expiresAt?: number | null;
|