-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from yndlingsfar/feature/cors
Feature/cors
- Loading branch information
Showing
28 changed files
with
920 additions
and
1,151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
## 1.1.0 (2021-13-04) | ||
## 1.2.0 (2021-04-19) | ||
- added support for CORS generation | ||
|
||
## 1.1.0 (2021-04-13) | ||
- change the supported serverless version to 2.x | ||
|
||
## 1.0.0 (2021-04-8) | ||
## 1.0.0 (2021-04-08) | ||
- The very first release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
openapi: 3.0.0 | ||
info: | ||
description: User Registration | ||
version: 1.0.0 | ||
title: UserRegistrationDemo | ||
paths: | ||
/api/v1/user: | ||
post: | ||
summary: adds a user | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Customer' | ||
responses: | ||
'201': | ||
description: user created | ||
components: | ||
schemas: | ||
Customer: | ||
type: object | ||
required: | ||
- email_address | ||
- password | ||
properties: | ||
email_address: | ||
type: string | ||
example: [email protected] | ||
password: | ||
type: string | ||
format: password | ||
example: someStrongPassword# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
paths: | ||
/api/v1/user: | ||
post: | ||
x-amazon-apigateway-integration: | ||
httpMethod: "POST" | ||
uri: ${self:custom.url} | ||
type: "http" | ||
passthroughBehavior: "when_no_match" | ||
responses: | ||
"2\\d{2}": | ||
statusCode: "201" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
paths: | ||
/api/v1/user: | ||
post: | ||
x-amazon-apigateway-integration: | ||
httpMethod: "POST" | ||
type: "mock" | ||
passthroughBehavior: "when_no_match" | ||
requestTemplates: | ||
application/json: | | ||
{ | ||
"statusCode" : 204 | ||
} | ||
responses: | ||
"2\\d{2}": | ||
statusCode: "201" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Access-Control-Allow-Origin: | ||
style: simple | ||
explode: false | ||
schema: | ||
type: string | ||
Access-Control-Allow-Methods: | ||
style: simple | ||
explode: false | ||
schema: | ||
type: string | ||
Access-Control-Allow-Headers: | ||
style: simple | ||
explode: false | ||
schema: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
x-amazon-apigateway-integration: | ||
type: mock | ||
requestTemplates: | ||
application/json: | | ||
{ | ||
"statusCode" : 204 | ||
} | ||
responses: | ||
default: | ||
statusCode: "204" | ||
responseParameters: | ||
method.response.header.Access-Control-Allow-Headers: '''Content-Type,X-Amz-Date,Authorization,X-Api-Key''' | ||
method.response.header.Access-Control-Allow-Methods: '''*''' | ||
method.response.header.Access-Control-Allow-Origin: '''*''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
summary: Provide CORS | ||
description: Basic CORS functionality with an aws mocking integration | ||
responses: | ||
"204": | ||
description: No data | ||
headers: | ||
X-Some-Custom-Header: | ||
style: simple | ||
explode: false | ||
schema: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Welcome to Serverless! | ||
# | ||
# This file is the main config file for your service. | ||
# It's very minimal at this point and uses default values. | ||
# You can always add more config options for more control. | ||
# We've included some commented out config examples here. | ||
# Just uncomment any of them to get that config option. | ||
# | ||
# For full config options, check the docs: | ||
# docs.serverless.com | ||
# | ||
# Happy Coding! | ||
|
||
service: myservice | ||
# app and org for use with dashboard.serverless.com | ||
#app: your-app-name | ||
#org: your-org-name | ||
|
||
# You can pin your service to only deploy with a specific Serverless version | ||
# Check out our docs for more details | ||
frameworkVersion: '2' | ||
|
||
provider: | ||
name: aws | ||
runtime: nodejs12.x | ||
lambdaHashingVersion: 20201221 | ||
|
||
plugins: | ||
- serverless-openapi-integration-helper | ||
|
||
openApiIntegration: | ||
inputFile: api.yml | ||
cors: true | ||
mapping: | ||
- stage: dev | ||
path: integrations | ||
- stage: test | ||
path: mocks | ||
|
||
functions: | ||
|
||
Resources: | ||
ApiGatewayRestApi: | ||
Type: AWS::ApiGateway::RestApi | ||
Properties: | ||
ApiKeySourceType: HEADER | ||
Body: ${file(openapi-integration/api.yml)} | ||
Description: DCP - Public address verification Gateway (${opt:stage, self:provider.stage}) | ||
FailOnWarnings: false | ||
Name: ${opt:stage, self:provider.stage}-dcp-public-addressVerification-gateway | ||
EndpointConfiguration: | ||
Types: | ||
- REGIONAL |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.