sls-helper-plugin-janis
Advanced tools
Comparing version 2.4.1 to 2.5.0
@@ -9,2 +9,9 @@ # Changelog | ||
## [2.5.0] - 2020-02-21 | ||
### Added | ||
- API Gateway response `AUTHORIZER_CONFIGURATION_ERROR` | ||
### Fixed | ||
- API Gateway responses are not overriden any more | ||
## [2.4.1] - 2020-02-20 | ||
@@ -11,0 +18,0 @@ ### Fixed |
@@ -147,79 +147,94 @@ 'use strict'; | ||
], | ||
resources: [ | ||
{ | ||
Resources: { | ||
resources: { | ||
Resources: { | ||
unauthorizedResponse: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString}' | ||
}, | ||
ResponseType: 'UNAUTHORIZED', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '401' | ||
} | ||
}, | ||
UnauthorizedResponse: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString}' | ||
}, | ||
ResponseType: 'UNAUTHORIZED', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '401' | ||
} | ||
}, | ||
badRequestBodyResponse: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString,"validationError":"$context.error.validationErrorString"}' | ||
}, | ||
ResponseType: 'BAD_REQUEST_BODY', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '400' | ||
} | ||
}, | ||
BadRequestBodyResponse: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString,"validationError":"$context.error.validationErrorString"}' | ||
}, | ||
ResponseType: 'BAD_REQUEST_BODY', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '400' | ||
} | ||
}, | ||
badRequestParameters: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString,"validationError":"$context.error.validationErrorString"}' | ||
}, | ||
ResponseType: 'BAD_REQUEST_PARAMETERS', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '400' | ||
} | ||
}, | ||
BadRequestParameters: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString,"validationError":"$context.error.validationErrorString"}' | ||
}, | ||
ResponseType: 'BAD_REQUEST_PARAMETERS', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '400' | ||
} | ||
}, | ||
accessDeniedResponse: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString,"validationError":"$context.error.validationErrorString"}' | ||
}, | ||
ResponseType: 'ACCESS_DENIED', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '403' | ||
} | ||
AccessDeniedResponse: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString,"validationError":"$context.error.validationErrorString"}' | ||
}, | ||
ResponseType: 'ACCESS_DENIED', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '403' | ||
} | ||
}, | ||
AuthorizerConfigurationErrorResponse: { | ||
Type: 'AWS::ApiGateway::GatewayResponse', | ||
Properties: { | ||
ResponseParameters: { | ||
'gatewayresponse.header.Access-Control-Allow-Origin': 'method.request.header.Origin' | ||
}, | ||
ResponseTemplates: { | ||
'application/json': '{"message":$context.error.messageString,"validationError":"$context.error.validationErrorString"}' | ||
}, | ||
ResponseType: 'AUTHORIZER_CONFIGURATION_ERROR', | ||
RestApiId: { | ||
Ref: 'ApiGatewayRestApi' | ||
}, | ||
StatusCode: '500' | ||
} | ||
} | ||
} | ||
], | ||
}, | ||
...serviceConfig | ||
}; | ||
}; |
{ | ||
"name": "sls-helper-plugin-janis", | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "A Serverless Helper plugin to add custom helpers for JANIS Commerce", | ||
@@ -5,0 +5,0 @@ "main": "lib/plugin.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36160
832