@geekmidas/constructs 0.0.22 → 0.1.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/README.md +90 -0
- package/dist/{AWSLambdaFunction-qWpalqfr.d.mts → AWSLambdaFunction-DCh1tOhB.d.mts} +3 -3
- package/dist/{AWSLambdaSubscriberAdaptor-CWbBNRz3.d.mts → AWSLambdaSubscriberAdaptor-DtNZPMoV.d.mts} +2 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-BQ0IJdaI.d.mts → AmazonApiGatewayEndpointAdaptor-BaTM2TNu.d.mts} +3 -3
- package/dist/{AmazonApiGatewayEndpointAdaptor-DXssXsJi.cjs → AmazonApiGatewayEndpointAdaptor-CPqlw2Rx.cjs} +3 -3
- package/dist/{AmazonApiGatewayEndpointAdaptor-DXssXsJi.cjs.map → AmazonApiGatewayEndpointAdaptor-CPqlw2Rx.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayEndpointAdaptor-CacGag6F.mjs → AmazonApiGatewayEndpointAdaptor-Cm4iD199.mjs} +3 -3
- package/dist/{AmazonApiGatewayEndpointAdaptor-CacGag6F.mjs.map → AmazonApiGatewayEndpointAdaptor-Cm4iD199.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayEndpointAdaptor-Da9BR5On.d.cts → AmazonApiGatewayEndpointAdaptor-TP_hLNAa.d.cts} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-C4_AZ1ek.d.mts → AmazonApiGatewayV1EndpointAdaptor-B2ZpUFiC.d.mts} +4 -4
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-CSm3NsWz.d.cts → AmazonApiGatewayV1EndpointAdaptor-CConfCqz.d.cts} +3 -3
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-BpnG55R7.mjs → AmazonApiGatewayV1EndpointAdaptor-D38HuQa9.mjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-BpnG55R7.mjs.map → AmazonApiGatewayV1EndpointAdaptor-D38HuQa9.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-Df4kszio.cjs → AmazonApiGatewayV1EndpointAdaptor-tjpvLBRb.cjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-Df4kszio.cjs.map → AmazonApiGatewayV1EndpointAdaptor-tjpvLBRb.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-DdM8Tr1X.d.mts → AmazonApiGatewayV2EndpointAdaptor-BwMQInBi.d.mts} +4 -4
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-ZORzMEET.mjs → AmazonApiGatewayV2EndpointAdaptor-ByYtiJtN.mjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-ZORzMEET.mjs.map → AmazonApiGatewayV2EndpointAdaptor-ByYtiJtN.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-5SIvqPby.cjs → AmazonApiGatewayV2EndpointAdaptor-DcJ_w3ro.cjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-5SIvqPby.cjs.map → AmazonApiGatewayV2EndpointAdaptor-DcJ_w3ro.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-6hsBFVLf.d.cts → AmazonApiGatewayV2EndpointAdaptor-DurJvFwa.d.cts} +3 -3
- package/dist/Authorizer-C0ge_tc8.cjs +92 -0
- package/dist/Authorizer-C0ge_tc8.cjs.map +1 -0
- package/dist/Authorizer-CpSUMTIs.d.cts +125 -0
- package/dist/Authorizer-D1w7MpK6.d.mts +125 -0
- package/dist/Authorizer-r9U3y_ms.mjs +68 -0
- package/dist/Authorizer-r9U3y_ms.mjs.map +1 -0
- package/dist/{BaseFunctionBuilder-Ct6zY6Jq.d.mts → BaseFunctionBuilder-Oc2xmxmg.d.mts} +2 -2
- package/dist/{Construct-DDR0295I.d.mts → Construct-DCPATqec.d.mts} +1 -1
- package/dist/Construct.d.mts +1 -1
- package/dist/{Cron-DnMRWPFR.d.mts → Cron-DPEcDCDW.d.mts} +2 -2
- package/dist/{CronBuilder-RLDitFmP.d.mts → CronBuilder-CxKTiepV.d.mts} +4 -4
- package/dist/{Endpoint-D2Imgihs.d.cts → Endpoint-BJPJTGjV.d.cts} +2 -2
- package/dist/{Endpoint-PtQ-wLIS.d.mts → Endpoint-DoY1Owv2.d.mts} +4 -4
- package/dist/{EndpointBuilder-W5fdXxYQ.mjs → EndpointBuilder-69uVrKZL.mjs} +15 -2
- package/dist/EndpointBuilder-69uVrKZL.mjs.map +1 -0
- package/dist/{EndpointBuilder-BPHpUekp.d.mts → EndpointBuilder-BJRkivxQ.d.mts} +6 -5
- package/dist/{EndpointBuilder-CYkeYpsL.cjs → EndpointBuilder-Bhyft7WY.cjs} +15 -2
- package/dist/EndpointBuilder-Bhyft7WY.cjs.map +1 -0
- package/dist/{EndpointBuilder-TApJQhtG.d.cts → EndpointBuilder-CQ-jOXsD.d.cts} +4 -3
- package/dist/{EndpointFactory-B27nfeiE.mjs → EndpointFactory-ARUlRlyM.mjs} +68 -14
- package/dist/EndpointFactory-ARUlRlyM.mjs.map +1 -0
- package/dist/{EndpointFactory-CNlfBDuD.d.mts → EndpointFactory-BKEPcQgE.d.mts} +45 -20
- package/dist/{EndpointFactory-D5lFZXqY.cjs → EndpointFactory-BcVbkrxf.cjs} +68 -14
- package/dist/EndpointFactory-BcVbkrxf.cjs.map +1 -0
- package/dist/{EndpointFactory-B5fOINuc.d.cts → EndpointFactory-DgwmAR_8.d.cts} +45 -20
- package/dist/{Function-CD3rXWfa.d.mts → Function-Dthlh2Fb.d.mts} +2 -2
- package/dist/{FunctionBuilder-j2VkwuGf.d.mts → FunctionBuilder-CZFBLfdV.d.mts} +4 -4
- package/dist/{FunctionExecutionWrapper-B0WP-Vec.d.mts → FunctionExecutionWrapper-CfuajSB5.d.mts} +2 -2
- package/dist/{HonoEndpointAdaptor-Bg_vTyA5.mjs → HonoEndpointAdaptor-BmB4Sc7L.mjs} +3 -3
- package/dist/{HonoEndpointAdaptor-Bg_vTyA5.mjs.map → HonoEndpointAdaptor-BmB4Sc7L.mjs.map} +1 -1
- package/dist/{HonoEndpointAdaptor-B_gJPWGD.cjs → HonoEndpointAdaptor-CnqR6PSB.cjs} +3 -3
- package/dist/{HonoEndpointAdaptor-B_gJPWGD.cjs.map → HonoEndpointAdaptor-CnqR6PSB.cjs.map} +1 -1
- package/dist/{HonoEndpointAdaptor-CLOpobdq.d.cts → HonoEndpointAdaptor-DBjipl6Q.d.mts} +6 -6
- package/dist/{HonoEndpointAdaptor-C9gYYBWu.d.mts → HonoEndpointAdaptor-sSG85VER.d.cts} +8 -8
- package/dist/{Subscriber-itwm7ugy.d.mts → Subscriber-BfxLwZpX.d.mts} +2 -2
- package/dist/{Subscriber-D-FPWts6.cjs → Subscriber-DvOtIyWq.cjs} +1 -1
- package/dist/{Subscriber-D-FPWts6.cjs.map → Subscriber-DvOtIyWq.cjs.map} +1 -1
- package/dist/{Subscriber-CGb8LjZa.mjs → Subscriber-JzcFFi4p.mjs} +1 -1
- package/dist/{Subscriber-CGb8LjZa.mjs.map → Subscriber-JzcFFi4p.mjs.map} +1 -1
- package/dist/{SubscriberBuilder-BfE2cL1q.cjs → SubscriberBuilder-DUuV207i.cjs} +2 -2
- package/dist/{SubscriberBuilder-BfE2cL1q.cjs.map → SubscriberBuilder-DUuV207i.cjs.map} +1 -1
- package/dist/{SubscriberBuilder-9j3JCu8-.d.mts → SubscriberBuilder-lTiTUS1o.d.mts} +2 -2
- package/dist/{SubscriberBuilder-BcAspHv9.mjs → SubscriberBuilder-tm4oVOt3.mjs} +2 -2
- package/dist/{SubscriberBuilder-BcAspHv9.mjs.map → SubscriberBuilder-tm4oVOt3.mjs.map} +1 -1
- package/dist/{TestEndpointAdaptor-Bew9lWsx.cjs → TestEndpointAdaptor-BtLcw4JW.cjs} +3 -3
- package/dist/{TestEndpointAdaptor-Bew9lWsx.cjs.map → TestEndpointAdaptor-BtLcw4JW.cjs.map} +1 -1
- package/dist/{TestEndpointAdaptor-C-c8v7VI.d.mts → TestEndpointAdaptor-CGQVysE0.d.mts} +3 -3
- package/dist/{TestEndpointAdaptor-BYCwwiYk.d.cts → TestEndpointAdaptor-CJO-og9U.d.cts} +2 -2
- package/dist/{TestEndpointAdaptor-JONQJeXc.mjs → TestEndpointAdaptor-o7JbNcL-.mjs} +3 -3
- package/dist/{TestEndpointAdaptor-JONQJeXc.mjs.map → TestEndpointAdaptor-o7JbNcL-.mjs.map} +1 -1
- package/dist/adaptors/aws.cjs +4 -4
- package/dist/adaptors/aws.d.cts +5 -5
- package/dist/adaptors/aws.d.mts +15 -15
- package/dist/adaptors/aws.mjs +4 -4
- package/dist/adaptors/hono.cjs +2 -2
- package/dist/adaptors/hono.d.cts +3 -3
- package/dist/adaptors/hono.d.mts +9 -9
- package/dist/adaptors/hono.mjs +2 -2
- package/dist/adaptors/testing.cjs +2 -2
- package/dist/adaptors/testing.d.cts +3 -3
- package/dist/adaptors/testing.d.mts +9 -9
- package/dist/adaptors/testing.mjs +2 -2
- package/dist/crons/Cron.d.mts +6 -6
- package/dist/crons/CronBuilder.d.mts +7 -7
- package/dist/crons/index.d.cts +4 -4
- package/dist/crons/index.d.mts +7 -7
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.cjs +2 -2
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +9 -9
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.mjs +2 -2
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.cjs +3 -3
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +4 -4
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +10 -10
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.mjs +3 -3
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.cjs +3 -3
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +4 -4
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +10 -10
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.mjs +3 -3
- package/dist/endpoints/Authorizer.cjs +5 -14
- package/dist/endpoints/Authorizer.d.cts +2 -2
- package/dist/endpoints/Authorizer.d.mts +2 -2
- package/dist/endpoints/Authorizer.mjs +2 -13
- package/dist/endpoints/Endpoint.d.cts +2 -2
- package/dist/endpoints/Endpoint.d.mts +8 -8
- package/dist/endpoints/EndpointBuilder.cjs +2 -1
- package/dist/endpoints/EndpointBuilder.d.cts +3 -3
- package/dist/endpoints/EndpointBuilder.d.mts +9 -9
- package/dist/endpoints/EndpointBuilder.mjs +2 -1
- package/dist/endpoints/EndpointFactory.cjs +3 -2
- package/dist/endpoints/EndpointFactory.d.cts +4 -4
- package/dist/endpoints/EndpointFactory.d.mts +10 -10
- package/dist/endpoints/EndpointFactory.mjs +3 -2
- package/dist/endpoints/HonoEndpointAdaptor.cjs +2 -2
- package/dist/endpoints/HonoEndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/HonoEndpointAdaptor.d.mts +9 -9
- package/dist/endpoints/HonoEndpointAdaptor.mjs +2 -2
- package/dist/endpoints/TestEndpointAdaptor.cjs +2 -2
- package/dist/endpoints/TestEndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/TestEndpointAdaptor.d.mts +9 -9
- package/dist/endpoints/TestEndpointAdaptor.mjs +2 -2
- package/dist/endpoints/audit.d.cts +2 -2
- package/dist/endpoints/audit.d.mts +8 -8
- package/dist/endpoints/helpers.d.cts +2 -2
- package/dist/endpoints/helpers.d.mts +8 -8
- package/dist/endpoints/index.cjs +3 -2
- package/dist/endpoints/index.cjs.map +1 -1
- package/dist/endpoints/index.d.cts +6 -6
- package/dist/endpoints/index.d.mts +12 -12
- package/dist/endpoints/index.mjs +3 -2
- package/dist/endpoints/index.mjs.map +1 -1
- package/dist/endpoints/processAudits.cjs +1 -1
- package/dist/endpoints/processAudits.d.cts +24 -5
- package/dist/endpoints/processAudits.d.mts +30 -11
- package/dist/endpoints/processAudits.mjs +1 -1
- package/dist/functions/AWSLambdaFunction.d.mts +4 -4
- package/dist/functions/BaseFunctionBuilder.d.mts +2 -2
- package/dist/functions/Function.d.mts +2 -2
- package/dist/functions/FunctionBuilder.d.mts +4 -4
- package/dist/functions/FunctionExecutionWrapper.d.mts +3 -3
- package/dist/functions/TestFunctionAdaptor.d.mts +2 -2
- package/dist/functions/index.d.mts +5 -5
- package/dist/index-9gJrM7Rw.d.mts +10 -0
- package/dist/index.d.mts +2 -2
- package/dist/{processAudits-BFokHhCO.cjs → processAudits-CzHkPokQ.cjs} +13 -7
- package/dist/processAudits-CzHkPokQ.cjs.map +1 -0
- package/dist/{processAudits-DfcB-X-4.mjs → processAudits-Dj8UGqcW.mjs} +13 -7
- package/dist/processAudits-Dj8UGqcW.mjs.map +1 -0
- package/dist/publisher.d.mts +1 -1
- package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.mts +3 -3
- package/dist/subscribers/Subscriber.cjs +1 -1
- package/dist/subscribers/Subscriber.d.mts +2 -2
- package/dist/subscribers/Subscriber.mjs +1 -1
- package/dist/subscribers/SubscriberBuilder.cjs +2 -2
- package/dist/subscribers/SubscriberBuilder.d.mts +3 -3
- package/dist/subscribers/SubscriberBuilder.mjs +2 -2
- package/dist/subscribers/index.cjs +2 -2
- package/dist/subscribers/index.d.cts +2 -2
- package/dist/subscribers/index.d.mts +5 -5
- package/dist/subscribers/index.mjs +2 -2
- package/dist/{types-DKf0juBf.d.mts → types-Cy1IhmUB.d.mts} +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +5 -5
- package/src/endpoints/AmazonApiGatewayEndpointAdaptor.ts +2 -0
- package/src/endpoints/Authorizer.ts +119 -1
- package/src/endpoints/EndpointBuilder.ts +23 -6
- package/src/endpoints/EndpointFactory.ts +156 -27
- package/src/endpoints/HonoEndpointAdaptor.ts +2 -0
- package/src/endpoints/TestEndpointAdaptor.ts +2 -0
- package/src/endpoints/processAudits.ts +39 -16
- package/dist/Authorizer-BTmly8ps.d.cts +0 -29
- package/dist/Authorizer-pmPvIVgv.d.mts +0 -29
- package/dist/EndpointBuilder-CYkeYpsL.cjs.map +0 -1
- package/dist/EndpointBuilder-W5fdXxYQ.mjs.map +0 -1
- package/dist/EndpointFactory-B27nfeiE.mjs.map +0 -1
- package/dist/EndpointFactory-D5lFZXqY.cjs.map +0 -1
- package/dist/endpoints/Authorizer.cjs.map +0 -1
- package/dist/endpoints/Authorizer.mjs.map +0 -1
- package/dist/index-licEVXjh.d.mts +0 -10
- package/dist/processAudits-BFokHhCO.cjs.map +0 -1
- package/dist/processAudits-DfcB-X-4.mjs.map +0 -1
|
@@ -9,7 +9,11 @@ import { ConsoleLogger } from '@geekmidas/logger/console';
|
|
|
9
9
|
import type { Service } from '@geekmidas/services';
|
|
10
10
|
import uniqBy from 'lodash.uniqby';
|
|
11
11
|
import type { HttpMethod } from '../types';
|
|
12
|
-
import type {
|
|
12
|
+
import type {
|
|
13
|
+
Authorizer,
|
|
14
|
+
BuiltInSecuritySchemeId,
|
|
15
|
+
SecurityScheme,
|
|
16
|
+
} from './Authorizer';
|
|
13
17
|
import type { AuthorizeFn, SessionFn } from './Endpoint';
|
|
14
18
|
import { EndpointBuilder } from './EndpointBuilder';
|
|
15
19
|
import type { ActorExtractor } from './audit';
|
|
@@ -32,6 +36,10 @@ export class EndpointFactory<
|
|
|
32
36
|
> = ExtractStorageAuditAction<NonNullable<TAuditStorage>>,
|
|
33
37
|
TDatabase = undefined,
|
|
34
38
|
TDatabaseServiceName extends string = string,
|
|
39
|
+
TSecuritySchemes extends Record<string, SecurityScheme> = Record<
|
|
40
|
+
string,
|
|
41
|
+
SecurityScheme
|
|
42
|
+
>,
|
|
35
43
|
> {
|
|
36
44
|
// @ts-ignore
|
|
37
45
|
private defaultServices: TServices;
|
|
@@ -56,6 +64,7 @@ export class EndpointFactory<
|
|
|
56
64
|
| Service<TDatabaseServiceName, TDatabase>
|
|
57
65
|
| undefined;
|
|
58
66
|
private defaultActorExtractor?: ActorExtractor<TServices, TSession, TLogger>;
|
|
67
|
+
private customSecuritySchemes: TSecuritySchemes = {} as TSecuritySchemes;
|
|
59
68
|
|
|
60
69
|
constructor({
|
|
61
70
|
basePath,
|
|
@@ -70,6 +79,7 @@ export class EndpointFactory<
|
|
|
70
79
|
defaultAuditorStorage,
|
|
71
80
|
defaultDatabaseService,
|
|
72
81
|
defaultActorExtractor,
|
|
82
|
+
customSecuritySchemes = {} as TSecuritySchemes,
|
|
73
83
|
}: EndpointFactoryOptions<
|
|
74
84
|
TServices,
|
|
75
85
|
TBasePath,
|
|
@@ -81,7 +91,8 @@ export class EndpointFactory<
|
|
|
81
91
|
TAuditStorage,
|
|
82
92
|
TAuditStorageServiceName,
|
|
83
93
|
TDatabase,
|
|
84
|
-
TDatabaseServiceName
|
|
94
|
+
TDatabaseServiceName,
|
|
95
|
+
TSecuritySchemes
|
|
85
96
|
> = {}) {
|
|
86
97
|
// Initialize default services
|
|
87
98
|
this.defaultServices = uniqBy(
|
|
@@ -99,6 +110,7 @@ export class EndpointFactory<
|
|
|
99
110
|
this.defaultAuditorStorage = defaultAuditorStorage;
|
|
100
111
|
this.defaultDatabaseService = defaultDatabaseService;
|
|
101
112
|
this.defaultActorExtractor = defaultActorExtractor;
|
|
113
|
+
this.customSecuritySchemes = customSecuritySchemes;
|
|
102
114
|
}
|
|
103
115
|
|
|
104
116
|
static joinPaths<TBasePath extends string, P extends string>(
|
|
@@ -153,7 +165,8 @@ export class EndpointFactory<
|
|
|
153
165
|
TAuditStorageServiceName,
|
|
154
166
|
TAuditAction,
|
|
155
167
|
TDatabase,
|
|
156
|
-
TDatabaseServiceName
|
|
168
|
+
TDatabaseServiceName,
|
|
169
|
+
TSecuritySchemes
|
|
157
170
|
> {
|
|
158
171
|
const authorizerConfigs = authorizers.map((name) => ({
|
|
159
172
|
name,
|
|
@@ -170,7 +183,8 @@ export class EndpointFactory<
|
|
|
170
183
|
TAuditStorageServiceName,
|
|
171
184
|
TAuditAction,
|
|
172
185
|
TDatabase,
|
|
173
|
-
TDatabaseServiceName
|
|
186
|
+
TDatabaseServiceName,
|
|
187
|
+
TSecuritySchemes
|
|
174
188
|
>({
|
|
175
189
|
defaultServices: this.defaultServices,
|
|
176
190
|
basePath: this.basePath,
|
|
@@ -183,6 +197,73 @@ export class EndpointFactory<
|
|
|
183
197
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
184
198
|
defaultDatabaseService: this.defaultDatabaseService,
|
|
185
199
|
defaultActorExtractor: this.defaultActorExtractor,
|
|
200
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Define custom security schemes for this factory.
|
|
206
|
+
* These extend the built-in schemes (jwt, bearer, apiKey, oauth2, oidc).
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* const router = e.securitySchemes({
|
|
211
|
+
* awsIamSigV4: {
|
|
212
|
+
* type: 'apiKey',
|
|
213
|
+
* in: 'header',
|
|
214
|
+
* name: 'Authorization',
|
|
215
|
+
* 'x-amazon-apigateway-authtype': 'awsSigv4',
|
|
216
|
+
* },
|
|
217
|
+
* });
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
securitySchemes<T extends Record<string, SecurityScheme>>(
|
|
221
|
+
schemes: T,
|
|
222
|
+
): EndpointFactory<
|
|
223
|
+
TServices,
|
|
224
|
+
TBasePath,
|
|
225
|
+
TLogger,
|
|
226
|
+
TSession,
|
|
227
|
+
TEventPublisher,
|
|
228
|
+
TEventPublisherServiceName,
|
|
229
|
+
TAuthorizers,
|
|
230
|
+
TAuditStorage,
|
|
231
|
+
TAuditStorageServiceName,
|
|
232
|
+
TAuditAction,
|
|
233
|
+
TDatabase,
|
|
234
|
+
TDatabaseServiceName,
|
|
235
|
+
TSecuritySchemes & T
|
|
236
|
+
> {
|
|
237
|
+
return new EndpointFactory<
|
|
238
|
+
TServices,
|
|
239
|
+
TBasePath,
|
|
240
|
+
TLogger,
|
|
241
|
+
TSession,
|
|
242
|
+
TEventPublisher,
|
|
243
|
+
TEventPublisherServiceName,
|
|
244
|
+
TAuthorizers,
|
|
245
|
+
TAuditStorage,
|
|
246
|
+
TAuditStorageServiceName,
|
|
247
|
+
TAuditAction,
|
|
248
|
+
TDatabase,
|
|
249
|
+
TDatabaseServiceName,
|
|
250
|
+
TSecuritySchemes & T
|
|
251
|
+
>({
|
|
252
|
+
defaultServices: this.defaultServices,
|
|
253
|
+
basePath: this.basePath,
|
|
254
|
+
defaultAuthorizeFn: this.defaultAuthorizeFn,
|
|
255
|
+
defaultLogger: this.defaultLogger,
|
|
256
|
+
defaultSessionExtractor: this.defaultSessionExtractor,
|
|
257
|
+
defaultEventPublisher: this.defaultEventPublisher,
|
|
258
|
+
availableAuthorizers: this.availableAuthorizers,
|
|
259
|
+
defaultAuthorizerName: this.defaultAuthorizerName,
|
|
260
|
+
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
261
|
+
defaultDatabaseService: this.defaultDatabaseService,
|
|
262
|
+
defaultActorExtractor: this.defaultActorExtractor,
|
|
263
|
+
customSecuritySchemes: {
|
|
264
|
+
...this.customSecuritySchemes,
|
|
265
|
+
...schemes,
|
|
266
|
+
} as TSecuritySchemes & T,
|
|
186
267
|
});
|
|
187
268
|
}
|
|
188
269
|
|
|
@@ -190,9 +271,18 @@ export class EndpointFactory<
|
|
|
190
271
|
* Set the default authorizer for all endpoints created from this factory.
|
|
191
272
|
* Individual endpoints can override this by calling `.authorizer()` on the builder.
|
|
192
273
|
* Use `'none'` to explicitly disable authorization for all endpoints.
|
|
274
|
+
*
|
|
275
|
+
* Accepts:
|
|
276
|
+
* - Built-in security scheme names: 'jwt', 'bearer', 'apiKey', 'oauth2', 'oidc'
|
|
277
|
+
* - Custom security scheme names defined via `.securitySchemes()`
|
|
278
|
+
* - 'none' to disable authorization
|
|
193
279
|
*/
|
|
194
280
|
authorizer(
|
|
195
|
-
name:
|
|
281
|
+
name:
|
|
282
|
+
| BuiltInSecuritySchemeId
|
|
283
|
+
| keyof TSecuritySchemes
|
|
284
|
+
| TAuthorizers[number]
|
|
285
|
+
| 'none',
|
|
196
286
|
): EndpointFactory<
|
|
197
287
|
TServices,
|
|
198
288
|
TBasePath,
|
|
@@ -205,9 +295,10 @@ export class EndpointFactory<
|
|
|
205
295
|
TAuditStorageServiceName,
|
|
206
296
|
TAuditAction,
|
|
207
297
|
TDatabase,
|
|
208
|
-
TDatabaseServiceName
|
|
298
|
+
TDatabaseServiceName,
|
|
299
|
+
TSecuritySchemes
|
|
209
300
|
> {
|
|
210
|
-
// Validate that the authorizer exists in available authorizers
|
|
301
|
+
// Validate that the authorizer exists in available authorizers (if authorizers() was called)
|
|
211
302
|
if (name !== 'none' && this.availableAuthorizers.length > 0) {
|
|
212
303
|
const authorizerExists = this.availableAuthorizers.some(
|
|
213
304
|
(a) => a.name === name,
|
|
@@ -234,7 +325,8 @@ export class EndpointFactory<
|
|
|
234
325
|
TAuditStorageServiceName,
|
|
235
326
|
TAuditAction,
|
|
236
327
|
TDatabase,
|
|
237
|
-
TDatabaseServiceName
|
|
328
|
+
TDatabaseServiceName,
|
|
329
|
+
TSecuritySchemes
|
|
238
330
|
>({
|
|
239
331
|
defaultServices: this.defaultServices,
|
|
240
332
|
basePath: this.basePath,
|
|
@@ -243,10 +335,12 @@ export class EndpointFactory<
|
|
|
243
335
|
defaultSessionExtractor: this.defaultSessionExtractor,
|
|
244
336
|
defaultEventPublisher: this.defaultEventPublisher,
|
|
245
337
|
availableAuthorizers: this.availableAuthorizers,
|
|
246
|
-
defaultAuthorizerName:
|
|
338
|
+
defaultAuthorizerName:
|
|
339
|
+
name === 'none' ? undefined : (name as TAuthorizers[number]),
|
|
247
340
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
248
341
|
defaultDatabaseService: this.defaultDatabaseService,
|
|
249
342
|
defaultActorExtractor: this.defaultActorExtractor,
|
|
343
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
250
344
|
});
|
|
251
345
|
}
|
|
252
346
|
|
|
@@ -265,7 +359,8 @@ export class EndpointFactory<
|
|
|
265
359
|
TAuditStorageServiceName,
|
|
266
360
|
TAuditAction,
|
|
267
361
|
TDatabase,
|
|
268
|
-
TDatabaseServiceName
|
|
362
|
+
TDatabaseServiceName,
|
|
363
|
+
TSecuritySchemes
|
|
269
364
|
> {
|
|
270
365
|
const newBasePath = EndpointFactory.joinPaths(path, this.basePath);
|
|
271
366
|
return new EndpointFactory<
|
|
@@ -280,7 +375,8 @@ export class EndpointFactory<
|
|
|
280
375
|
TAuditStorageServiceName,
|
|
281
376
|
TAuditAction,
|
|
282
377
|
TDatabase,
|
|
283
|
-
TDatabaseServiceName
|
|
378
|
+
TDatabaseServiceName,
|
|
379
|
+
TSecuritySchemes
|
|
284
380
|
>({
|
|
285
381
|
defaultServices: this.defaultServices,
|
|
286
382
|
basePath: newBasePath,
|
|
@@ -293,6 +389,7 @@ export class EndpointFactory<
|
|
|
293
389
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
294
390
|
defaultDatabaseService: this.defaultDatabaseService,
|
|
295
391
|
defaultActorExtractor: this.defaultActorExtractor,
|
|
392
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
296
393
|
});
|
|
297
394
|
}
|
|
298
395
|
|
|
@@ -311,7 +408,8 @@ export class EndpointFactory<
|
|
|
311
408
|
TAuditStorageServiceName,
|
|
312
409
|
TAuditAction,
|
|
313
410
|
TDatabase,
|
|
314
|
-
TDatabaseServiceName
|
|
411
|
+
TDatabaseServiceName,
|
|
412
|
+
TSecuritySchemes
|
|
315
413
|
> {
|
|
316
414
|
return new EndpointFactory<
|
|
317
415
|
TServices,
|
|
@@ -325,7 +423,8 @@ export class EndpointFactory<
|
|
|
325
423
|
TAuditStorageServiceName,
|
|
326
424
|
TAuditAction,
|
|
327
425
|
TDatabase,
|
|
328
|
-
TDatabaseServiceName
|
|
426
|
+
TDatabaseServiceName,
|
|
427
|
+
TSecuritySchemes
|
|
329
428
|
>({
|
|
330
429
|
defaultServices: this.defaultServices,
|
|
331
430
|
basePath: this.basePath,
|
|
@@ -338,6 +437,7 @@ export class EndpointFactory<
|
|
|
338
437
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
339
438
|
defaultDatabaseService: this.defaultDatabaseService,
|
|
340
439
|
defaultActorExtractor: this.defaultActorExtractor,
|
|
440
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
341
441
|
});
|
|
342
442
|
}
|
|
343
443
|
|
|
@@ -356,7 +456,8 @@ export class EndpointFactory<
|
|
|
356
456
|
TAuditStorageServiceName,
|
|
357
457
|
TAuditAction,
|
|
358
458
|
TDatabase,
|
|
359
|
-
TDatabaseServiceName
|
|
459
|
+
TDatabaseServiceName,
|
|
460
|
+
TSecuritySchemes
|
|
360
461
|
> {
|
|
361
462
|
return new EndpointFactory<
|
|
362
463
|
[...S, ...TServices],
|
|
@@ -370,7 +471,8 @@ export class EndpointFactory<
|
|
|
370
471
|
TAuditStorageServiceName,
|
|
371
472
|
TAuditAction,
|
|
372
473
|
TDatabase,
|
|
373
|
-
TDatabaseServiceName
|
|
474
|
+
TDatabaseServiceName,
|
|
475
|
+
TSecuritySchemes
|
|
374
476
|
>({
|
|
375
477
|
defaultServices: [...services, ...this.defaultServices],
|
|
376
478
|
basePath: this.basePath,
|
|
@@ -383,6 +485,7 @@ export class EndpointFactory<
|
|
|
383
485
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
384
486
|
defaultDatabaseService: this.defaultDatabaseService,
|
|
385
487
|
defaultActorExtractor: this.defaultActorExtractor,
|
|
488
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
386
489
|
});
|
|
387
490
|
}
|
|
388
491
|
|
|
@@ -400,7 +503,8 @@ export class EndpointFactory<
|
|
|
400
503
|
TAuditStorageServiceName,
|
|
401
504
|
TAuditAction,
|
|
402
505
|
TDatabase,
|
|
403
|
-
TDatabaseServiceName
|
|
506
|
+
TDatabaseServiceName,
|
|
507
|
+
TSecuritySchemes
|
|
404
508
|
> {
|
|
405
509
|
return new EndpointFactory<
|
|
406
510
|
TServices,
|
|
@@ -414,7 +518,8 @@ export class EndpointFactory<
|
|
|
414
518
|
TAuditStorageServiceName,
|
|
415
519
|
TAuditAction,
|
|
416
520
|
TDatabase,
|
|
417
|
-
TDatabaseServiceName
|
|
521
|
+
TDatabaseServiceName,
|
|
522
|
+
TSecuritySchemes
|
|
418
523
|
>({
|
|
419
524
|
defaultServices: this.defaultServices,
|
|
420
525
|
basePath: this.basePath,
|
|
@@ -441,6 +546,7 @@ export class EndpointFactory<
|
|
|
441
546
|
TSession,
|
|
442
547
|
L
|
|
443
548
|
>,
|
|
549
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
444
550
|
});
|
|
445
551
|
}
|
|
446
552
|
|
|
@@ -461,7 +567,8 @@ export class EndpointFactory<
|
|
|
461
567
|
TAuditStorageServiceName,
|
|
462
568
|
TAuditAction,
|
|
463
569
|
TDatabase,
|
|
464
|
-
TDatabaseServiceName
|
|
570
|
+
TDatabaseServiceName,
|
|
571
|
+
TSecuritySchemes
|
|
465
572
|
> {
|
|
466
573
|
return new EndpointFactory<
|
|
467
574
|
TServices,
|
|
@@ -475,7 +582,8 @@ export class EndpointFactory<
|
|
|
475
582
|
TAuditStorageServiceName,
|
|
476
583
|
TAuditAction,
|
|
477
584
|
TDatabase,
|
|
478
|
-
TDatabaseServiceName
|
|
585
|
+
TDatabaseServiceName,
|
|
586
|
+
TSecuritySchemes
|
|
479
587
|
>({
|
|
480
588
|
defaultServices: this.defaultServices,
|
|
481
589
|
basePath: this.basePath,
|
|
@@ -488,6 +596,7 @@ export class EndpointFactory<
|
|
|
488
596
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
489
597
|
defaultDatabaseService: this.defaultDatabaseService,
|
|
490
598
|
defaultActorExtractor: this.defaultActorExtractor,
|
|
599
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
491
600
|
});
|
|
492
601
|
}
|
|
493
602
|
|
|
@@ -505,7 +614,8 @@ export class EndpointFactory<
|
|
|
505
614
|
TAuditStorageServiceName,
|
|
506
615
|
TAuditAction,
|
|
507
616
|
TDatabase,
|
|
508
|
-
TDatabaseServiceName
|
|
617
|
+
TDatabaseServiceName,
|
|
618
|
+
TSecuritySchemes
|
|
509
619
|
> {
|
|
510
620
|
return new EndpointFactory<
|
|
511
621
|
TServices,
|
|
@@ -519,7 +629,8 @@ export class EndpointFactory<
|
|
|
519
629
|
TAuditStorageServiceName,
|
|
520
630
|
TAuditAction,
|
|
521
631
|
TDatabase,
|
|
522
|
-
TDatabaseServiceName
|
|
632
|
+
TDatabaseServiceName,
|
|
633
|
+
TSecuritySchemes
|
|
523
634
|
>({
|
|
524
635
|
defaultServices: this.defaultServices,
|
|
525
636
|
basePath: this.basePath,
|
|
@@ -541,6 +652,7 @@ export class EndpointFactory<
|
|
|
541
652
|
T,
|
|
542
653
|
TLogger
|
|
543
654
|
>,
|
|
655
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
544
656
|
});
|
|
545
657
|
}
|
|
546
658
|
|
|
@@ -562,7 +674,8 @@ export class EndpointFactory<
|
|
|
562
674
|
TAuditStorageServiceName,
|
|
563
675
|
TAuditAction,
|
|
564
676
|
T,
|
|
565
|
-
TName
|
|
677
|
+
TName,
|
|
678
|
+
TSecuritySchemes
|
|
566
679
|
> {
|
|
567
680
|
return new EndpointFactory<
|
|
568
681
|
TServices,
|
|
@@ -576,7 +689,8 @@ export class EndpointFactory<
|
|
|
576
689
|
TAuditStorageServiceName,
|
|
577
690
|
TAuditAction,
|
|
578
691
|
T,
|
|
579
|
-
TName
|
|
692
|
+
TName,
|
|
693
|
+
TSecuritySchemes
|
|
580
694
|
>({
|
|
581
695
|
defaultServices: this.defaultServices,
|
|
582
696
|
basePath: this.basePath,
|
|
@@ -592,6 +706,7 @@ export class EndpointFactory<
|
|
|
592
706
|
defaultAuthorizerName: this.defaultAuthorizerName,
|
|
593
707
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
594
708
|
defaultDatabaseService: service,
|
|
709
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
595
710
|
});
|
|
596
711
|
}
|
|
597
712
|
|
|
@@ -614,7 +729,8 @@ export class EndpointFactory<
|
|
|
614
729
|
TName,
|
|
615
730
|
ExtractStorageAuditAction<T>,
|
|
616
731
|
TDatabase,
|
|
617
|
-
TDatabaseServiceName
|
|
732
|
+
TDatabaseServiceName,
|
|
733
|
+
TSecuritySchemes
|
|
618
734
|
> {
|
|
619
735
|
return new EndpointFactory<
|
|
620
736
|
TServices,
|
|
@@ -628,7 +744,8 @@ export class EndpointFactory<
|
|
|
628
744
|
TName,
|
|
629
745
|
ExtractStorageAuditAction<T>,
|
|
630
746
|
TDatabase,
|
|
631
|
-
TDatabaseServiceName
|
|
747
|
+
TDatabaseServiceName,
|
|
748
|
+
TSecuritySchemes
|
|
632
749
|
>({
|
|
633
750
|
defaultServices: this.defaultServices,
|
|
634
751
|
basePath: this.basePath,
|
|
@@ -646,6 +763,7 @@ export class EndpointFactory<
|
|
|
646
763
|
TSession,
|
|
647
764
|
TLogger
|
|
648
765
|
>,
|
|
766
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
649
767
|
});
|
|
650
768
|
}
|
|
651
769
|
|
|
@@ -667,7 +785,8 @@ export class EndpointFactory<
|
|
|
667
785
|
TAuditStorageServiceName,
|
|
668
786
|
TAuditAction,
|
|
669
787
|
TDatabase,
|
|
670
|
-
TDatabaseServiceName
|
|
788
|
+
TDatabaseServiceName,
|
|
789
|
+
TSecuritySchemes
|
|
671
790
|
> {
|
|
672
791
|
return new EndpointFactory<
|
|
673
792
|
TServices,
|
|
@@ -681,7 +800,8 @@ export class EndpointFactory<
|
|
|
681
800
|
TAuditStorageServiceName,
|
|
682
801
|
TAuditAction,
|
|
683
802
|
TDatabase,
|
|
684
|
-
TDatabaseServiceName
|
|
803
|
+
TDatabaseServiceName,
|
|
804
|
+
TSecuritySchemes
|
|
685
805
|
>({
|
|
686
806
|
defaultServices: this.defaultServices,
|
|
687
807
|
basePath: this.basePath,
|
|
@@ -694,6 +814,7 @@ export class EndpointFactory<
|
|
|
694
814
|
defaultAuditorStorage: this.defaultAuditorStorage,
|
|
695
815
|
defaultDatabaseService: this.defaultDatabaseService,
|
|
696
816
|
defaultActorExtractor: extractor,
|
|
817
|
+
customSecuritySchemes: this.customSecuritySchemes,
|
|
697
818
|
});
|
|
698
819
|
}
|
|
699
820
|
|
|
@@ -782,6 +903,9 @@ export class EndpointFactory<
|
|
|
782
903
|
builder._actorExtractor = this.defaultActorExtractor;
|
|
783
904
|
}
|
|
784
905
|
|
|
906
|
+
// Set custom security schemes
|
|
907
|
+
builder._customSecuritySchemes = this.customSecuritySchemes;
|
|
908
|
+
|
|
785
909
|
return builder;
|
|
786
910
|
}
|
|
787
911
|
|
|
@@ -849,6 +973,10 @@ export interface EndpointFactoryOptions<
|
|
|
849
973
|
TAuditStorageServiceName extends string = string,
|
|
850
974
|
TDatabase = undefined,
|
|
851
975
|
TDatabaseServiceName extends string = string,
|
|
976
|
+
TSecuritySchemes extends Record<string, SecurityScheme> = Record<
|
|
977
|
+
string,
|
|
978
|
+
SecurityScheme
|
|
979
|
+
>,
|
|
852
980
|
> {
|
|
853
981
|
defaultServices?: TServices;
|
|
854
982
|
basePath?: TBasePath;
|
|
@@ -862,6 +990,7 @@ export interface EndpointFactoryOptions<
|
|
|
862
990
|
defaultAuditorStorage?: Service<TAuditStorageServiceName, TAuditStorage>;
|
|
863
991
|
defaultDatabaseService?: Service<TDatabaseServiceName, TDatabase>;
|
|
864
992
|
defaultActorExtractor?: ActorExtractor<TServices, TSession, TLogger>;
|
|
993
|
+
customSecuritySchemes?: TSecuritySchemes;
|
|
865
994
|
}
|
|
866
995
|
|
|
867
996
|
export const e = new EndpointFactory();
|
|
@@ -5,7 +5,6 @@ import type {
|
|
|
5
5
|
Auditor,
|
|
6
6
|
} from '@geekmidas/audit';
|
|
7
7
|
import { DefaultAuditor } from '@geekmidas/audit';
|
|
8
|
-
import { withAuditableTransaction } from '@geekmidas/audit/kysely';
|
|
9
8
|
import type { Logger } from '@geekmidas/logger';
|
|
10
9
|
import type { InferStandardSchema } from '@geekmidas/schema';
|
|
11
10
|
import type { Service, ServiceDiscovery } from '@geekmidas/services';
|
|
@@ -288,14 +287,34 @@ export async function createAuditContext<
|
|
|
288
287
|
return { auditor, storage };
|
|
289
288
|
}
|
|
290
289
|
|
|
290
|
+
/**
|
|
291
|
+
* Options for executeWithAuditTransaction.
|
|
292
|
+
*/
|
|
293
|
+
export interface ExecuteWithAuditTransactionOptions {
|
|
294
|
+
/**
|
|
295
|
+
* Database connection to use for the transaction.
|
|
296
|
+
* If this is already a transaction, it will be reused instead of creating a nested one.
|
|
297
|
+
* If not provided, the storage's internal database is used.
|
|
298
|
+
*/
|
|
299
|
+
db?: unknown;
|
|
300
|
+
}
|
|
301
|
+
|
|
291
302
|
/**
|
|
292
303
|
* Execute a handler with automatic audit transaction support.
|
|
293
|
-
* If the audit storage
|
|
304
|
+
* If the audit storage provides a withTransaction method, wraps execution
|
|
294
305
|
* in a transaction so audits are atomic with handler's database operations.
|
|
295
306
|
*
|
|
307
|
+
* This is database-agnostic - each storage implementation provides its own
|
|
308
|
+
* transaction handling based on the underlying database (Kysely, Drizzle, etc.).
|
|
309
|
+
*
|
|
310
|
+
* If the db parameter is provided and is already a transaction, the storage
|
|
311
|
+
* will reuse it instead of creating a nested transaction (similar to
|
|
312
|
+
* packages/db/src/kysely.ts#withTransaction).
|
|
313
|
+
*
|
|
296
314
|
* @param auditContext - The audit context from createAuditContext
|
|
297
315
|
* @param handler - The handler function to execute (receives auditor)
|
|
298
316
|
* @param onComplete - Called after handler with response, to process declarative audits
|
|
317
|
+
* @param options - Optional configuration including database connection
|
|
299
318
|
* @returns The handler result
|
|
300
319
|
*/
|
|
301
320
|
export async function executeWithAuditTransaction<
|
|
@@ -308,6 +327,7 @@ export async function executeWithAuditTransaction<
|
|
|
308
327
|
auditContext: AuditExecutionContext<TAuditAction> | undefined,
|
|
309
328
|
handler: (auditor?: Auditor<TAuditAction>) => Promise<T>,
|
|
310
329
|
onComplete?: (response: T, auditor: Auditor<TAuditAction>) => Promise<void>,
|
|
330
|
+
options?: ExecuteWithAuditTransactionOptions,
|
|
311
331
|
): Promise<T> {
|
|
312
332
|
// No audit context - just run handler
|
|
313
333
|
if (!auditContext) {
|
|
@@ -316,25 +336,28 @@ export async function executeWithAuditTransaction<
|
|
|
316
336
|
|
|
317
337
|
const { auditor, storage } = auditContext;
|
|
318
338
|
|
|
319
|
-
// Check if storage
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if (db) {
|
|
339
|
+
// Check if storage provides a transaction wrapper
|
|
340
|
+
if (storage.withTransaction) {
|
|
323
341
|
// Wrap in transaction - audits are atomic with handler operations
|
|
324
|
-
|
|
325
|
-
|
|
342
|
+
// The storage's withTransaction handles setTransaction and flush
|
|
343
|
+
// Pass db so existing transactions are reused
|
|
344
|
+
return storage.withTransaction(
|
|
345
|
+
auditor,
|
|
346
|
+
async () => {
|
|
347
|
+
const response = await handler(auditor);
|
|
326
348
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
349
|
+
// Process declarative audits within the transaction
|
|
350
|
+
if (onComplete) {
|
|
351
|
+
await onComplete(response, auditor);
|
|
352
|
+
}
|
|
331
353
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
354
|
+
return response;
|
|
355
|
+
},
|
|
356
|
+
options?.db,
|
|
357
|
+
);
|
|
335
358
|
}
|
|
336
359
|
|
|
337
|
-
// No
|
|
360
|
+
// No transaction support - run handler and flush audits after
|
|
338
361
|
const response = await handler(auditor);
|
|
339
362
|
|
|
340
363
|
if (onComplete) {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region src/endpoints/Authorizer.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Represents an authorizer configuration for endpoints
|
|
4
|
-
*/
|
|
5
|
-
interface Authorizer {
|
|
6
|
-
/**
|
|
7
|
-
* Unique identifier for the authorizer
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* Type of authorizer (e.g., 'iam', 'jwt', 'custom')
|
|
12
|
-
*/
|
|
13
|
-
type?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Description of what this authorizer does
|
|
16
|
-
*/
|
|
17
|
-
description?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Additional metadata specific to the authorizer type
|
|
20
|
-
*/
|
|
21
|
-
metadata?: Record<string, any>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Helper to create an authorizer configuration
|
|
25
|
-
*/
|
|
26
|
-
declare function createAuthorizer(name: string, options?: Omit<Authorizer, 'name'>): Authorizer;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { Authorizer, createAuthorizer };
|
|
29
|
-
//# sourceMappingURL=Authorizer-BTmly8ps.d.cts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region src/endpoints/Authorizer.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Represents an authorizer configuration for endpoints
|
|
4
|
-
*/
|
|
5
|
-
interface Authorizer {
|
|
6
|
-
/**
|
|
7
|
-
* Unique identifier for the authorizer
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* Type of authorizer (e.g., 'iam', 'jwt', 'custom')
|
|
12
|
-
*/
|
|
13
|
-
type?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Description of what this authorizer does
|
|
16
|
-
*/
|
|
17
|
-
description?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Additional metadata specific to the authorizer type
|
|
20
|
-
*/
|
|
21
|
-
metadata?: Record<string, any>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Helper to create an authorizer configuration
|
|
25
|
-
*/
|
|
26
|
-
declare function createAuthorizer(name: string, options?: Omit<Authorizer, 'name'>): Authorizer;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { Authorizer, createAuthorizer };
|
|
29
|
-
//# sourceMappingURL=Authorizer-pmPvIVgv.d.mts.map
|