@@ -453,7 +453,7 @@ describe('#validateServiceProxies()', () => {
453
453
)
454
454
} )
455
455
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' , ( ) => {
457
457
serverlessApigatewayServiceProxy . serverless . service . custom = {
458
458
apiGatewayServiceProxies : [
459
459
{
@@ -470,7 +470,7 @@ describe('#validateServiceProxies()', () => {
470
470
471
471
expect ( ( ) => serverlessApigatewayServiceProxy . validateServiceProxies ( ) ) . to . throw (
472
472
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 ]]]'
474
474
)
475
475
} )
476
476
@@ -564,6 +564,7 @@ describe('#validateServiceProxies()', () => {
564
564
path : '/kinesis' ,
565
565
streamName : 'streamName' ,
566
566
authorizationType : 'COGNITO_USER_POOLS' ,
567
+ authorizerId : { Ref : 'SomeAuthorizerId' } ,
567
568
authorizationScopes : [ 'editor' , 'owner' ] ,
568
569
method : 'post'
569
570
}
@@ -575,6 +576,7 @@ describe('#validateServiceProxies()', () => {
575
576
576
577
expect ( json . events [ 0 ] . http . auth ) . to . deep . equal ( {
577
578
authorizationType : 'COGNITO_USER_POOLS' ,
579
+ authorizerId : { Ref : 'SomeAuthorizerId' } ,
578
580
authorizationScopes : [ 'editor' , 'owner' ]
579
581
} )
580
582
} )
0 commit comments