@spinajs/rbac-http 2.0.491 → 2.0.494

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.
@@ -1,3 +1,4 @@
1
+ import './dto/auth-responses.js';
1
2
  export * from './decorators.js';
2
3
  export * from './interfaces.js';
3
4
  export * from './middlewares.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,yBAAyB,CAAC;AAEjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,mCAAmC,CAAC"}
package/lib/cjs/index.js CHANGED
@@ -14,6 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Side-effect import, not `export *`: this module registers the auth response
18
+ // schemas under the interface names the controllers annotate with, and the
19
+ // classes-free registration means there is nothing to re-export. Importing it
20
+ // here is what guarantees the registration has happened by the time the swagger
21
+ // builder asks for those names.
22
+ require("./dto/auth-responses.js");
17
23
  __exportStar(require("./decorators.js"), exports);
18
24
  __exportStar(require("./interfaces.js"), exports);
19
25
  __exportStar(require("./middlewares.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,2DAAyC;AACzC,oDAAkC;AAClC,kDAAgC;AAEhC,2DAAyC;AACzC,2DAAyC;AACzC,6DAA2C;AAC3C,gEAA8C;AAC9C,2DAAyC;AACzC,mEAAiD;AACjD,iEAA+C;AAE/C,oEAAkD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8EAA8E;AAC9E,2EAA2E;AAC3E,8EAA8E;AAC9E,gFAAgF;AAChF,gCAAgC;AAChC,mCAAiC;AAEjC,kDAAgC;AAChC,kDAAgC;AAChC,mDAAiC;AACjC,2DAAyC;AACzC,oDAAkC;AAClC,kDAAgC;AAEhC,2DAAyC;AACzC,2DAAyC;AACzC,6DAA2C;AAC3C,gEAA8C;AAC9C,2DAAyC;AACzC,mEAAiD;AACjD,iEAA+C;AAE/C,oEAAkD"}
@@ -24,10 +24,23 @@ export interface IUserProfile {
24
24
  export interface IUserData extends IUserProfile {
25
25
  Metadata?: IUserMetadataEntry[];
26
26
  }
27
- /** Flattened RBAC grants for a user: resource → action → permission descriptor */
28
- export type IGrantsMap = Record<string, Record<string, {
29
- attributes: string[];
30
- }>>;
27
+ /**
28
+ * Flattened RBAC grants for a user: resource → `'action:possession'` → attributes.
29
+ *
30
+ * This is `accesscontrol`'s own grants format, which is what `_unwindGrants`
31
+ * produces and what a client feeds straight back into `new AccessControl(...)`.
32
+ * The attribute list is a bare `string[]` (`['*']`), NOT a `{ attributes }`
33
+ * wrapper — that wrapper is what this type used to claim, and it described no
34
+ * payload the API has ever sent.
35
+ *
36
+ * `$extend` rides at the same level as the resources when the role inherits from
37
+ * others; its value is the list of inherited role names, so a consumer that
38
+ * treats every key as a resource has to skip it.
39
+ */
40
+ export type IGrantsMap = {
41
+ /** Roles this one inherits from — present only on a role that extends others. */
42
+ $extend?: string[];
43
+ } & Record<string, Record<string, string[]> | string[] | undefined>;
31
44
  /** Successful authentication response — user profile merged with RBAC grants */
32
45
  export interface IUserWithGrants extends IUserProfile {
33
46
  /**
@@ -42,6 +55,25 @@ export interface IActiveRoleResponse {
42
55
  ActiveRole: string;
43
56
  Grants: IGrantsMap;
44
57
  }
58
+ /**
59
+ * Response for GET /auth/whoami — the session's user plus what the session
60
+ * itself knows about it.
61
+ *
62
+ * Not `IUserWithGrants`: whoami resolves no grants, because grants belong to the
63
+ * active role and /auth/active-role is what answers with them.
64
+ */
65
+ export interface IWhoamiResponse extends IUserData {
66
+ /** Role whose grants are in effect for this session. */
67
+ ActiveRole: string;
68
+ /**
69
+ * False while the session has passed the password step but still owes 2FA.
70
+ *
71
+ * Absent on sessions minted before this field existed; those predate 2FA
72
+ * gating and were by definition fully authorized, which is why the endpoint
73
+ * defaults it to true rather than false.
74
+ */
75
+ Authorized: boolean;
76
+ }
45
77
  /** Response for /auth/impersonate when an impersonation has just been started or queried */
46
78
  export interface IImpersonationResponse {
47
79
  /** Target user (whose identity is now in effect) */
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAA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A1CD,sDA0CC;AAED,MAAsB,mBAAmB;CAAG;AAA5C,kDAA4C"}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":";;;AAmMA,MAAsB,qBAAqB;CA0C1C;AA1CD,sDA0CC;AAED,MAAsB,mBAAmB;CAAG;AAA5C,kDAA4C"}
@@ -0,0 +1,374 @@
1
+ /**
2
+ * One metadata row as dehydrated onto the wire.
3
+ *
4
+ * `Value` is a string regardless of `Type`: the column stores text and `Type`
5
+ * says how to read it. A client that wants the decoded value decodes it itself.
6
+ */
7
+ export declare const UserMetadataEntrySchema: {
8
+ $schema: string;
9
+ title: string;
10
+ type: string;
11
+ properties: {
12
+ Id: {
13
+ type: string;
14
+ };
15
+ Key: {
16
+ type: string;
17
+ };
18
+ Type: {
19
+ type: string;
20
+ enum: string[];
21
+ };
22
+ Value: {
23
+ type: string;
24
+ nullable: boolean;
25
+ };
26
+ };
27
+ };
28
+ /** `IUserWithGrants` — the payload a completed login or 2FA verification returns. */
29
+ export declare const UserWithGrantsSchema: {
30
+ $schema: string;
31
+ title: string;
32
+ type: string;
33
+ properties: {
34
+ ActiveRole: {
35
+ type: string;
36
+ description: string;
37
+ };
38
+ Grants: {
39
+ readonly type: "object";
40
+ readonly description: string;
41
+ readonly properties: {
42
+ readonly $extend: {
43
+ readonly type: "array";
44
+ readonly items: {
45
+ readonly type: "string";
46
+ };
47
+ readonly description: "Roles this one inherits from. Sits alongside the resources, and is not one.";
48
+ };
49
+ };
50
+ readonly additionalProperties: {
51
+ readonly type: "object";
52
+ readonly description: "One resource's permissions, keyed 'action:possession' (e.g. 'read:any')";
53
+ readonly additionalProperties: {
54
+ readonly type: "array";
55
+ readonly items: {
56
+ readonly type: "string";
57
+ };
58
+ };
59
+ };
60
+ };
61
+ Uuid: {
62
+ readonly type: "string";
63
+ };
64
+ Email: {
65
+ readonly type: "string";
66
+ readonly format: "email";
67
+ };
68
+ Login: {
69
+ readonly type: "string";
70
+ };
71
+ Role: {
72
+ readonly type: "array";
73
+ readonly items: {
74
+ readonly type: "string";
75
+ };
76
+ readonly description: "Every role assigned to the user — the set /auth/active-role may switch between";
77
+ };
78
+ IsActive: {
79
+ readonly type: "integer";
80
+ readonly description: "1 when the account is active";
81
+ };
82
+ CreatedAt: {
83
+ readonly type: "string";
84
+ readonly format: "date-time";
85
+ };
86
+ RegisteredAt: {
87
+ readonly type: "string";
88
+ readonly format: "date-time";
89
+ readonly nullable: true;
90
+ };
91
+ DeletedAt: {
92
+ readonly type: "string";
93
+ readonly format: "date-time";
94
+ readonly nullable: true;
95
+ };
96
+ LastLoginAt: {
97
+ readonly type: "string";
98
+ readonly format: "date-time";
99
+ readonly nullable: true;
100
+ };
101
+ Metadata: {
102
+ readonly type: "array";
103
+ readonly items: {
104
+ readonly description: "IUserMetadataEntry";
105
+ };
106
+ };
107
+ };
108
+ required: string[];
109
+ };
110
+ /**
111
+ * `ITwoFactorAuthRequired` — password accepted, TOTP still owed.
112
+ *
113
+ * The flag is a plain boolean, not `const: true`. A single-value const becomes a
114
+ * one-member enum in the emitted spec, and an enum inside a `oneOf` arm is what
115
+ * makes generators reach for `Union["TheKey"]` — a key only one arm has. The
116
+ * discriminator is which key is PRESENT, which `required` already states.
117
+ */
118
+ export declare const TwoFactorAuthRequiredSchema: {
119
+ $schema: string;
120
+ title: string;
121
+ type: string;
122
+ properties: {
123
+ TwoFactorAuthRequired: {
124
+ type: string;
125
+ description: string;
126
+ };
127
+ };
128
+ required: string[];
129
+ };
130
+ /** `ITwoFactorInitRequired` — password accepted, enrolment owed before TOTP. */
131
+ export declare const TwoFactorInitRequiredSchema: {
132
+ $schema: string;
133
+ title: string;
134
+ type: string;
135
+ properties: {
136
+ TwoFactorInitRequired: {
137
+ type: string;
138
+ description: string;
139
+ };
140
+ };
141
+ required: string[];
142
+ };
143
+ /**
144
+ * `ILoginResponse` — the three shapes `/auth/login` can answer with.
145
+ *
146
+ * A discriminated union rather than one object with everything optional: the
147
+ * caller branches on which key is present, and a schema that makes all of them
148
+ * optional would validate a response carrying none.
149
+ */
150
+ export declare const LoginResponseSchema: {
151
+ $schema: string;
152
+ title: string;
153
+ oneOf: ({
154
+ $schema: string;
155
+ title: string;
156
+ type: string;
157
+ properties: {
158
+ ActiveRole: {
159
+ type: string;
160
+ description: string;
161
+ };
162
+ Grants: {
163
+ readonly type: "object";
164
+ readonly description: string;
165
+ readonly properties: {
166
+ readonly $extend: {
167
+ readonly type: "array";
168
+ readonly items: {
169
+ readonly type: "string";
170
+ };
171
+ readonly description: "Roles this one inherits from. Sits alongside the resources, and is not one.";
172
+ };
173
+ };
174
+ readonly additionalProperties: {
175
+ readonly type: "object";
176
+ readonly description: "One resource's permissions, keyed 'action:possession' (e.g. 'read:any')";
177
+ readonly additionalProperties: {
178
+ readonly type: "array";
179
+ readonly items: {
180
+ readonly type: "string";
181
+ };
182
+ };
183
+ };
184
+ };
185
+ Uuid: {
186
+ readonly type: "string";
187
+ };
188
+ Email: {
189
+ readonly type: "string";
190
+ readonly format: "email";
191
+ };
192
+ Login: {
193
+ readonly type: "string";
194
+ };
195
+ Role: {
196
+ readonly type: "array";
197
+ readonly items: {
198
+ readonly type: "string";
199
+ };
200
+ readonly description: "Every role assigned to the user — the set /auth/active-role may switch between";
201
+ };
202
+ IsActive: {
203
+ readonly type: "integer";
204
+ readonly description: "1 when the account is active";
205
+ };
206
+ CreatedAt: {
207
+ readonly type: "string";
208
+ readonly format: "date-time";
209
+ };
210
+ RegisteredAt: {
211
+ readonly type: "string";
212
+ readonly format: "date-time";
213
+ readonly nullable: true;
214
+ };
215
+ DeletedAt: {
216
+ readonly type: "string";
217
+ readonly format: "date-time";
218
+ readonly nullable: true;
219
+ };
220
+ LastLoginAt: {
221
+ readonly type: "string";
222
+ readonly format: "date-time";
223
+ readonly nullable: true;
224
+ };
225
+ Metadata: {
226
+ readonly type: "array";
227
+ readonly items: {
228
+ readonly description: "IUserMetadataEntry";
229
+ };
230
+ };
231
+ };
232
+ required: string[];
233
+ } | {
234
+ $schema: string;
235
+ title: string;
236
+ type: string;
237
+ properties: {
238
+ TwoFactorAuthRequired: {
239
+ type: string;
240
+ description: string;
241
+ };
242
+ };
243
+ required: string[];
244
+ } | {
245
+ $schema: string;
246
+ title: string;
247
+ type: string;
248
+ properties: {
249
+ TwoFactorInitRequired: {
250
+ type: string;
251
+ description: string;
252
+ };
253
+ };
254
+ required: string[];
255
+ })[];
256
+ };
257
+ /** `IActiveRoleResponse` — what both `/auth/active-role` operations answer with. */
258
+ export declare const ActiveRoleResponseSchema: {
259
+ $schema: string;
260
+ title: string;
261
+ type: string;
262
+ properties: {
263
+ ActiveRole: {
264
+ type: string;
265
+ description: string;
266
+ };
267
+ Grants: {
268
+ readonly type: "object";
269
+ readonly description: string;
270
+ readonly properties: {
271
+ readonly $extend: {
272
+ readonly type: "array";
273
+ readonly items: {
274
+ readonly type: "string";
275
+ };
276
+ readonly description: "Roles this one inherits from. Sits alongside the resources, and is not one.";
277
+ };
278
+ };
279
+ readonly additionalProperties: {
280
+ readonly type: "object";
281
+ readonly description: "One resource's permissions, keyed 'action:possession' (e.g. 'read:any')";
282
+ readonly additionalProperties: {
283
+ readonly type: "array";
284
+ readonly items: {
285
+ readonly type: "string";
286
+ };
287
+ };
288
+ };
289
+ };
290
+ };
291
+ };
292
+ /**
293
+ * `IWhoamiResponse` — `/auth/whoami`.
294
+ *
295
+ * The user's own columns plus the two fields the session contributes. It is NOT
296
+ * the `User` ORM model, which is what this endpoint used to be documented as:
297
+ * that model knows nothing of `ActiveRole` or `Authorized` — the two fields a
298
+ * client needs most here — and does carry `Password`.
299
+ */
300
+ export declare const WhoamiResponseSchema: {
301
+ $schema: string;
302
+ title: string;
303
+ type: string;
304
+ properties: {
305
+ ActiveRole: {
306
+ type: string;
307
+ description: string;
308
+ };
309
+ Authorized: {
310
+ type: string;
311
+ description: string;
312
+ };
313
+ Uuid: {
314
+ readonly type: "string";
315
+ };
316
+ Email: {
317
+ readonly type: "string";
318
+ readonly format: "email";
319
+ };
320
+ Login: {
321
+ readonly type: "string";
322
+ };
323
+ Role: {
324
+ readonly type: "array";
325
+ readonly items: {
326
+ readonly type: "string";
327
+ };
328
+ readonly description: "Every role assigned to the user — the set /auth/active-role may switch between";
329
+ };
330
+ IsActive: {
331
+ readonly type: "integer";
332
+ readonly description: "1 when the account is active";
333
+ };
334
+ CreatedAt: {
335
+ readonly type: "string";
336
+ readonly format: "date-time";
337
+ };
338
+ RegisteredAt: {
339
+ readonly type: "string";
340
+ readonly format: "date-time";
341
+ readonly nullable: true;
342
+ };
343
+ DeletedAt: {
344
+ readonly type: "string";
345
+ readonly format: "date-time";
346
+ readonly nullable: true;
347
+ };
348
+ LastLoginAt: {
349
+ readonly type: "string";
350
+ readonly format: "date-time";
351
+ readonly nullable: true;
352
+ };
353
+ Metadata: {
354
+ readonly type: "array";
355
+ readonly items: {
356
+ readonly description: "IUserMetadataEntry";
357
+ };
358
+ };
359
+ };
360
+ required: string[];
361
+ };
362
+ /** `IEnable2faResponse` — the OTP provisioning URI from `/auth/2fa/setup`. */
363
+ export declare const Enable2faResponseSchema: {
364
+ $schema: string;
365
+ title: string;
366
+ type: string;
367
+ properties: {
368
+ otp: {
369
+ type: string;
370
+ description: string;
371
+ };
372
+ };
373
+ };
374
+ //# sourceMappingURL=auth-responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-responses.d.ts","sourceRoot":"","sources":["../../../src/dto/auth-responses.ts"],"names":[],"mappings":"AA6CA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;CAanC,CAAC;AA0FF,qFAAqF;AACrF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAahC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;CAWvC,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,2BAA2B;;;;;;;;;;;CAWvC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAO/B,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQpC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBhC,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,uBAAuB;;;;;;;;;;CAUnC,CAAC"}