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 {
5656 // Add resource and methods for this route
5757 const resource = this . addNestedResource ( this . api . root , path ) ;
5858 for ( const method of methods ) {
59- resource . addMethod ( method , new apiGateway . LambdaIntegration ( handler ) ) ;
59+ resource . addMethod ( method . method , new apiGateway . LambdaIntegration ( handler ) ) ;
6060 }
6161 }
6262 }
Original file line number Diff line number Diff line change @@ -16,10 +16,22 @@ export type RestApiConstructProps = {
1616 apiProps : RestApiPathConfig [ ] ;
1717} ;
1818
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+
1930export type RestApiPathConfig = {
2031 path : string ;
21- methods : HttpMethod [ ] ;
32+ methods : MethodsProps [ ] ;
2233 lambdaEntry : LambdaSource ;
34+ defaultAuthorizer ?: AuthorizerConfig ;
2335} ;
2436
2537export type HttpMethod =
You can’t perform that action at this time.
0 commit comments