File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
packages/rest-api-construct/src Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export class RestApiConstruct extends Construct {
56
56
// Add resource and methods for this route
57
57
const resource = this . addNestedResource ( this . api . root , path ) ;
58
58
for ( const method of methods ) {
59
- resource . addMethod ( method , new apiGateway . LambdaIntegration ( handler ) ) ;
59
+ resource . addMethod ( method . method , new apiGateway . LambdaIntegration ( handler ) ) ;
60
60
}
61
61
}
62
62
}
Original file line number Diff line number Diff line change @@ -16,10 +16,22 @@ export type RestApiConstructProps = {
16
16
apiProps : RestApiPathConfig [ ] ;
17
17
} ;
18
18
19
+ export type AuthorizerConfig =
20
+ | { type : 'none' } // public
21
+ | { type : 'userPool' } // signed-in users
22
+ | { type : 'userPool' ; groups : string [ ] } ; // signed-in + group restriction
23
+
24
+
25
+ export type MethodsProps = {
26
+ method : HttpMethod ;
27
+ authorizer ?: AuthorizerConfig ;
28
+ } ;
29
+
19
30
export type RestApiPathConfig = {
20
31
path : string ;
21
- methods : HttpMethod [ ] ;
32
+ methods : MethodsProps [ ] ;
22
33
lambdaEntry : LambdaSource ;
34
+ defaultAuthorizer ?: AuthorizerConfig ;
23
35
} ;
24
36
25
37
export type HttpMethod =
You can’t perform that action at this time.
0 commit comments