Try it on dev
This commit is contained in:
parent
56b054fae0
commit
2205750e3b
11
.vscode/settings.json
vendored
Normal file
11
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"files.exclude": {
|
||||||
|
"amplify/.config": true,
|
||||||
|
"amplify/**/*-parameters.json": true,
|
||||||
|
"amplify/**/amplify.state": true,
|
||||||
|
"amplify/**/transform.conf.json": true,
|
||||||
|
"amplify/#current-cloud-backend": true,
|
||||||
|
"amplify/backend/amplify-meta.json": true,
|
||||||
|
"amplify/backend/awscloudformation": true
|
||||||
|
}
|
||||||
|
}
|
35
amplify/backend/api/auth/api-params.json
Normal file
35
amplify/backend/api/auth/api-params.json
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"paths": [
|
||||||
|
{
|
||||||
|
"name": "/auth",
|
||||||
|
"lambdaFunction": "authFunction",
|
||||||
|
"privacy": {
|
||||||
|
"open": true
|
||||||
|
},
|
||||||
|
"policyResourceName": "/auth"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resourceName": "auth",
|
||||||
|
"apiName": "auth",
|
||||||
|
"functionArns": [
|
||||||
|
{
|
||||||
|
"lambdaFunction": "authFunction"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"privacy": {
|
||||||
|
"auth": 0,
|
||||||
|
"unauth": 0,
|
||||||
|
"authRoleName": "amplify-michalvankodev-master-144656-authRole",
|
||||||
|
"unAuthRoleName": "amplify-michalvankodev-master-144656-unauthRole"
|
||||||
|
},
|
||||||
|
"dependsOn": [
|
||||||
|
{
|
||||||
|
"category": "function",
|
||||||
|
"resourceName": "authFunction",
|
||||||
|
"attributes": [
|
||||||
|
"Name",
|
||||||
|
"Arn"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
403
amplify/backend/api/auth/auth-cloudformation-template.json
Normal file
403
amplify/backend/api/auth/auth-cloudformation-template.json
Normal file
@ -0,0 +1,403 @@
|
|||||||
|
{
|
||||||
|
"AWSTemplateFormatVersion": "2010-09-09",
|
||||||
|
"Description": "API Gateway resource stack creation using Amplify CLI",
|
||||||
|
|
||||||
|
"Parameters": {
|
||||||
|
"authRoleName": {
|
||||||
|
"Type": "String"
|
||||||
|
},
|
||||||
|
"unauthRoleName": {
|
||||||
|
"Type": "String"
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"Type": "String"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
"functionauthFunctionName": {
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "functionauthFunctionName"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
"functionauthFunctionArn": {
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "functionauthFunctionArn"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
"Conditions": {
|
||||||
|
"ShouldNotCreateEnvResources": {
|
||||||
|
"Fn::Equals": [
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
},
|
||||||
|
"NONE"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Resources": {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"auth": {
|
||||||
|
"Type": "AWS::ApiGateway::RestApi",
|
||||||
|
"Properties": {
|
||||||
|
"Description": "",
|
||||||
|
"Name": "auth",
|
||||||
|
"Body": {
|
||||||
|
"swagger": "2.0",
|
||||||
|
"info": {
|
||||||
|
"version": "2018-05-24T17:52:00Z",
|
||||||
|
"title": "auth"
|
||||||
|
},
|
||||||
|
"host": {
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"apigateway.",
|
||||||
|
{
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
},
|
||||||
|
".amazonaws.com"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"basePath": {
|
||||||
|
"Fn::If": [
|
||||||
|
"ShouldNotCreateEnvResources",
|
||||||
|
"/Prod",
|
||||||
|
{
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"/",
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"schemes": [
|
||||||
|
"https"
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
|
||||||
|
"/auth": {
|
||||||
|
"options": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "200 response",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-amazon-apigateway-integration": {
|
||||||
|
"responses": {
|
||||||
|
"default": {
|
||||||
|
"statusCode": "200",
|
||||||
|
"responseParameters": {
|
||||||
|
"method.response.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'",
|
||||||
|
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'",
|
||||||
|
"method.response.header.Access-Control-Allow-Origin": "'*'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requestTemplates": {
|
||||||
|
"application/json": "{\"statusCode\": 200}"
|
||||||
|
},
|
||||||
|
"passthroughBehavior": "when_no_match",
|
||||||
|
"type": "mock"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-amazon-apigateway-any-method": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "body",
|
||||||
|
"name": "RequestSchema",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/RequestSchema"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "200 response",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/ResponseSchema"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"x-amazon-apigateway-integration": {
|
||||||
|
"responses": {
|
||||||
|
"default": {
|
||||||
|
"statusCode": "200"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uri": {
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"arn:aws:apigateway:",
|
||||||
|
{
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
},
|
||||||
|
":lambda:path/2015-03-31/functions/",
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
"Ref": "functionauthFunctionArn"
|
||||||
|
},
|
||||||
|
|
||||||
|
"/invocations"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"passthroughBehavior": "when_no_match",
|
||||||
|
"httpMethod": "POST",
|
||||||
|
"type": "aws_proxy"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/auth/{proxy+}": {
|
||||||
|
"options": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "200 response",
|
||||||
|
"headers": {
|
||||||
|
"Access-Control-Allow-Origin": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Methods": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Access-Control-Allow-Headers": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-amazon-apigateway-integration": {
|
||||||
|
"responses": {
|
||||||
|
"default": {
|
||||||
|
"statusCode": "200",
|
||||||
|
"responseParameters": {
|
||||||
|
"method.response.header.Access-Control-Allow-Methods": "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'",
|
||||||
|
"method.response.header.Access-Control-Allow-Headers": "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent'",
|
||||||
|
"method.response.header.Access-Control-Allow-Origin": "'*'"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requestTemplates": {
|
||||||
|
"application/json": "{\"statusCode\": 200}"
|
||||||
|
},
|
||||||
|
"passthroughBehavior": "when_no_match",
|
||||||
|
"type": "mock"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-amazon-apigateway-any-method": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"in": "body",
|
||||||
|
"name": "RequestSchema",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/RequestSchema"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "200 response",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/ResponseSchema"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
"x-amazon-apigateway-integration": {
|
||||||
|
"responses": {
|
||||||
|
"default": {
|
||||||
|
"statusCode": "200"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uri": {
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"arn:aws:apigateway:",
|
||||||
|
{
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
},
|
||||||
|
":lambda:path/2015-03-31/functions/",
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
"Ref": "functionauthFunctionArn"
|
||||||
|
},
|
||||||
|
|
||||||
|
"/invocations"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"passthroughBehavior": "when_no_match",
|
||||||
|
"httpMethod": "POST",
|
||||||
|
"type": "aws_proxy"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
"securityDefinitions": {
|
||||||
|
"sigv4": {
|
||||||
|
"type": "apiKey",
|
||||||
|
"name": "Authorization",
|
||||||
|
"in": "header",
|
||||||
|
"x-amazon-apigateway-authtype": "awsSigv4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"definitions": {
|
||||||
|
"RequestSchema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"request"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"request": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"title": "Request Schema"
|
||||||
|
},
|
||||||
|
"ResponseSchema": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"response"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"response": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"title": "Response Schema"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"FailOnWarnings": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"functionauthFunctionPermissionauth": {
|
||||||
|
"Type": "AWS::Lambda::Permission",
|
||||||
|
"Properties": {
|
||||||
|
"FunctionName":
|
||||||
|
{
|
||||||
|
"Ref": "functionauthFunctionName"
|
||||||
|
},
|
||||||
|
|
||||||
|
"Action": "lambda:InvokeFunction",
|
||||||
|
"Principal": "apigateway.amazonaws.com",
|
||||||
|
"SourceArn": {
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"arn:aws:execute-api:",
|
||||||
|
{
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
},
|
||||||
|
":",
|
||||||
|
{
|
||||||
|
"Ref": "AWS::AccountId"
|
||||||
|
},
|
||||||
|
":",
|
||||||
|
{
|
||||||
|
"Ref": "auth"
|
||||||
|
},
|
||||||
|
"/*/*/*"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
"DeploymentAPIGWauth": {
|
||||||
|
"Type": "AWS::ApiGateway::Deployment",
|
||||||
|
"Properties": {
|
||||||
|
"Description": "The Development stage deployment of your API.",
|
||||||
|
"StageName": {
|
||||||
|
"Fn::If": [
|
||||||
|
"ShouldNotCreateEnvResources",
|
||||||
|
"Prod",
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"RestApiId": {
|
||||||
|
"Ref": "auth"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Outputs": {
|
||||||
|
"RootUrl": {
|
||||||
|
"Description": "Root URL of the API gateway",
|
||||||
|
"Value": {"Fn::Join": ["", ["https://", {"Ref": "auth"}, ".execute-api.", {"Ref": "AWS::Region"}, ".amazonaws.com/", {"Fn::If": ["ShouldNotCreateEnvResources","Prod", {"Ref": "env"} ]}]]}
|
||||||
|
},
|
||||||
|
"ApiName": {
|
||||||
|
"Description": "API Friendly name",
|
||||||
|
"Value": "auth"
|
||||||
|
},
|
||||||
|
"ApiId": {
|
||||||
|
"Description": "API ID (prefix of API URL)",
|
||||||
|
"Value": {"Ref": "auth"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
amplify/backend/api/auth/parameters.json
Normal file
8
amplify/backend/api/auth/parameters.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"authRoleName": {
|
||||||
|
"Ref": "AuthRoleName"
|
||||||
|
},
|
||||||
|
"unauthRoleName": {
|
||||||
|
"Ref": "UnauthRoleName"
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,27 @@
|
|||||||
{
|
{
|
||||||
"hosting": {}
|
"hosting": {},
|
||||||
|
"function": {
|
||||||
|
"authFunction": {
|
||||||
|
"build": true,
|
||||||
|
"providerPlugin": "awscloudformation",
|
||||||
|
"service": "Lambda",
|
||||||
|
"dependsOn": []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"api": {
|
||||||
|
"auth": {
|
||||||
|
"service": "API Gateway",
|
||||||
|
"providerPlugin": "awscloudformation",
|
||||||
|
"dependsOn": [
|
||||||
|
{
|
||||||
|
"category": "function",
|
||||||
|
"resourceName": "authFunction",
|
||||||
|
"attributes": [
|
||||||
|
"Name",
|
||||||
|
"Arn"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
6
amplify/backend/function/authFunction/amplify.state
Normal file
6
amplify/backend/function/authFunction/amplify.state
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"pluginId": "amplify-nodejs-function-runtime-provider",
|
||||||
|
"functionRuntime": "nodejs",
|
||||||
|
"useLegacyBuild": true,
|
||||||
|
"defaultEditorFile": "src/app.js"
|
||||||
|
}
|
@ -0,0 +1,184 @@
|
|||||||
|
{
|
||||||
|
"AWSTemplateFormatVersion": "2010-09-09",
|
||||||
|
"Description": "Lambda Function resource stack creation using Amplify CLI",
|
||||||
|
"Parameters": {
|
||||||
|
"CloudWatchRule": {
|
||||||
|
"Type": "String",
|
||||||
|
"Default": "NONE",
|
||||||
|
"Description": " Schedule Expression"
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"Type": "String"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Conditions": {
|
||||||
|
"ShouldNotCreateEnvResources": {
|
||||||
|
"Fn::Equals": [
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
},
|
||||||
|
"NONE"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Resources": {
|
||||||
|
"LambdaFunction": {
|
||||||
|
"Type": "AWS::Lambda::Function",
|
||||||
|
"Metadata": {
|
||||||
|
"aws:asset:path": "./src",
|
||||||
|
"aws:asset:property": "Code"
|
||||||
|
},
|
||||||
|
"Properties": {
|
||||||
|
"Handler": "index.handler",
|
||||||
|
"FunctionName": {
|
||||||
|
"Fn::If": [
|
||||||
|
"ShouldNotCreateEnvResources",
|
||||||
|
"authFunction",
|
||||||
|
{
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"authFunction",
|
||||||
|
"-",
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Environment": {
|
||||||
|
"Variables": {
|
||||||
|
"ENV": {
|
||||||
|
"Ref": "env"
|
||||||
|
},
|
||||||
|
"REGION": {
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Role": {
|
||||||
|
"Fn::GetAtt": [
|
||||||
|
"LambdaExecutionRole",
|
||||||
|
"Arn"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Runtime": "nodejs12.x",
|
||||||
|
"Layers": [],
|
||||||
|
"Timeout": "25",
|
||||||
|
"Code": {
|
||||||
|
"S3Bucket": "amplify-michalvankodev-master-144656-deployment",
|
||||||
|
"S3Key": "amplify-builds/authFunction-594d584675367a464230-build.zip"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"LambdaExecutionRole": {
|
||||||
|
"Type": "AWS::IAM::Role",
|
||||||
|
"Properties": {
|
||||||
|
"RoleName": {
|
||||||
|
"Fn::If": [
|
||||||
|
"ShouldNotCreateEnvResources",
|
||||||
|
"michalvankodevLambdaRole1e657f9c",
|
||||||
|
{
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"michalvankodevLambdaRole1e657f9c",
|
||||||
|
"-",
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"AssumeRolePolicyDocument": {
|
||||||
|
"Version": "2012-10-17",
|
||||||
|
"Statement": [
|
||||||
|
{
|
||||||
|
"Effect": "Allow",
|
||||||
|
"Principal": {
|
||||||
|
"Service": [
|
||||||
|
"lambda.amazonaws.com"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Action": [
|
||||||
|
"sts:AssumeRole"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lambdaexecutionpolicy": {
|
||||||
|
"DependsOn": [
|
||||||
|
"LambdaExecutionRole"
|
||||||
|
],
|
||||||
|
"Type": "AWS::IAM::Policy",
|
||||||
|
"Properties": {
|
||||||
|
"PolicyName": "lambda-execution-policy",
|
||||||
|
"Roles": [
|
||||||
|
{
|
||||||
|
"Ref": "LambdaExecutionRole"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"PolicyDocument": {
|
||||||
|
"Version": "2012-10-17",
|
||||||
|
"Statement": [
|
||||||
|
{
|
||||||
|
"Effect": "Allow",
|
||||||
|
"Action": [
|
||||||
|
"logs:CreateLogGroup",
|
||||||
|
"logs:CreateLogStream",
|
||||||
|
"logs:PutLogEvents"
|
||||||
|
],
|
||||||
|
"Resource": {
|
||||||
|
"Fn::Sub": [
|
||||||
|
"arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*",
|
||||||
|
{
|
||||||
|
"region": {
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
},
|
||||||
|
"account": {
|
||||||
|
"Ref": "AWS::AccountId"
|
||||||
|
},
|
||||||
|
"lambda": {
|
||||||
|
"Ref": "LambdaFunction"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Outputs": {
|
||||||
|
"Name": {
|
||||||
|
"Value": {
|
||||||
|
"Ref": "LambdaFunction"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Arn": {
|
||||||
|
"Value": {
|
||||||
|
"Fn::GetAtt": [
|
||||||
|
"LambdaFunction",
|
||||||
|
"Arn"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Region": {
|
||||||
|
"Value": {
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"LambdaExecutionRole": {
|
||||||
|
"Value": {
|
||||||
|
"Ref": "LambdaExecutionRole"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"lambdaLayers": []
|
||||||
|
}
|
1
amplify/backend/function/authFunction/parameters.json
Normal file
1
amplify/backend/function/authFunction/parameters.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
89
amplify/backend/function/authFunction/src/app.js
Normal file
89
amplify/backend/function/authFunction/src/app.js
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 - 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
|
||||||
|
http://aws.amazon.com/apache2.0/
|
||||||
|
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Amplify Params - DO NOT EDIT
|
||||||
|
ENV
|
||||||
|
REGION
|
||||||
|
Amplify Params - DO NOT EDIT */
|
||||||
|
|
||||||
|
var express = require('express')
|
||||||
|
var bodyParser = require('body-parser')
|
||||||
|
var awsServerlessExpressMiddleware = require('aws-serverless-express/middleware')
|
||||||
|
const randomstring = require('randomstring')
|
||||||
|
const { getScript } = require('./callback-script')
|
||||||
|
const { getOauth } = require('./oauth')
|
||||||
|
|
||||||
|
const loginAuthTarget = process.env.AUTH_TARGET || '_self'
|
||||||
|
const oauthProvider = process.env.OAUTH_PROVIDER || 'github'
|
||||||
|
|
||||||
|
// declare a new express app
|
||||||
|
var app = express()
|
||||||
|
app.use(bodyParser.json())
|
||||||
|
app.use(awsServerlessExpressMiddleware.eventContext())
|
||||||
|
|
||||||
|
// Enable CORS for all methods
|
||||||
|
app.use(function (req, res, next) {
|
||||||
|
res.header('Access-Control-Allow-Origin', '*')
|
||||||
|
res.header(
|
||||||
|
'Access-Control-Allow-Headers',
|
||||||
|
'Origin, X-Requested-With, Content-Type, Accept'
|
||||||
|
)
|
||||||
|
next()
|
||||||
|
})
|
||||||
|
|
||||||
|
app.get('/auth', function (req, res) {
|
||||||
|
res.redirect('/master/auth/authorize')
|
||||||
|
})
|
||||||
|
|
||||||
|
app.get('/auth/authorize', async function (req, res) {
|
||||||
|
// Authorization uri definition
|
||||||
|
const oauth2 = await getOauth()
|
||||||
|
const authorizationUri = oauth2.authorizeURL({
|
||||||
|
redirect_uri: process.env.REDIRECT_URL,
|
||||||
|
scope: process.env.SCOPES || 'repo,user',
|
||||||
|
state: randomstring.generate(32),
|
||||||
|
})
|
||||||
|
res.redirect(authorizationUri)
|
||||||
|
})
|
||||||
|
|
||||||
|
app.get('/auth/callback', async function (req, res) {
|
||||||
|
const code = req.query.code
|
||||||
|
var options = {
|
||||||
|
code: code,
|
||||||
|
}
|
||||||
|
const oauth2 = await getOauth()
|
||||||
|
|
||||||
|
let mess, content
|
||||||
|
try {
|
||||||
|
const accessToken = await oauth2.getToken(options)
|
||||||
|
const token = oauth2.createToken(result)
|
||||||
|
mess = 'success'
|
||||||
|
content = {
|
||||||
|
token: token.token.access_token,
|
||||||
|
provider: oauthProvider,
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Access Token Error', error.message)
|
||||||
|
mess = 'error'
|
||||||
|
content = JSON.stringify(error)
|
||||||
|
}
|
||||||
|
return res.send(getScript(mess, content))
|
||||||
|
})
|
||||||
|
|
||||||
|
app.get('/auth/success', function (req, res) {
|
||||||
|
res.status(204).send('')
|
||||||
|
})
|
||||||
|
|
||||||
|
app.listen(3000, function () {
|
||||||
|
console.log('App started')
|
||||||
|
})
|
||||||
|
|
||||||
|
// Export the app object. When executing the application local this does nothing. However,
|
||||||
|
// to port it to AWS Lambda we will create a wrapper around that will load the app from
|
||||||
|
// this file
|
||||||
|
module.exports = app
|
17
amplify/backend/function/authFunction/src/callback-script.js
Normal file
17
amplify/backend/function/authFunction/src/callback-script.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
exports.getScript = function getScript(mess, content) {
|
||||||
|
return `<html><body><script>
|
||||||
|
(function() {
|
||||||
|
function receiveMessage(e) {
|
||||||
|
console.log("receiveMessage %o", e)
|
||||||
|
window.opener.postMessage(
|
||||||
|
'authorization:github:${mess}:${JSON.stringify(content)}',
|
||||||
|
e.origin
|
||||||
|
)
|
||||||
|
window.removeEventListener("message",receiveMessage,false);
|
||||||
|
}
|
||||||
|
window.addEventListener("message", receiveMessage, false)
|
||||||
|
console.log("Sending message: %o", "github")
|
||||||
|
window.opener.postMessage("authorizing:github", "*")
|
||||||
|
})()
|
||||||
|
</script></body></html>`
|
||||||
|
}
|
5
amplify/backend/function/authFunction/src/event.json
Normal file
5
amplify/backend/function/authFunction/src/event.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"key1": "value1",
|
||||||
|
"key2": "value2",
|
||||||
|
"key3": "value3"
|
||||||
|
}
|
9
amplify/backend/function/authFunction/src/index.js
Normal file
9
amplify/backend/function/authFunction/src/index.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const awsServerlessExpress = require('aws-serverless-express');
|
||||||
|
const app = require('./app');
|
||||||
|
|
||||||
|
const server = awsServerlessExpress.createServer(app);
|
||||||
|
|
||||||
|
exports.handler = (event, context) => {
|
||||||
|
console.log(`EVENT: ${JSON.stringify(event)}`);
|
||||||
|
return awsServerlessExpress.proxy(server, event, context, 'PROMISE').promise;
|
||||||
|
};
|
33
amplify/backend/function/authFunction/src/oauth.js
Normal file
33
amplify/backend/function/authFunction/src/oauth.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
const { SecretsManager } = require('aws-sdk')
|
||||||
|
const simpleOauthModule = require('simple-oauth2')
|
||||||
|
|
||||||
|
const secretsManager = new SecretsManager()
|
||||||
|
|
||||||
|
exports.getOauth = async function getOauth() {
|
||||||
|
const secrets = await secretsManager
|
||||||
|
.getSecretValue({ SecretId: 'michalvankodev_github_oauth' })
|
||||||
|
.promise()
|
||||||
|
.then((data) => {
|
||||||
|
return JSON.parse(data.SecretString)
|
||||||
|
})
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
OAUTH_CLIENT_ID: secrets.CLIENT_ID,
|
||||||
|
OAUTH_CLIENT_SECRET: secrets.CLIENT_SECRETS,
|
||||||
|
GIT_HOSTNAME: 'https://github.com',
|
||||||
|
OAUTH_TOKEN_PATH: '/login/oauth/access_token',
|
||||||
|
OAUTH_AUTHORIZE_PATH: '/login/oauth/authorize',
|
||||||
|
}
|
||||||
|
|
||||||
|
return new simpleOauthModule.AuthorizationCode({
|
||||||
|
client: {
|
||||||
|
id: config.OAUTH_CLIENT_ID,
|
||||||
|
secret: config.OAUTH_CLIENT_SECRET,
|
||||||
|
},
|
||||||
|
auth: {
|
||||||
|
tokenHost: config.GIT_HOSTNAME,
|
||||||
|
tokenPath: config.OAUTH_TOKEN_PATH,
|
||||||
|
authorizePath: config.OAUTH_AUTHORIZE_PATH,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
632
amplify/backend/function/authFunction/src/package-lock.json
generated
Normal file
632
amplify/backend/function/authFunction/src/package-lock.json
generated
Normal file
@ -0,0 +1,632 @@
|
|||||||
|
{
|
||||||
|
"name": "authFunction",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"requires": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@hapi/boom": {
|
||||||
|
"version": "9.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@hapi/boom/-/boom-9.1.0.tgz",
|
||||||
|
"integrity": "sha512-4nZmpp4tXbm162LaZT45P7F7sgiem8dwAh2vHWT6XX24dozNjGMg6BvKCRvtCUcmcXqeMIUqWN8Rc5X8yKuROQ==",
|
||||||
|
"requires": {
|
||||||
|
"@hapi/hoek": "9.x.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@hapi/bourne": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-WEezM1FWztfbzqIUbsDzFRVMxSoLy3HugVcux6KDDtTqzPsLE8NDRHfXvev66aH1i2oOKKar3/XDjbvh/OUBdg=="
|
||||||
|
},
|
||||||
|
"@hapi/hoek": {
|
||||||
|
"version": "9.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.1.0.tgz",
|
||||||
|
"integrity": "sha512-i9YbZPN3QgfighY/1X1Pu118VUz2Fmmhd6b2n0/O8YVgGGfw0FbUYoA97k7FkpGJ+pLCFEDLUmAPPV4D1kpeFw=="
|
||||||
|
},
|
||||||
|
"@hapi/topo": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==",
|
||||||
|
"requires": {
|
||||||
|
"@hapi/hoek": "^9.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@hapi/wreck": {
|
||||||
|
"version": "17.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@hapi/wreck/-/wreck-17.0.0.tgz",
|
||||||
|
"integrity": "sha512-d8lqCinbKyDByn7GzJDRDbitddhIEydNm44UcAMejfhEH3o4IYvKYq6K8cAqXbilXPuvZc0ErlUOg9SDdgRtMw==",
|
||||||
|
"requires": {
|
||||||
|
"@hapi/boom": "9.x.x",
|
||||||
|
"@hapi/bourne": "2.x.x",
|
||||||
|
"@hapi/hoek": "9.x.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@sideway/address": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-wAH/JYRXeIFQRsxerIuLjgUu2Xszam+O5xKeatJ4oudShOOirfmsQ1D6LL54XOU2tizpCYku+s1wmU0SYdpoSA==",
|
||||||
|
"requires": {
|
||||||
|
"@hapi/hoek": "^9.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@sideway/formula": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg=="
|
||||||
|
},
|
||||||
|
"@sideway/pinpoint": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ=="
|
||||||
|
},
|
||||||
|
"accepts": {
|
||||||
|
"version": "1.3.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
||||||
|
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
|
||||||
|
"requires": {
|
||||||
|
"mime-types": "~2.1.24",
|
||||||
|
"negotiator": "0.6.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"array-flatten": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||||
|
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
|
||||||
|
},
|
||||||
|
"array-uniq": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0="
|
||||||
|
},
|
||||||
|
"aws-sdk": {
|
||||||
|
"version": "2.796.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.796.0.tgz",
|
||||||
|
"integrity": "sha512-200ic1PfRhcoLqQJkdHuZx5Utd+FFPTHEFwFvAU6zKXkKTe4P+ZfSETkoLCqsN8ks61mvXevzeHviJt89BLGbw==",
|
||||||
|
"requires": {
|
||||||
|
"buffer": "4.9.2",
|
||||||
|
"events": "1.1.1",
|
||||||
|
"ieee754": "1.1.13",
|
||||||
|
"jmespath": "0.15.0",
|
||||||
|
"querystring": "0.2.0",
|
||||||
|
"sax": "1.2.1",
|
||||||
|
"url": "0.10.3",
|
||||||
|
"uuid": "3.3.2",
|
||||||
|
"xml2js": "0.4.19"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"aws-serverless-express": {
|
||||||
|
"version": "3.3.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/aws-serverless-express/-/aws-serverless-express-3.3.8.tgz",
|
||||||
|
"integrity": "sha512-2TQdF5EhxnAtGeEi+wSi2M3xCfpiemuImnpU7HKih3onH0izJ/G2tkM+gwcGHZEsW/gLWFl/JjQAYGa3fILfvw==",
|
||||||
|
"requires": {
|
||||||
|
"binary-case": "^1.0.0",
|
||||||
|
"type-is": "^1.6.16"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"base64-js": {
|
||||||
|
"version": "1.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||||
|
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
|
||||||
|
},
|
||||||
|
"binary-case": {
|
||||||
|
"version": "1.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/binary-case/-/binary-case-1.1.4.tgz",
|
||||||
|
"integrity": "sha512-9Kq8m6NZTAgy05Ryuh7U3Qc4/ujLQU1AZ5vMw4cr3igTdi5itZC6kCNrRr2X8NzPiDn2oUIFTfa71DKMnue/Zg=="
|
||||||
|
},
|
||||||
|
"body-parser": {
|
||||||
|
"version": "1.19.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
|
||||||
|
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
|
||||||
|
"requires": {
|
||||||
|
"bytes": "3.1.0",
|
||||||
|
"content-type": "~1.0.4",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"http-errors": "1.7.2",
|
||||||
|
"iconv-lite": "0.4.24",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"qs": "6.7.0",
|
||||||
|
"raw-body": "2.4.0",
|
||||||
|
"type-is": "~1.6.17"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buffer": {
|
||||||
|
"version": "4.9.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz",
|
||||||
|
"integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",
|
||||||
|
"requires": {
|
||||||
|
"base64-js": "^1.0.2",
|
||||||
|
"ieee754": "^1.1.4",
|
||||||
|
"isarray": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bytes": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
|
||||||
|
},
|
||||||
|
"content-disposition": {
|
||||||
|
"version": "0.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
|
||||||
|
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
|
||||||
|
"requires": {
|
||||||
|
"safe-buffer": "5.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"content-type": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
|
||||||
|
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
|
||||||
|
},
|
||||||
|
"cookie": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
|
||||||
|
},
|
||||||
|
"cookie-signature": {
|
||||||
|
"version": "1.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
||||||
|
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"version": "4.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
|
||||||
|
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"depd": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
|
||||||
|
},
|
||||||
|
"destroy": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
|
||||||
|
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
||||||
|
},
|
||||||
|
"ee-first": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
|
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
||||||
|
},
|
||||||
|
"encodeurl": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
||||||
|
},
|
||||||
|
"escape-html": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
|
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
|
||||||
|
},
|
||||||
|
"etag": {
|
||||||
|
"version": "1.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||||
|
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
||||||
|
},
|
||||||
|
"events": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
|
||||||
|
"integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
|
||||||
|
},
|
||||||
|
"express": {
|
||||||
|
"version": "4.17.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
|
||||||
|
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
|
||||||
|
"requires": {
|
||||||
|
"accepts": "~1.3.7",
|
||||||
|
"array-flatten": "1.1.1",
|
||||||
|
"body-parser": "1.19.0",
|
||||||
|
"content-disposition": "0.5.3",
|
||||||
|
"content-type": "~1.0.4",
|
||||||
|
"cookie": "0.4.0",
|
||||||
|
"cookie-signature": "1.0.6",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"etag": "~1.8.1",
|
||||||
|
"finalhandler": "~1.1.2",
|
||||||
|
"fresh": "0.5.2",
|
||||||
|
"merge-descriptors": "1.0.1",
|
||||||
|
"methods": "~1.1.2",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"path-to-regexp": "0.1.7",
|
||||||
|
"proxy-addr": "~2.0.5",
|
||||||
|
"qs": "6.7.0",
|
||||||
|
"range-parser": "~1.2.1",
|
||||||
|
"safe-buffer": "5.1.2",
|
||||||
|
"send": "0.17.1",
|
||||||
|
"serve-static": "1.14.1",
|
||||||
|
"setprototypeof": "1.1.1",
|
||||||
|
"statuses": "~1.5.0",
|
||||||
|
"type-is": "~1.6.18",
|
||||||
|
"utils-merge": "1.0.1",
|
||||||
|
"vary": "~1.1.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"finalhandler": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"statuses": "~1.5.0",
|
||||||
|
"unpipe": "~1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"forwarded": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
||||||
|
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
|
||||||
|
},
|
||||||
|
"fresh": {
|
||||||
|
"version": "0.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||||
|
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
||||||
|
},
|
||||||
|
"http-errors": {
|
||||||
|
"version": "1.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
|
||||||
|
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
|
||||||
|
"requires": {
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"inherits": "2.0.3",
|
||||||
|
"setprototypeof": "1.1.1",
|
||||||
|
"statuses": ">= 1.5.0 < 2",
|
||||||
|
"toidentifier": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"iconv-lite": {
|
||||||
|
"version": "0.4.24",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
|
"requires": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ieee754": {
|
||||||
|
"version": "1.1.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
|
||||||
|
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
|
||||||
|
},
|
||||||
|
"inherits": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||||
|
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
||||||
|
},
|
||||||
|
"ipaddr.js": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
|
||||||
|
},
|
||||||
|
"isarray": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||||
|
},
|
||||||
|
"jmespath": {
|
||||||
|
"version": "0.15.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
|
||||||
|
"integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc="
|
||||||
|
},
|
||||||
|
"joi": {
|
||||||
|
"version": "17.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/joi/-/joi-17.3.0.tgz",
|
||||||
|
"integrity": "sha512-Qh5gdU6niuYbUIUV5ejbsMiiFmBdw8Kcp8Buj2JntszCkCfxJ9Cz76OtHxOZMPXrt5810iDIXs+n1nNVoquHgg==",
|
||||||
|
"requires": {
|
||||||
|
"@hapi/hoek": "^9.0.0",
|
||||||
|
"@hapi/topo": "^5.0.0",
|
||||||
|
"@sideway/address": "^4.1.0",
|
||||||
|
"@sideway/formula": "^3.0.0",
|
||||||
|
"@sideway/pinpoint": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"media-typer": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||||
|
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
||||||
|
},
|
||||||
|
"merge-descriptors": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
|
||||||
|
},
|
||||||
|
"methods": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
||||||
|
},
|
||||||
|
"mime": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
|
||||||
|
},
|
||||||
|
"mime-db": {
|
||||||
|
"version": "1.44.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
|
||||||
|
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
|
||||||
|
},
|
||||||
|
"mime-types": {
|
||||||
|
"version": "2.1.27",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
|
||||||
|
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
|
||||||
|
"requires": {
|
||||||
|
"mime-db": "1.44.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
|
},
|
||||||
|
"negotiator": {
|
||||||
|
"version": "0.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
|
||||||
|
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
|
||||||
|
},
|
||||||
|
"on-finished": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
||||||
|
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
|
||||||
|
"requires": {
|
||||||
|
"ee-first": "1.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parseurl": {
|
||||||
|
"version": "1.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||||
|
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
||||||
|
},
|
||||||
|
"path-to-regexp": {
|
||||||
|
"version": "0.1.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
||||||
|
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
|
||||||
|
},
|
||||||
|
"proxy-addr": {
|
||||||
|
"version": "2.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
|
||||||
|
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
|
||||||
|
"requires": {
|
||||||
|
"forwarded": "~0.1.2",
|
||||||
|
"ipaddr.js": "1.9.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"punycode": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
|
||||||
|
"integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
|
||||||
|
},
|
||||||
|
"qs": {
|
||||||
|
"version": "6.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
|
||||||
|
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
|
||||||
|
},
|
||||||
|
"querystring": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
|
||||||
|
"integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
|
||||||
|
},
|
||||||
|
"randomstring": {
|
||||||
|
"version": "1.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/randomstring/-/randomstring-1.1.5.tgz",
|
||||||
|
"integrity": "sha1-bfBij3XL1ZMpMNn+OrTpVqGFGMM=",
|
||||||
|
"requires": {
|
||||||
|
"array-uniq": "1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"range-parser": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
|
||||||
|
},
|
||||||
|
"raw-body": {
|
||||||
|
"version": "2.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
|
||||||
|
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
|
||||||
|
"requires": {
|
||||||
|
"bytes": "3.1.0",
|
||||||
|
"http-errors": "1.7.2",
|
||||||
|
"iconv-lite": "0.4.24",
|
||||||
|
"unpipe": "1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"safe-buffer": {
|
||||||
|
"version": "5.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||||
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||||
|
},
|
||||||
|
"safer-buffer": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||||
|
},
|
||||||
|
"sax": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz",
|
||||||
|
"integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
|
||||||
|
},
|
||||||
|
"send": {
|
||||||
|
"version": "0.17.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
|
||||||
|
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "~1.1.2",
|
||||||
|
"destroy": "~1.0.4",
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"etag": "~1.8.1",
|
||||||
|
"fresh": "0.5.2",
|
||||||
|
"http-errors": "~1.7.2",
|
||||||
|
"mime": "1.6.0",
|
||||||
|
"ms": "2.1.1",
|
||||||
|
"on-finished": "~2.3.0",
|
||||||
|
"range-parser": "~1.2.1",
|
||||||
|
"statuses": "~1.5.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ms": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve-static": {
|
||||||
|
"version": "1.14.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
|
||||||
|
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
|
||||||
|
"requires": {
|
||||||
|
"encodeurl": "~1.0.2",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"send": "0.17.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"setprototypeof": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
|
||||||
|
},
|
||||||
|
"simple-oauth2": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/simple-oauth2/-/simple-oauth2-4.2.0.tgz",
|
||||||
|
"integrity": "sha512-AV62tGdq9JfLd/uveKpeNtQl+VVm89a35QKlwGuvisYIjCoz2ZmTGRGuSIGiYr+QUhSKJ5kYN1jq2BBa/ac/GQ==",
|
||||||
|
"requires": {
|
||||||
|
"@hapi/hoek": "^9.0.4",
|
||||||
|
"@hapi/wreck": "^17.0.0",
|
||||||
|
"debug": "^4.1.1",
|
||||||
|
"joi": "^17.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"statuses": {
|
||||||
|
"version": "1.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
||||||
|
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
|
||||||
|
},
|
||||||
|
"toidentifier": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
|
||||||
|
},
|
||||||
|
"type-is": {
|
||||||
|
"version": "1.6.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||||
|
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||||
|
"requires": {
|
||||||
|
"media-typer": "0.3.0",
|
||||||
|
"mime-types": "~2.1.24"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unpipe": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"version": "0.10.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz",
|
||||||
|
"integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=",
|
||||||
|
"requires": {
|
||||||
|
"punycode": "1.3.2",
|
||||||
|
"querystring": "0.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"utils-merge": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"version": "3.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||||
|
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
|
||||||
|
},
|
||||||
|
"vary": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
|
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
||||||
|
},
|
||||||
|
"xml2js": {
|
||||||
|
"version": "0.4.19",
|
||||||
|
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
|
||||||
|
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
|
||||||
|
"requires": {
|
||||||
|
"sax": ">=0.6.0",
|
||||||
|
"xmlbuilder": "~9.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xmlbuilder": {
|
||||||
|
"version": "9.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
|
||||||
|
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
20
amplify/backend/function/authFunction/src/package.json
Normal file
20
amplify/backend/function/authFunction/src/package.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "authFunction",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"dependencies": {
|
||||||
|
"aws-sdk": "^2.796.0",
|
||||||
|
"aws-serverless-express": "^3.3.5",
|
||||||
|
"body-parser": "^1.17.1",
|
||||||
|
"express": "^4.15.2",
|
||||||
|
"randomstring": "^1.1.5",
|
||||||
|
"simple-oauth2": "^4.2.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
3
amplify/backend/hosting/S3AndCloudFront/parameters.json
Normal file
3
amplify/backend/hosting/S3AndCloudFront/parameters.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"bucketName": "michalvankodev-20190712100852-hostingbucket"
|
||||||
|
}
|
113
amplify/backend/hosting/S3AndCloudFront/template.json
Normal file
113
amplify/backend/hosting/S3AndCloudFront/template.json
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
{
|
||||||
|
"AWSTemplateFormatVersion": "2010-09-09",
|
||||||
|
"Description": "Hosting resource stack creation using Amplify CLI",
|
||||||
|
"Parameters": {
|
||||||
|
"env": {
|
||||||
|
"Type": "String"
|
||||||
|
},
|
||||||
|
"bucketName": {
|
||||||
|
"Type": "String"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Conditions": {
|
||||||
|
"ShouldNotCreateEnvResources": {
|
||||||
|
"Fn::Equals": [
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
},
|
||||||
|
"NONE"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Resources": {
|
||||||
|
"S3Bucket": {
|
||||||
|
"Type": "AWS::S3::Bucket",
|
||||||
|
"DeletionPolicy": "Retain",
|
||||||
|
"Properties": {
|
||||||
|
"BucketName": {
|
||||||
|
"Fn::If": [
|
||||||
|
"ShouldNotCreateEnvResources",
|
||||||
|
{
|
||||||
|
"Ref": "bucketName"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"Ref": "bucketName"
|
||||||
|
},
|
||||||
|
"-",
|
||||||
|
{
|
||||||
|
"Ref": "env"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"AccessControl": "Private",
|
||||||
|
"WebsiteConfiguration": {
|
||||||
|
"IndexDocument": "index.html",
|
||||||
|
"ErrorDocument": "index.html"
|
||||||
|
},
|
||||||
|
"CorsConfiguration": {
|
||||||
|
"CorsRules": [
|
||||||
|
{
|
||||||
|
"AllowedHeaders": [
|
||||||
|
"Authorization",
|
||||||
|
"Content-Length"
|
||||||
|
],
|
||||||
|
"AllowedMethods": [
|
||||||
|
"GET"
|
||||||
|
],
|
||||||
|
"AllowedOrigins": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"MaxAge": 3000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Outputs": {
|
||||||
|
"Region": {
|
||||||
|
"Value": {
|
||||||
|
"Ref": "AWS::Region"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"HostingBucketName": {
|
||||||
|
"Description": "Hosting bucket name",
|
||||||
|
"Value": {
|
||||||
|
"Ref": "S3Bucket"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WebsiteURL": {
|
||||||
|
"Value": {
|
||||||
|
"Fn::GetAtt": [
|
||||||
|
"S3Bucket",
|
||||||
|
"WebsiteURL"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Description": "URL for website hosted on S3"
|
||||||
|
},
|
||||||
|
"S3BucketSecureURL": {
|
||||||
|
"Value": {
|
||||||
|
"Fn::Join": [
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"https://",
|
||||||
|
{
|
||||||
|
"Fn::GetAtt": [
|
||||||
|
"S3Bucket",
|
||||||
|
"DomainName"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Description": "Name of S3 bucket to hold website content"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@ backend:
|
|||||||
repo: michalvankodev/michalvankodev
|
repo: michalvankodev/michalvankodev
|
||||||
branch: master # Branch to update (optional; defaults to master)
|
branch: master # Branch to update (optional; defaults to master)
|
||||||
site_domain: michalvanko.dev
|
site_domain: michalvanko.dev
|
||||||
base_url: https://michalvanko.dev
|
base_url: https://477w9ll6s6.execute-api.eu-central-1.amazonaws.com/master/
|
||||||
|
|
||||||
media_folder: 'static/images/uploads' # Media files will be stored in the repo under images/uploads
|
media_folder: 'static/images/uploads' # Media files will be stored in the repo under images/uploads
|
||||||
public_folder: '/images/uploads' # The src attribute for uploaded media will begin with /images/uploads
|
public_folder: '/images/uploads' # The src attribute for uploaded media will begin with /images/uploads
|
||||||
|
Loading…
Reference in New Issue
Block a user