@@ -453,7 +453,7 @@ describe('#validateServiceProxies()', () => {
453453 )
454454 } )
455455
456- it ( 'should throw if "authorizationType" is not set to "CUSTOM" when the "authorizerId" property is set' , ( ) => {
456+ it ( 'should throw if "authorizationType" is not set to "CUSTOM" or "COGNITO_USER_POOLS" when the "authorizerId" property is set' , ( ) => {
457457 serverlessApigatewayServiceProxy . serverless . service . custom = {
458458 apiGatewayServiceProxies : [
459459 {
@@ -470,7 +470,7 @@ describe('#validateServiceProxies()', () => {
470470
471471 expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . throw (
472472 serverless . classes . Error ,
473- 'child "kinesis" fails because [child "authorizationType" fails because ["authorizationType" must be one of [CUSTOM]]]'
473+ 'child "kinesis" fails because [child "authorizationType" fails because ["authorizationType" must be one of [CUSTOM, COGNITO_USER_POOLS ]]]'
474474 )
475475 } )
476476
@@ -564,6 +564,7 @@ describe('#validateServiceProxies()', () => {
564564 path : '/kinesis' ,
565565 streamName : 'streamName' ,
566566 authorizationType : 'COGNITO_USER_POOLS' ,
567+ authorizerId : { Ref : 'SomeAuthorizerId' } ,
567568 authorizationScopes : [ 'editor' , 'owner' ] ,
568569 method : 'post'
569570 }
@@ -575,6 +576,7 @@ describe('#validateServiceProxies()', () => {
575576
576577 expect ( json . events [ 0 ] . http . auth ) . to . deep . equal ( {
577578 authorizationType : 'COGNITO_USER_POOLS' ,
579+ authorizerId : { Ref : 'SomeAuthorizerId' } ,
578580 authorizationScopes : [ 'editor' , 'owner' ]
579581 } )
580582 } )
0 commit comments