├── .gitignore ├── LICENSE.txt ├── README.md ├── api.yaml ├── client-ts ├── babel.config.js ├── jest.config.js └── tests │ └── api.test.ts ├── events └── event.json ├── guestbook ├── .npmignore ├── app.js ├── package-lock.json ├── package.json ├── rbac.js └── tests │ └── unit │ └── test-handler.js ├── template-cognito.yaml └── template.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/osx,node,linux,windows 3 | 4 | ### Linux ### 5 | *~ 6 | 7 | # temporary files which can be created if a process still has a handle open of a deleted file 8 | .fuse_hidden* 9 | 10 | # KDE directory preferences 11 | .directory 12 | 13 | # Linux trash folder which might appear on any partition or disk 14 | .Trash-* 15 | 16 | # .nfs files are created when an open file is removed but is still being accessed 17 | .nfs* 18 | 19 | ### Node ### 20 | # Logs 21 | logs 22 | *.log 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # Runtime data 28 | pids 29 | *.pid 30 | *.seed 31 | *.pid.lock 32 | 33 | # Directory for instrumented libs generated by jscoverage/JSCover 34 | lib-cov 35 | 36 | # Coverage directory used by tools like istanbul 37 | coverage 38 | 39 | # nyc test coverage 40 | .nyc_output 41 | 42 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 43 | .grunt 44 | 45 | # Bower dependency directory (https://bower.io/) 46 | bower_components 47 | 48 | # node-waf configuration 49 | .lock-wscript 50 | 51 | # Compiled binary addons (http://nodejs.org/api/addons.html) 52 | build/Release 53 | 54 | # Dependency directories 55 | node_modules/ 56 | jspm_packages/ 57 | 58 | # Typescript v1 declaration files 59 | typings/ 60 | 61 | # Optional npm cache directory 62 | .npm 63 | 64 | # Optional eslint cache 65 | .eslintcache 66 | 67 | # Optional REPL history 68 | .node_repl_history 69 | 70 | # Output of 'npm pack' 71 | *.tgz 72 | 73 | # Yarn Integrity file 74 | .yarn-integrity 75 | 76 | # dotenv environment variables file 77 | .env 78 | 79 | 80 | ### OSX ### 81 | *.DS_Store 82 | .AppleDouble 83 | .LSOverride 84 | 85 | # Icon must end with two \r 86 | Icon 87 | 88 | # Thumbnails 89 | ._* 90 | 91 | # Files that might appear in the root of a volume 92 | .DocumentRevisions-V100 93 | .fseventsd 94 | .Spotlight-V100 95 | .TemporaryItems 96 | .Trashes 97 | .VolumeIcon.icns 98 | .com.apple.timemachine.donotpresent 99 | 100 | # Directories potentially created on remote AFP share 101 | .AppleDB 102 | .AppleDesktop 103 | Network Trash Folder 104 | Temporary Items 105 | .apdisk 106 | 107 | ### Windows ### 108 | # Windows thumbnail cache files 109 | Thumbs.db 110 | ehthumbs.db 111 | ehthumbs_vista.db 112 | 113 | # Folder config file 114 | Desktop.ini 115 | 116 | # Recycle Bin used on file shares 117 | $RECYCLE.BIN/ 118 | 119 | # Windows Installer files 120 | *.cab 121 | *.msi 122 | *.msm 123 | *.msp 124 | 125 | # Windows shortcuts 126 | *.lnk 127 | 128 | .aws-sam/ 129 | 130 | 131 | # End of https://www.gitignore.io/api/osx,node,linux,windows -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # simple-node-api 2 | 3 | This repository houses a SAM template for an API which is used read/write comments to a guestbook -------------------------------------------------------------------------------- /api.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | title: simple-node-api 4 | description: A simple API for a guestbook application 5 | version: 2019-10-13 6 | paths: 7 | /: 8 | post: 9 | operationId: CreateMessage 10 | requestBody: 11 | content: 12 | text/plain: 13 | schema: 14 | type: string 15 | required: true 16 | responses: 17 | "201": 18 | description: "Successfully created a message." 19 | content: 20 | application/json: 21 | schema: 22 | $ref: "#/components/schemas/Message" 23 | "400": 24 | description: "Bad Request Exception" 25 | content: 26 | application/json: 27 | schema: 28 | $ref: "#/components/schemas/BadRequestException" 29 | "500": 30 | description: "Internal Server Error" 31 | content: 32 | application/json: 33 | schema: 34 | $ref: "#/components/schemas/InternalServerErrorException" 35 | get: 36 | operationId: ListMessages 37 | parameters: 38 | - name: maxItems 39 | in: query 40 | required: false 41 | schema: 42 | type: number 43 | - name: token 44 | in: query 45 | required: false 46 | schema: 47 | type: string 48 | responses: 49 | "200": 50 | description: "Successfully listed messages." 51 | content: 52 | application/json: 53 | schema: 54 | $ref: "#/components/schemas/MessageList" 55 | "400": 56 | description: "Bad Request Exception" 57 | content: 58 | application/json: 59 | schema: 60 | $ref: "#/components/schemas/BadRequestException" 61 | "500": 62 | description: "Internal Server Error" 63 | content: 64 | application/json: 65 | schema: 66 | $ref: "#/components/schemas/InternalServerErrorException" 67 | components: 68 | schemas: 69 | Message: 70 | type: object 71 | properties: 72 | message: 73 | type: string 74 | author: 75 | type: string 76 | date: 77 | type: string 78 | format: date-time 79 | MessageList: 80 | type: object 81 | properties: 82 | items: 83 | type: array 84 | items: 85 | $ref: "#/components/schemas/Message" 86 | nextToken: 87 | type: string 88 | required: 89 | - items 90 | BadRequestException: 91 | type: object 92 | properties: 93 | message: 94 | type: string 95 | errorCode: 96 | type: string 97 | InternalServerErrorException: 98 | type: object 99 | properties: 100 | message: 101 | type: string 102 | errorCode: 103 | type: string -------------------------------------------------------------------------------- /client-ts/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "plugins": [ 3 | "@babel/proposal-class-properties", 4 | ], 5 | "presets": [ 6 | [ 7 | "@babel/env", { 8 | "targets": { 9 | "node": "current", 10 | }, 11 | "modules": "commonjs", 12 | }, 13 | ], 14 | "@babel/typescript", 15 | ] 16 | } -------------------------------------------------------------------------------- /client-ts/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: {}, 3 | testEnvironment: "node", 4 | testRegex: "/tests/.*\.(test|integration|accept)\.(ts|tsx)$", 5 | moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], 6 | }; -------------------------------------------------------------------------------- /client-ts/tests/api.test.ts: -------------------------------------------------------------------------------- 1 | import { DefaultApi } from "../src/api"; 2 | import axios from "axios"; 3 | 4 | 5 | describe("Test My API: Create 3 messages", () => { 6 | const instance = axios.create({ 7 | headers: { 8 | Authorization: process.env['TOKEN'] 9 | } 10 | }) 11 | 12 | const api = new DefaultApi({}, 13 | process.env["ENDPOINT"], 14 | instance 15 | ); 16 | 17 | const messages = [ 18 | "message 1", 19 | "message 2", 20 | "message 3" 21 | ]; 22 | 23 | beforeEach(async (done) => { 24 | for (const message of messages) { 25 | await api.createMessage(message); 26 | } 27 | done(); 28 | }); 29 | 30 | it("should return messages", async (done) => { 31 | const { data } = await api.listMessages(3); 32 | expect(data.items.length).toBe(3); 33 | 34 | expect(data.items).toEqual( 35 | expect.arrayContaining( 36 | messages.map(message => expect.objectContaining({ 37 | message, 38 | author: expect.anything(), 39 | date: expect.anything() 40 | })) 41 | )); 42 | done(); 43 | }); 44 | }) -------------------------------------------------------------------------------- /events/event.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": "{\"message\": \"hello world\"}", 3 | "resource": "/{proxy+}", 4 | "path": "/path/to/resource", 5 | "httpMethod": "POST", 6 | "isBase64Encoded": false, 7 | "queryStringParameters": { 8 | "foo": "bar" 9 | }, 10 | "pathParameters": { 11 | "proxy": "/path/to/resource" 12 | }, 13 | "stageVariables": { 14 | "baz": "qux" 15 | }, 16 | "headers": { 17 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", 18 | "Accept-Encoding": "gzip, deflate, sdch", 19 | "Accept-Language": "en-US,en;q=0.8", 20 | "Cache-Control": "max-age=0", 21 | "CloudFront-Forwarded-Proto": "https", 22 | "CloudFront-Is-Desktop-Viewer": "true", 23 | "CloudFront-Is-Mobile-Viewer": "false", 24 | "CloudFront-Is-SmartTV-Viewer": "false", 25 | "CloudFront-Is-Tablet-Viewer": "false", 26 | "CloudFront-Viewer-Country": "US", 27 | "Host": "1234567890.execute-api.us-east-1.amazonaws.com", 28 | "Upgrade-Insecure-Requests": "1", 29 | "User-Agent": "Custom User Agent String", 30 | "Via": "1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)", 31 | "X-Amz-Cf-Id": "cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA==", 32 | "X-Forwarded-For": "127.0.0.1, 127.0.0.2", 33 | "X-Forwarded-Port": "443", 34 | "X-Forwarded-Proto": "https" 35 | }, 36 | "requestContext": { 37 | "accountId": "123456789012", 38 | "resourceId": "123456", 39 | "stage": "prod", 40 | "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef", 41 | "requestTime": "09/Apr/2015:12:34:56 +0000", 42 | "requestTimeEpoch": 1428582896000, 43 | "identity": { 44 | "cognitoIdentityPoolId": null, 45 | "accountId": null, 46 | "cognitoIdentityId": null, 47 | "caller": null, 48 | "accessKey": null, 49 | "sourceIp": "127.0.0.1", 50 | "cognitoAuthenticationType": null, 51 | "cognitoAuthenticationProvider": null, 52 | "userArn": null, 53 | "userAgent": "Custom User Agent String", 54 | "user": null 55 | }, 56 | "path": "/prod/path/to/resource", 57 | "resourcePath": "/{proxy+}", 58 | "httpMethod": "POST", 59 | "apiId": "1234567890", 60 | "protocol": "HTTP/1.1" 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /guestbook/.npmignore: -------------------------------------------------------------------------------- 1 | tests/* 2 | -------------------------------------------------------------------------------- /guestbook/app.js: -------------------------------------------------------------------------------- 1 | const serverless = require('serverless-http'); 2 | const express = require('express'); 3 | const s3 = require('aws-sdk/clients/s3'); 4 | const v5 = require('uuid/v5'); 5 | const env = require('env-var'); 6 | const bodyParser = require('body-parser'); 7 | const rbac = require('./rbac'); 8 | const jwt = require('jsonwebtoken') 9 | 10 | const app = new express(); 11 | 12 | const plainTextParser = bodyParser.text(); 13 | 14 | const methodToAction = { 15 | GET: 'read', 16 | PUT: 'write', 17 | POST: 'write', 18 | DELETE: 'delete' 19 | } 20 | 21 | app.use((req, res, next) => { 22 | const token = req.headers['authorization']; 23 | const decoded = jwt.decode(token, { json: true }); 24 | const { sub } = decoded; 25 | const groups = decoded['cognito:groups'] || []; 26 | const { path: obj } = req; 27 | const act = methodToAction[req.method]; 28 | console.log({ sub, obj, act}); 29 | console.log(sub, groups); 30 | rbac.addRolesToUser(sub, groups).then(() => { 31 | rbac.enforce(sub, obj, act) 32 | .then(pass => { 33 | if (pass) { 34 | next() 35 | } else { 36 | res.status(403).json({ message: 'Forbidden' }); 37 | } 38 | }) 39 | }) 40 | .catch(err => { 41 | console.log(err); 42 | throw err; 43 | }); 44 | }); 45 | 46 | app.use((err, req, res, next) => { 47 | console.log(err); 48 | res.status(500).json({ message: 'Internal Server Error'}); 49 | }); 50 | 51 | function newS3Client() { 52 | return new s3({ params: { Bucket: env.get('BUCKET').required().asString() } }); 53 | } 54 | 55 | function getAuthor() { 56 | return 'anonymous'; 57 | } 58 | 59 | app.get('/', async (req, res) => { 60 | const client = newS3Client(); 61 | const maxItems = req.query.maxItems || 20; 62 | const token = req.query.token; 63 | res.status(200).json(await getMessages(client, parseInt(maxItems), token)); 64 | }); 65 | 66 | app.post('/', plainTextParser, async ({ body: message }, res) => { 67 | const client = newS3Client(); 68 | const entry = await writeMessage(client, message, getAuthor()); 69 | res.status(201).json(entry); 70 | }); 71 | 72 | function ninesComplement(date) { 73 | return date.toISOString().split('') 74 | .map(c => { 75 | const n = parseInt(c); 76 | if (isNaN(n)) return c; 77 | else return (9 - n).toString() 78 | }).join(''); 79 | } 80 | 81 | async function writeMessage(client, message, author) { 82 | const namespace = v5(author, v5.URL); 83 | const id = v5(message, namespace); 84 | const date = new Date(); 85 | const Key = `${ninesComplement(date)}/${id}`; 86 | const body = { message, date: date.toISOString(), author }; 87 | await client.putObject({ Key, Body: JSON.stringify(body) }).promise(); 88 | return body; 89 | } 90 | 91 | async function getMessages(client, maxItems, token) { 92 | const { Contents, NextContinuationToken } = await client.listObjectsV2({ 93 | MaxKeys: maxItems, 94 | ContinuationToken: token ? 95 | Buffer.from(token, 'base64').toString('ascii') : undefined 96 | }).promise(); 97 | 98 | const res = await Promise.all(Contents 99 | .map(({ Key }) => client.getObject({ Key }).promise())); 100 | 101 | return { 102 | items: res.map(({ Body }) => JSON.parse(Body)), 103 | nextToken: NextContinuationToken ? 104 | Buffer.from(NextContinuationToken, 'ascii').toString('base64') : undefined 105 | } 106 | } 107 | 108 | module.exports.lambdaHandler = serverless(app); 109 | -------------------------------------------------------------------------------- /guestbook/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello_world", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/aws-lambda": { 8 | "version": "8.10.23", 9 | "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.23.tgz", 10 | "integrity": "sha512-erfexxfuc1+T7b4OswooKwpIjpdgEOVz6ZrDDWSR+3v7Kjhs4EVowfUkF9KuLKhpcjz+VVHQ/pWIl7zSVbKbFQ==", 11 | "optional": true 12 | }, 13 | "accepts": { 14 | "version": "1.3.7", 15 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 16 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 17 | "requires": { 18 | "mime-types": "~2.1.24", 19 | "negotiator": "0.6.2" 20 | } 21 | }, 22 | "ansi-colors": { 23 | "version": "3.2.3", 24 | "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", 25 | "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", 26 | "dev": true 27 | }, 28 | "ansi-regex": { 29 | "version": "3.0.0", 30 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 31 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", 32 | "dev": true 33 | }, 34 | "ansi-styles": { 35 | "version": "3.2.1", 36 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 37 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 38 | "dev": true, 39 | "requires": { 40 | "color-convert": "^1.9.0" 41 | } 42 | }, 43 | "argparse": { 44 | "version": "1.0.10", 45 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 46 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 47 | "dev": true, 48 | "requires": { 49 | "sprintf-js": "~1.0.2" 50 | } 51 | }, 52 | "array-flatten": { 53 | "version": "1.1.1", 54 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 55 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 56 | }, 57 | "assertion-error": { 58 | "version": "1.1.0", 59 | "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", 60 | "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", 61 | "dev": true 62 | }, 63 | "aws-sdk": { 64 | "version": "2.594.0", 65 | "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.594.0.tgz", 66 | "integrity": "sha512-z6PTM6Tz+UHB5o/5cG63E5san9788mSRH/7A7Qz0hNC4nVe9GlKrPcgf3+bceaP8YB0hf1TJ51Ki3BhkM9nfKg==", 67 | "requires": { 68 | "buffer": "4.9.1", 69 | "events": "1.1.1", 70 | "ieee754": "1.1.13", 71 | "jmespath": "0.15.0", 72 | "querystring": "0.2.0", 73 | "sax": "1.2.1", 74 | "url": "0.10.3", 75 | "uuid": "3.3.2", 76 | "xml2js": "0.4.19" 77 | }, 78 | "dependencies": { 79 | "uuid": { 80 | "version": "3.3.2", 81 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 82 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 83 | } 84 | } 85 | }, 86 | "axios": { 87 | "version": "0.18.1", 88 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz", 89 | "integrity": "sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==", 90 | "requires": { 91 | "follow-redirects": "1.5.10", 92 | "is-buffer": "^2.0.2" 93 | } 94 | }, 95 | "balanced-match": { 96 | "version": "1.0.0", 97 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 98 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 99 | "dev": true 100 | }, 101 | "base64-js": { 102 | "version": "1.3.0", 103 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", 104 | "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" 105 | }, 106 | "body-parser": { 107 | "version": "1.19.0", 108 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 109 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 110 | "requires": { 111 | "bytes": "3.1.0", 112 | "content-type": "~1.0.4", 113 | "debug": "2.6.9", 114 | "depd": "~1.1.2", 115 | "http-errors": "1.7.2", 116 | "iconv-lite": "0.4.24", 117 | "on-finished": "~2.3.0", 118 | "qs": "6.7.0", 119 | "raw-body": "2.4.0", 120 | "type-is": "~1.6.17" 121 | } 122 | }, 123 | "brace-expansion": { 124 | "version": "1.1.11", 125 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 126 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 127 | "dev": true, 128 | "requires": { 129 | "balanced-match": "^1.0.0", 130 | "concat-map": "0.0.1" 131 | } 132 | }, 133 | "browser-stdout": { 134 | "version": "1.3.1", 135 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 136 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 137 | "dev": true 138 | }, 139 | "buffer": { 140 | "version": "4.9.1", 141 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", 142 | "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", 143 | "requires": { 144 | "base64-js": "^1.0.2", 145 | "ieee754": "^1.1.4", 146 | "isarray": "^1.0.0" 147 | } 148 | }, 149 | "buffer-equal-constant-time": { 150 | "version": "1.0.1", 151 | "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", 152 | "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" 153 | }, 154 | "bytes": { 155 | "version": "3.1.0", 156 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 157 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 158 | }, 159 | "camelcase": { 160 | "version": "5.3.1", 161 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", 162 | "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", 163 | "dev": true 164 | }, 165 | "casbin": { 166 | "version": "3.0.4", 167 | "resolved": "https://registry.npmjs.org/casbin/-/casbin-3.0.4.tgz", 168 | "integrity": "sha512-k85OHmJmASxg7d16Ml8jJ/Q+D7hxslz++zxwtCUeNTH6rZCQcW+/NwUH6ankfTx2KCcGXQtSufSm/1vodPhb0Q==", 169 | "requires": { 170 | "expression-eval": "^2.0.0", 171 | "ip": "^1.1.5", 172 | "lodash": "^4.17.15" 173 | } 174 | }, 175 | "chai": { 176 | "version": "4.2.0", 177 | "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", 178 | "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", 179 | "dev": true, 180 | "requires": { 181 | "assertion-error": "^1.1.0", 182 | "check-error": "^1.0.2", 183 | "deep-eql": "^3.0.1", 184 | "get-func-name": "^2.0.0", 185 | "pathval": "^1.1.0", 186 | "type-detect": "^4.0.5" 187 | } 188 | }, 189 | "chalk": { 190 | "version": "2.4.2", 191 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 192 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 193 | "dev": true, 194 | "requires": { 195 | "ansi-styles": "^3.2.1", 196 | "escape-string-regexp": "^1.0.5", 197 | "supports-color": "^5.3.0" 198 | }, 199 | "dependencies": { 200 | "supports-color": { 201 | "version": "5.5.0", 202 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 203 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 204 | "dev": true, 205 | "requires": { 206 | "has-flag": "^3.0.0" 207 | } 208 | } 209 | } 210 | }, 211 | "check-error": { 212 | "version": "1.0.2", 213 | "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", 214 | "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", 215 | "dev": true 216 | }, 217 | "cliui": { 218 | "version": "4.1.0", 219 | "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", 220 | "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", 221 | "dev": true, 222 | "requires": { 223 | "string-width": "^2.1.1", 224 | "strip-ansi": "^4.0.0", 225 | "wrap-ansi": "^2.0.0" 226 | } 227 | }, 228 | "code-point-at": { 229 | "version": "1.1.0", 230 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 231 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", 232 | "dev": true 233 | }, 234 | "color-convert": { 235 | "version": "1.9.3", 236 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 237 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 238 | "dev": true, 239 | "requires": { 240 | "color-name": "1.1.3" 241 | } 242 | }, 243 | "color-name": { 244 | "version": "1.1.3", 245 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 246 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 247 | "dev": true 248 | }, 249 | "concat-map": { 250 | "version": "0.0.1", 251 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 252 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 253 | "dev": true 254 | }, 255 | "content-disposition": { 256 | "version": "0.5.3", 257 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 258 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 259 | "requires": { 260 | "safe-buffer": "5.1.2" 261 | } 262 | }, 263 | "content-type": { 264 | "version": "1.0.4", 265 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 266 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 267 | }, 268 | "cookie": { 269 | "version": "0.4.0", 270 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 271 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 272 | }, 273 | "cookie-signature": { 274 | "version": "1.0.6", 275 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 276 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 277 | }, 278 | "cross-spawn": { 279 | "version": "6.0.5", 280 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", 281 | "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", 282 | "dev": true, 283 | "requires": { 284 | "nice-try": "^1.0.4", 285 | "path-key": "^2.0.1", 286 | "semver": "^5.5.0", 287 | "shebang-command": "^1.2.0", 288 | "which": "^1.2.9" 289 | } 290 | }, 291 | "debug": { 292 | "version": "2.6.9", 293 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 294 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 295 | "requires": { 296 | "ms": "2.0.0" 297 | } 298 | }, 299 | "decamelize": { 300 | "version": "1.2.0", 301 | "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", 302 | "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", 303 | "dev": true 304 | }, 305 | "deep-eql": { 306 | "version": "3.0.1", 307 | "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", 308 | "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", 309 | "dev": true, 310 | "requires": { 311 | "type-detect": "^4.0.0" 312 | } 313 | }, 314 | "define-properties": { 315 | "version": "1.1.3", 316 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 317 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", 318 | "dev": true, 319 | "requires": { 320 | "object-keys": "^1.0.12" 321 | } 322 | }, 323 | "depd": { 324 | "version": "1.1.2", 325 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 326 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 327 | }, 328 | "destroy": { 329 | "version": "1.0.4", 330 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 331 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 332 | }, 333 | "diff": { 334 | "version": "3.5.0", 335 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 336 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 337 | "dev": true 338 | }, 339 | "ecdsa-sig-formatter": { 340 | "version": "1.0.11", 341 | "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", 342 | "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", 343 | "requires": { 344 | "safe-buffer": "^5.0.1" 345 | } 346 | }, 347 | "ee-first": { 348 | "version": "1.1.1", 349 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 350 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 351 | }, 352 | "emoji-regex": { 353 | "version": "7.0.3", 354 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", 355 | "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", 356 | "dev": true 357 | }, 358 | "encodeurl": { 359 | "version": "1.0.2", 360 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 361 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 362 | }, 363 | "end-of-stream": { 364 | "version": "1.4.1", 365 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", 366 | "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", 367 | "dev": true, 368 | "requires": { 369 | "once": "^1.4.0" 370 | } 371 | }, 372 | "env-var": { 373 | "version": "4.0.1", 374 | "resolved": "https://registry.npmjs.org/env-var/-/env-var-4.0.1.tgz", 375 | "integrity": "sha512-A/v9K2hSsxA36aHD+pZOUHi7bullFsq4D+Tt7GaTBG3+/Exmhckwx6A7Lb+UaDFfziN9ilNH3Uizt0ffPgHSIA==", 376 | "requires": { 377 | "is-url": "~1.2.2" 378 | } 379 | }, 380 | "es-abstract": { 381 | "version": "1.13.0", 382 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", 383 | "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", 384 | "dev": true, 385 | "requires": { 386 | "es-to-primitive": "^1.2.0", 387 | "function-bind": "^1.1.1", 388 | "has": "^1.0.3", 389 | "is-callable": "^1.1.4", 390 | "is-regex": "^1.0.4", 391 | "object-keys": "^1.0.12" 392 | } 393 | }, 394 | "es-to-primitive": { 395 | "version": "1.2.0", 396 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", 397 | "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", 398 | "dev": true, 399 | "requires": { 400 | "is-callable": "^1.1.4", 401 | "is-date-object": "^1.0.1", 402 | "is-symbol": "^1.0.2" 403 | } 404 | }, 405 | "escape-html": { 406 | "version": "1.0.3", 407 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 408 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 409 | }, 410 | "escape-string-regexp": { 411 | "version": "1.0.5", 412 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 413 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 414 | "dev": true 415 | }, 416 | "esprima": { 417 | "version": "4.0.1", 418 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 419 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 420 | "dev": true 421 | }, 422 | "etag": { 423 | "version": "1.8.1", 424 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 425 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 426 | }, 427 | "events": { 428 | "version": "1.1.1", 429 | "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", 430 | "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" 431 | }, 432 | "execa": { 433 | "version": "1.0.0", 434 | "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", 435 | "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", 436 | "dev": true, 437 | "requires": { 438 | "cross-spawn": "^6.0.0", 439 | "get-stream": "^4.0.0", 440 | "is-stream": "^1.1.0", 441 | "npm-run-path": "^2.0.0", 442 | "p-finally": "^1.0.0", 443 | "signal-exit": "^3.0.0", 444 | "strip-eof": "^1.0.0" 445 | } 446 | }, 447 | "express": { 448 | "version": "4.17.1", 449 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 450 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 451 | "requires": { 452 | "accepts": "~1.3.7", 453 | "array-flatten": "1.1.1", 454 | "body-parser": "1.19.0", 455 | "content-disposition": "0.5.3", 456 | "content-type": "~1.0.4", 457 | "cookie": "0.4.0", 458 | "cookie-signature": "1.0.6", 459 | "debug": "2.6.9", 460 | "depd": "~1.1.2", 461 | "encodeurl": "~1.0.2", 462 | "escape-html": "~1.0.3", 463 | "etag": "~1.8.1", 464 | "finalhandler": "~1.1.2", 465 | "fresh": "0.5.2", 466 | "merge-descriptors": "1.0.1", 467 | "methods": "~1.1.2", 468 | "on-finished": "~2.3.0", 469 | "parseurl": "~1.3.3", 470 | "path-to-regexp": "0.1.7", 471 | "proxy-addr": "~2.0.5", 472 | "qs": "6.7.0", 473 | "range-parser": "~1.2.1", 474 | "safe-buffer": "5.1.2", 475 | "send": "0.17.1", 476 | "serve-static": "1.14.1", 477 | "setprototypeof": "1.1.1", 478 | "statuses": "~1.5.0", 479 | "type-is": "~1.6.18", 480 | "utils-merge": "1.0.1", 481 | "vary": "~1.1.2" 482 | } 483 | }, 484 | "expression-eval": { 485 | "version": "2.0.0", 486 | "resolved": "https://registry.npmjs.org/expression-eval/-/expression-eval-2.0.0.tgz", 487 | "integrity": "sha512-8cFzfco37CdZQd4DTyZ+ncxQtPUTE0dcxvbGXYc17Ji+3MQSBkT+11GdfC7eO2duvLNuWjN7Ejqb0kLX/u2bBw==", 488 | "requires": { 489 | "jsep": "^0.3.0" 490 | } 491 | }, 492 | "finalhandler": { 493 | "version": "1.1.2", 494 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 495 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 496 | "requires": { 497 | "debug": "2.6.9", 498 | "encodeurl": "~1.0.2", 499 | "escape-html": "~1.0.3", 500 | "on-finished": "~2.3.0", 501 | "parseurl": "~1.3.3", 502 | "statuses": "~1.5.0", 503 | "unpipe": "~1.0.0" 504 | } 505 | }, 506 | "find-up": { 507 | "version": "3.0.0", 508 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", 509 | "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", 510 | "dev": true, 511 | "requires": { 512 | "locate-path": "^3.0.0" 513 | } 514 | }, 515 | "flat": { 516 | "version": "4.1.0", 517 | "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", 518 | "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", 519 | "dev": true, 520 | "requires": { 521 | "is-buffer": "~2.0.3" 522 | } 523 | }, 524 | "follow-redirects": { 525 | "version": "1.5.10", 526 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", 527 | "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", 528 | "requires": { 529 | "debug": "=3.1.0" 530 | }, 531 | "dependencies": { 532 | "debug": { 533 | "version": "3.1.0", 534 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 535 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 536 | "requires": { 537 | "ms": "2.0.0" 538 | } 539 | } 540 | } 541 | }, 542 | "forwarded": { 543 | "version": "0.1.2", 544 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 545 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 546 | }, 547 | "fresh": { 548 | "version": "0.5.2", 549 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 550 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 551 | }, 552 | "fs.realpath": { 553 | "version": "1.0.0", 554 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 555 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 556 | "dev": true 557 | }, 558 | "function-bind": { 559 | "version": "1.1.1", 560 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 561 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", 562 | "dev": true 563 | }, 564 | "get-caller-file": { 565 | "version": "2.0.5", 566 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", 567 | "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", 568 | "dev": true 569 | }, 570 | "get-func-name": { 571 | "version": "2.0.0", 572 | "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", 573 | "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", 574 | "dev": true 575 | }, 576 | "get-stream": { 577 | "version": "4.1.0", 578 | "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", 579 | "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", 580 | "dev": true, 581 | "requires": { 582 | "pump": "^3.0.0" 583 | } 584 | }, 585 | "glob": { 586 | "version": "7.1.3", 587 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", 588 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", 589 | "dev": true, 590 | "requires": { 591 | "fs.realpath": "^1.0.0", 592 | "inflight": "^1.0.4", 593 | "inherits": "2", 594 | "minimatch": "^3.0.4", 595 | "once": "^1.3.0", 596 | "path-is-absolute": "^1.0.0" 597 | } 598 | }, 599 | "growl": { 600 | "version": "1.10.5", 601 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", 602 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", 603 | "dev": true 604 | }, 605 | "has": { 606 | "version": "1.0.3", 607 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 608 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 609 | "dev": true, 610 | "requires": { 611 | "function-bind": "^1.1.1" 612 | } 613 | }, 614 | "has-flag": { 615 | "version": "3.0.0", 616 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 617 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 618 | "dev": true 619 | }, 620 | "has-symbols": { 621 | "version": "1.0.0", 622 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", 623 | "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", 624 | "dev": true 625 | }, 626 | "he": { 627 | "version": "1.2.0", 628 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 629 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", 630 | "dev": true 631 | }, 632 | "http-errors": { 633 | "version": "1.7.2", 634 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 635 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 636 | "requires": { 637 | "depd": "~1.1.2", 638 | "inherits": "2.0.3", 639 | "setprototypeof": "1.1.1", 640 | "statuses": ">= 1.5.0 < 2", 641 | "toidentifier": "1.0.0" 642 | } 643 | }, 644 | "iconv-lite": { 645 | "version": "0.4.24", 646 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 647 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 648 | "requires": { 649 | "safer-buffer": ">= 2.1.2 < 3" 650 | } 651 | }, 652 | "ieee754": { 653 | "version": "1.1.13", 654 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", 655 | "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" 656 | }, 657 | "inflight": { 658 | "version": "1.0.6", 659 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 660 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 661 | "dev": true, 662 | "requires": { 663 | "once": "^1.3.0", 664 | "wrappy": "1" 665 | } 666 | }, 667 | "inherits": { 668 | "version": "2.0.3", 669 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 670 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 671 | }, 672 | "invert-kv": { 673 | "version": "2.0.0", 674 | "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", 675 | "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", 676 | "dev": true 677 | }, 678 | "ip": { 679 | "version": "1.1.5", 680 | "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", 681 | "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" 682 | }, 683 | "ipaddr.js": { 684 | "version": "1.9.0", 685 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", 686 | "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" 687 | }, 688 | "is-buffer": { 689 | "version": "2.0.3", 690 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", 691 | "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==" 692 | }, 693 | "is-callable": { 694 | "version": "1.1.4", 695 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", 696 | "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", 697 | "dev": true 698 | }, 699 | "is-date-object": { 700 | "version": "1.0.1", 701 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", 702 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", 703 | "dev": true 704 | }, 705 | "is-fullwidth-code-point": { 706 | "version": "2.0.0", 707 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 708 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", 709 | "dev": true 710 | }, 711 | "is-regex": { 712 | "version": "1.0.4", 713 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", 714 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", 715 | "dev": true, 716 | "requires": { 717 | "has": "^1.0.1" 718 | } 719 | }, 720 | "is-stream": { 721 | "version": "1.1.0", 722 | "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", 723 | "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", 724 | "dev": true 725 | }, 726 | "is-symbol": { 727 | "version": "1.0.2", 728 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", 729 | "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", 730 | "dev": true, 731 | "requires": { 732 | "has-symbols": "^1.0.0" 733 | } 734 | }, 735 | "is-url": { 736 | "version": "1.2.4", 737 | "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", 738 | "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==" 739 | }, 740 | "isarray": { 741 | "version": "1.0.0", 742 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 743 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 744 | }, 745 | "isexe": { 746 | "version": "2.0.0", 747 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 748 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 749 | "dev": true 750 | }, 751 | "jmespath": { 752 | "version": "0.15.0", 753 | "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", 754 | "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=" 755 | }, 756 | "js-yaml": { 757 | "version": "3.13.1", 758 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", 759 | "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", 760 | "dev": true, 761 | "requires": { 762 | "argparse": "^1.0.7", 763 | "esprima": "^4.0.0" 764 | } 765 | }, 766 | "jsep": { 767 | "version": "0.3.4", 768 | "resolved": "https://registry.npmjs.org/jsep/-/jsep-0.3.4.tgz", 769 | "integrity": "sha512-ovGD9wE+wvudIIYxZGrRcZCxNyZ3Cl1N7Bzyp7/j4d/tA0BaUwcVM9bu0oZaSrefMiNwv6TwZ9X15gvZosteCQ==" 770 | }, 771 | "jsonwebtoken": { 772 | "version": "8.5.1", 773 | "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", 774 | "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", 775 | "requires": { 776 | "jws": "^3.2.2", 777 | "lodash.includes": "^4.3.0", 778 | "lodash.isboolean": "^3.0.3", 779 | "lodash.isinteger": "^4.0.4", 780 | "lodash.isnumber": "^3.0.3", 781 | "lodash.isplainobject": "^4.0.6", 782 | "lodash.isstring": "^4.0.1", 783 | "lodash.once": "^4.0.0", 784 | "ms": "^2.1.1", 785 | "semver": "^5.6.0" 786 | }, 787 | "dependencies": { 788 | "ms": { 789 | "version": "2.1.1", 790 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 791 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 792 | } 793 | } 794 | }, 795 | "jwa": { 796 | "version": "1.4.1", 797 | "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", 798 | "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", 799 | "requires": { 800 | "buffer-equal-constant-time": "1.0.1", 801 | "ecdsa-sig-formatter": "1.0.11", 802 | "safe-buffer": "^5.0.1" 803 | } 804 | }, 805 | "jws": { 806 | "version": "3.2.2", 807 | "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", 808 | "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", 809 | "requires": { 810 | "jwa": "^1.4.1", 811 | "safe-buffer": "^5.0.1" 812 | } 813 | }, 814 | "lcid": { 815 | "version": "2.0.0", 816 | "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", 817 | "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", 818 | "dev": true, 819 | "requires": { 820 | "invert-kv": "^2.0.0" 821 | } 822 | }, 823 | "locate-path": { 824 | "version": "3.0.0", 825 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", 826 | "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", 827 | "dev": true, 828 | "requires": { 829 | "p-locate": "^3.0.0", 830 | "path-exists": "^3.0.0" 831 | } 832 | }, 833 | "lodash": { 834 | "version": "4.17.15", 835 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", 836 | "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" 837 | }, 838 | "lodash.includes": { 839 | "version": "4.3.0", 840 | "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", 841 | "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" 842 | }, 843 | "lodash.isboolean": { 844 | "version": "3.0.3", 845 | "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", 846 | "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" 847 | }, 848 | "lodash.isinteger": { 849 | "version": "4.0.4", 850 | "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", 851 | "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" 852 | }, 853 | "lodash.isnumber": { 854 | "version": "3.0.3", 855 | "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", 856 | "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" 857 | }, 858 | "lodash.isplainobject": { 859 | "version": "4.0.6", 860 | "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", 861 | "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" 862 | }, 863 | "lodash.isstring": { 864 | "version": "4.0.1", 865 | "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", 866 | "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" 867 | }, 868 | "lodash.once": { 869 | "version": "4.1.1", 870 | "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", 871 | "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" 872 | }, 873 | "log-symbols": { 874 | "version": "2.2.0", 875 | "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", 876 | "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", 877 | "dev": true, 878 | "requires": { 879 | "chalk": "^2.0.1" 880 | } 881 | }, 882 | "map-age-cleaner": { 883 | "version": "0.1.3", 884 | "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", 885 | "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", 886 | "dev": true, 887 | "requires": { 888 | "p-defer": "^1.0.0" 889 | } 890 | }, 891 | "media-typer": { 892 | "version": "0.3.0", 893 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 894 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 895 | }, 896 | "mem": { 897 | "version": "4.2.0", 898 | "resolved": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", 899 | "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", 900 | "dev": true, 901 | "requires": { 902 | "map-age-cleaner": "^0.1.1", 903 | "mimic-fn": "^2.0.0", 904 | "p-is-promise": "^2.0.0" 905 | } 906 | }, 907 | "merge-descriptors": { 908 | "version": "1.0.1", 909 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 910 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 911 | }, 912 | "methods": { 913 | "version": "1.1.2", 914 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 915 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 916 | }, 917 | "mime": { 918 | "version": "1.6.0", 919 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 920 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 921 | }, 922 | "mime-db": { 923 | "version": "1.40.0", 924 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", 925 | "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" 926 | }, 927 | "mime-types": { 928 | "version": "2.1.24", 929 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", 930 | "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", 931 | "requires": { 932 | "mime-db": "1.40.0" 933 | } 934 | }, 935 | "mimic-fn": { 936 | "version": "2.1.0", 937 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", 938 | "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", 939 | "dev": true 940 | }, 941 | "minimatch": { 942 | "version": "3.0.4", 943 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 944 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 945 | "dev": true, 946 | "requires": { 947 | "brace-expansion": "^1.1.7" 948 | } 949 | }, 950 | "minimist": { 951 | "version": "0.0.8", 952 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 953 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 954 | "dev": true 955 | }, 956 | "mkdirp": { 957 | "version": "0.5.1", 958 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 959 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 960 | "dev": true, 961 | "requires": { 962 | "minimist": "0.0.8" 963 | } 964 | }, 965 | "mocha": { 966 | "version": "6.2.0", 967 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", 968 | "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", 969 | "dev": true, 970 | "requires": { 971 | "ansi-colors": "3.2.3", 972 | "browser-stdout": "1.3.1", 973 | "debug": "3.2.6", 974 | "diff": "3.5.0", 975 | "escape-string-regexp": "1.0.5", 976 | "find-up": "3.0.0", 977 | "glob": "7.1.3", 978 | "growl": "1.10.5", 979 | "he": "1.2.0", 980 | "js-yaml": "3.13.1", 981 | "log-symbols": "2.2.0", 982 | "minimatch": "3.0.4", 983 | "mkdirp": "0.5.1", 984 | "ms": "2.1.1", 985 | "node-environment-flags": "1.0.5", 986 | "object.assign": "4.1.0", 987 | "strip-json-comments": "2.0.1", 988 | "supports-color": "6.0.0", 989 | "which": "1.3.1", 990 | "wide-align": "1.1.3", 991 | "yargs": "13.2.2", 992 | "yargs-parser": "13.0.0", 993 | "yargs-unparser": "1.5.0" 994 | }, 995 | "dependencies": { 996 | "debug": { 997 | "version": "3.2.6", 998 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", 999 | "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", 1000 | "dev": true, 1001 | "requires": { 1002 | "ms": "^2.1.1" 1003 | } 1004 | }, 1005 | "ms": { 1006 | "version": "2.1.1", 1007 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 1008 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", 1009 | "dev": true 1010 | } 1011 | } 1012 | }, 1013 | "ms": { 1014 | "version": "2.0.0", 1015 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1016 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 1017 | }, 1018 | "negotiator": { 1019 | "version": "0.6.2", 1020 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 1021 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 1022 | }, 1023 | "nice-try": { 1024 | "version": "1.0.5", 1025 | "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", 1026 | "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", 1027 | "dev": true 1028 | }, 1029 | "node-environment-flags": { 1030 | "version": "1.0.5", 1031 | "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", 1032 | "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", 1033 | "dev": true, 1034 | "requires": { 1035 | "object.getownpropertydescriptors": "^2.0.3", 1036 | "semver": "^5.7.0" 1037 | } 1038 | }, 1039 | "npm-run-path": { 1040 | "version": "2.0.2", 1041 | "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", 1042 | "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", 1043 | "dev": true, 1044 | "requires": { 1045 | "path-key": "^2.0.0" 1046 | } 1047 | }, 1048 | "number-is-nan": { 1049 | "version": "1.0.1", 1050 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 1051 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", 1052 | "dev": true 1053 | }, 1054 | "object-keys": { 1055 | "version": "1.1.0", 1056 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", 1057 | "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", 1058 | "dev": true 1059 | }, 1060 | "object.assign": { 1061 | "version": "4.1.0", 1062 | "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", 1063 | "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", 1064 | "dev": true, 1065 | "requires": { 1066 | "define-properties": "^1.1.2", 1067 | "function-bind": "^1.1.1", 1068 | "has-symbols": "^1.0.0", 1069 | "object-keys": "^1.0.11" 1070 | } 1071 | }, 1072 | "object.getownpropertydescriptors": { 1073 | "version": "2.0.3", 1074 | "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", 1075 | "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", 1076 | "dev": true, 1077 | "requires": { 1078 | "define-properties": "^1.1.2", 1079 | "es-abstract": "^1.5.1" 1080 | } 1081 | }, 1082 | "on-finished": { 1083 | "version": "2.3.0", 1084 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 1085 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 1086 | "requires": { 1087 | "ee-first": "1.1.1" 1088 | } 1089 | }, 1090 | "once": { 1091 | "version": "1.4.0", 1092 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1093 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1094 | "dev": true, 1095 | "requires": { 1096 | "wrappy": "1" 1097 | } 1098 | }, 1099 | "os-locale": { 1100 | "version": "3.1.0", 1101 | "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", 1102 | "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", 1103 | "dev": true, 1104 | "requires": { 1105 | "execa": "^1.0.0", 1106 | "lcid": "^2.0.0", 1107 | "mem": "^4.0.0" 1108 | } 1109 | }, 1110 | "p-defer": { 1111 | "version": "1.0.0", 1112 | "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", 1113 | "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", 1114 | "dev": true 1115 | }, 1116 | "p-finally": { 1117 | "version": "1.0.0", 1118 | "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", 1119 | "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", 1120 | "dev": true 1121 | }, 1122 | "p-is-promise": { 1123 | "version": "2.0.0", 1124 | "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", 1125 | "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", 1126 | "dev": true 1127 | }, 1128 | "p-limit": { 1129 | "version": "2.2.1", 1130 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", 1131 | "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", 1132 | "dev": true, 1133 | "requires": { 1134 | "p-try": "^2.0.0" 1135 | } 1136 | }, 1137 | "p-locate": { 1138 | "version": "3.0.0", 1139 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", 1140 | "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", 1141 | "dev": true, 1142 | "requires": { 1143 | "p-limit": "^2.0.0" 1144 | } 1145 | }, 1146 | "p-try": { 1147 | "version": "2.1.0", 1148 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.1.0.tgz", 1149 | "integrity": "sha512-H2RyIJ7+A3rjkwKC2l5GGtU4H1vkxKCAGsWasNVd0Set+6i4znxbWy6/j16YDPJDWxhsgZiKAstMEP8wCdSpjA==", 1150 | "dev": true 1151 | }, 1152 | "parseurl": { 1153 | "version": "1.3.3", 1154 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 1155 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 1156 | }, 1157 | "path-exists": { 1158 | "version": "3.0.0", 1159 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", 1160 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", 1161 | "dev": true 1162 | }, 1163 | "path-is-absolute": { 1164 | "version": "1.0.1", 1165 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1166 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1167 | "dev": true 1168 | }, 1169 | "path-key": { 1170 | "version": "2.0.1", 1171 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", 1172 | "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", 1173 | "dev": true 1174 | }, 1175 | "path-to-regexp": { 1176 | "version": "0.1.7", 1177 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 1178 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 1179 | }, 1180 | "pathval": { 1181 | "version": "1.1.0", 1182 | "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", 1183 | "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", 1184 | "dev": true 1185 | }, 1186 | "proxy-addr": { 1187 | "version": "2.0.5", 1188 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", 1189 | "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", 1190 | "requires": { 1191 | "forwarded": "~0.1.2", 1192 | "ipaddr.js": "1.9.0" 1193 | } 1194 | }, 1195 | "pump": { 1196 | "version": "3.0.0", 1197 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 1198 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 1199 | "dev": true, 1200 | "requires": { 1201 | "end-of-stream": "^1.1.0", 1202 | "once": "^1.3.1" 1203 | } 1204 | }, 1205 | "punycode": { 1206 | "version": "1.3.2", 1207 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", 1208 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" 1209 | }, 1210 | "qs": { 1211 | "version": "6.7.0", 1212 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 1213 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 1214 | }, 1215 | "querystring": { 1216 | "version": "0.2.0", 1217 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", 1218 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" 1219 | }, 1220 | "range-parser": { 1221 | "version": "1.2.1", 1222 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1223 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 1224 | }, 1225 | "raw-body": { 1226 | "version": "2.4.0", 1227 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 1228 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 1229 | "requires": { 1230 | "bytes": "3.1.0", 1231 | "http-errors": "1.7.2", 1232 | "iconv-lite": "0.4.24", 1233 | "unpipe": "1.0.0" 1234 | } 1235 | }, 1236 | "require-directory": { 1237 | "version": "2.1.1", 1238 | "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", 1239 | "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", 1240 | "dev": true 1241 | }, 1242 | "require-main-filename": { 1243 | "version": "2.0.0", 1244 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", 1245 | "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", 1246 | "dev": true 1247 | }, 1248 | "safe-buffer": { 1249 | "version": "5.1.2", 1250 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1251 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 1252 | }, 1253 | "safer-buffer": { 1254 | "version": "2.1.2", 1255 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1256 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 1257 | }, 1258 | "sax": { 1259 | "version": "1.2.1", 1260 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", 1261 | "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=" 1262 | }, 1263 | "semver": { 1264 | "version": "5.7.1", 1265 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 1266 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 1267 | }, 1268 | "send": { 1269 | "version": "0.17.1", 1270 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 1271 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 1272 | "requires": { 1273 | "debug": "2.6.9", 1274 | "depd": "~1.1.2", 1275 | "destroy": "~1.0.4", 1276 | "encodeurl": "~1.0.2", 1277 | "escape-html": "~1.0.3", 1278 | "etag": "~1.8.1", 1279 | "fresh": "0.5.2", 1280 | "http-errors": "~1.7.2", 1281 | "mime": "1.6.0", 1282 | "ms": "2.1.1", 1283 | "on-finished": "~2.3.0", 1284 | "range-parser": "~1.2.1", 1285 | "statuses": "~1.5.0" 1286 | }, 1287 | "dependencies": { 1288 | "ms": { 1289 | "version": "2.1.1", 1290 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 1291 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 1292 | } 1293 | } 1294 | }, 1295 | "serve-static": { 1296 | "version": "1.14.1", 1297 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 1298 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 1299 | "requires": { 1300 | "encodeurl": "~1.0.2", 1301 | "escape-html": "~1.0.3", 1302 | "parseurl": "~1.3.3", 1303 | "send": "0.17.1" 1304 | } 1305 | }, 1306 | "serverless-http": { 1307 | "version": "2.3.0", 1308 | "resolved": "https://registry.npmjs.org/serverless-http/-/serverless-http-2.3.0.tgz", 1309 | "integrity": "sha512-z1820kGkw/XlaXCZ3HMA6fY/SQXrbtlQjuTaxB1fMJTe5GJqjQRE0EyLKkeQDT3Qd4nmtfM1p7XEUuNv2chnFA==", 1310 | "requires": { 1311 | "@types/aws-lambda": "^8.10.19" 1312 | } 1313 | }, 1314 | "set-blocking": { 1315 | "version": "2.0.0", 1316 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 1317 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", 1318 | "dev": true 1319 | }, 1320 | "setprototypeof": { 1321 | "version": "1.1.1", 1322 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 1323 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 1324 | }, 1325 | "shebang-command": { 1326 | "version": "1.2.0", 1327 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 1328 | "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", 1329 | "dev": true, 1330 | "requires": { 1331 | "shebang-regex": "^1.0.0" 1332 | } 1333 | }, 1334 | "shebang-regex": { 1335 | "version": "1.0.0", 1336 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 1337 | "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", 1338 | "dev": true 1339 | }, 1340 | "signal-exit": { 1341 | "version": "3.0.2", 1342 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", 1343 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", 1344 | "dev": true 1345 | }, 1346 | "sprintf-js": { 1347 | "version": "1.0.3", 1348 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 1349 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 1350 | "dev": true 1351 | }, 1352 | "statuses": { 1353 | "version": "1.5.0", 1354 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 1355 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 1356 | }, 1357 | "string-width": { 1358 | "version": "2.1.1", 1359 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 1360 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 1361 | "dev": true, 1362 | "requires": { 1363 | "is-fullwidth-code-point": "^2.0.0", 1364 | "strip-ansi": "^4.0.0" 1365 | } 1366 | }, 1367 | "strip-ansi": { 1368 | "version": "4.0.0", 1369 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 1370 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 1371 | "dev": true, 1372 | "requires": { 1373 | "ansi-regex": "^3.0.0" 1374 | } 1375 | }, 1376 | "strip-eof": { 1377 | "version": "1.0.0", 1378 | "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", 1379 | "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", 1380 | "dev": true 1381 | }, 1382 | "strip-json-comments": { 1383 | "version": "2.0.1", 1384 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1385 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", 1386 | "dev": true 1387 | }, 1388 | "supports-color": { 1389 | "version": "6.0.0", 1390 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", 1391 | "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", 1392 | "dev": true, 1393 | "requires": { 1394 | "has-flag": "^3.0.0" 1395 | } 1396 | }, 1397 | "toidentifier": { 1398 | "version": "1.0.0", 1399 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 1400 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 1401 | }, 1402 | "type-detect": { 1403 | "version": "4.0.8", 1404 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", 1405 | "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", 1406 | "dev": true 1407 | }, 1408 | "type-is": { 1409 | "version": "1.6.18", 1410 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1411 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1412 | "requires": { 1413 | "media-typer": "0.3.0", 1414 | "mime-types": "~2.1.24" 1415 | } 1416 | }, 1417 | "unpipe": { 1418 | "version": "1.0.0", 1419 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1420 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 1421 | }, 1422 | "url": { 1423 | "version": "0.10.3", 1424 | "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", 1425 | "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", 1426 | "requires": { 1427 | "punycode": "1.3.2", 1428 | "querystring": "0.2.0" 1429 | } 1430 | }, 1431 | "utils-merge": { 1432 | "version": "1.0.1", 1433 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1434 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 1435 | }, 1436 | "uuid": { 1437 | "version": "3.3.3", 1438 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", 1439 | "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" 1440 | }, 1441 | "vary": { 1442 | "version": "1.1.2", 1443 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1444 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 1445 | }, 1446 | "which": { 1447 | "version": "1.3.1", 1448 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 1449 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 1450 | "dev": true, 1451 | "requires": { 1452 | "isexe": "^2.0.0" 1453 | } 1454 | }, 1455 | "which-module": { 1456 | "version": "2.0.0", 1457 | "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", 1458 | "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", 1459 | "dev": true 1460 | }, 1461 | "wide-align": { 1462 | "version": "1.1.3", 1463 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", 1464 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", 1465 | "dev": true, 1466 | "requires": { 1467 | "string-width": "^1.0.2 || 2" 1468 | } 1469 | }, 1470 | "wrap-ansi": { 1471 | "version": "2.1.0", 1472 | "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", 1473 | "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", 1474 | "dev": true, 1475 | "requires": { 1476 | "string-width": "^1.0.1", 1477 | "strip-ansi": "^3.0.1" 1478 | }, 1479 | "dependencies": { 1480 | "ansi-regex": { 1481 | "version": "2.1.1", 1482 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 1483 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 1484 | "dev": true 1485 | }, 1486 | "is-fullwidth-code-point": { 1487 | "version": "1.0.0", 1488 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 1489 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 1490 | "dev": true, 1491 | "requires": { 1492 | "number-is-nan": "^1.0.0" 1493 | } 1494 | }, 1495 | "string-width": { 1496 | "version": "1.0.2", 1497 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 1498 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 1499 | "dev": true, 1500 | "requires": { 1501 | "code-point-at": "^1.0.0", 1502 | "is-fullwidth-code-point": "^1.0.0", 1503 | "strip-ansi": "^3.0.0" 1504 | } 1505 | }, 1506 | "strip-ansi": { 1507 | "version": "3.0.1", 1508 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 1509 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 1510 | "dev": true, 1511 | "requires": { 1512 | "ansi-regex": "^2.0.0" 1513 | } 1514 | } 1515 | } 1516 | }, 1517 | "wrappy": { 1518 | "version": "1.0.2", 1519 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1520 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1521 | "dev": true 1522 | }, 1523 | "xml2js": { 1524 | "version": "0.4.19", 1525 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", 1526 | "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", 1527 | "requires": { 1528 | "sax": ">=0.6.0", 1529 | "xmlbuilder": "~9.0.1" 1530 | } 1531 | }, 1532 | "xmlbuilder": { 1533 | "version": "9.0.7", 1534 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", 1535 | "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" 1536 | }, 1537 | "y18n": { 1538 | "version": "4.0.0", 1539 | "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", 1540 | "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", 1541 | "dev": true 1542 | }, 1543 | "yargs": { 1544 | "version": "13.2.2", 1545 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", 1546 | "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", 1547 | "dev": true, 1548 | "requires": { 1549 | "cliui": "^4.0.0", 1550 | "find-up": "^3.0.0", 1551 | "get-caller-file": "^2.0.1", 1552 | "os-locale": "^3.1.0", 1553 | "require-directory": "^2.1.1", 1554 | "require-main-filename": "^2.0.0", 1555 | "set-blocking": "^2.0.0", 1556 | "string-width": "^3.0.0", 1557 | "which-module": "^2.0.0", 1558 | "y18n": "^4.0.0", 1559 | "yargs-parser": "^13.0.0" 1560 | }, 1561 | "dependencies": { 1562 | "ansi-regex": { 1563 | "version": "4.1.0", 1564 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", 1565 | "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", 1566 | "dev": true 1567 | }, 1568 | "string-width": { 1569 | "version": "3.1.0", 1570 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", 1571 | "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", 1572 | "dev": true, 1573 | "requires": { 1574 | "emoji-regex": "^7.0.1", 1575 | "is-fullwidth-code-point": "^2.0.0", 1576 | "strip-ansi": "^5.1.0" 1577 | } 1578 | }, 1579 | "strip-ansi": { 1580 | "version": "5.2.0", 1581 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", 1582 | "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", 1583 | "dev": true, 1584 | "requires": { 1585 | "ansi-regex": "^4.1.0" 1586 | } 1587 | } 1588 | } 1589 | }, 1590 | "yargs-parser": { 1591 | "version": "13.0.0", 1592 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", 1593 | "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", 1594 | "dev": true, 1595 | "requires": { 1596 | "camelcase": "^5.0.0", 1597 | "decamelize": "^1.2.0" 1598 | } 1599 | }, 1600 | "yargs-unparser": { 1601 | "version": "1.5.0", 1602 | "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", 1603 | "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", 1604 | "dev": true, 1605 | "requires": { 1606 | "flat": "^4.1.0", 1607 | "lodash": "^4.17.11", 1608 | "yargs": "^12.0.5" 1609 | }, 1610 | "dependencies": { 1611 | "get-caller-file": { 1612 | "version": "1.0.3", 1613 | "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", 1614 | "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", 1615 | "dev": true 1616 | }, 1617 | "require-main-filename": { 1618 | "version": "1.0.1", 1619 | "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", 1620 | "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", 1621 | "dev": true 1622 | }, 1623 | "yargs": { 1624 | "version": "12.0.5", 1625 | "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", 1626 | "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", 1627 | "dev": true, 1628 | "requires": { 1629 | "cliui": "^4.0.0", 1630 | "decamelize": "^1.2.0", 1631 | "find-up": "^3.0.0", 1632 | "get-caller-file": "^1.0.1", 1633 | "os-locale": "^3.0.0", 1634 | "require-directory": "^2.1.1", 1635 | "require-main-filename": "^1.0.1", 1636 | "set-blocking": "^2.0.0", 1637 | "string-width": "^2.0.0", 1638 | "which-module": "^2.0.0", 1639 | "y18n": "^3.2.1 || ^4.0.0", 1640 | "yargs-parser": "^11.1.1" 1641 | } 1642 | }, 1643 | "yargs-parser": { 1644 | "version": "11.1.1", 1645 | "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", 1646 | "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", 1647 | "dev": true, 1648 | "requires": { 1649 | "camelcase": "^5.0.0", 1650 | "decamelize": "^1.2.0" 1651 | } 1652 | } 1653 | } 1654 | } 1655 | } 1656 | } 1657 | -------------------------------------------------------------------------------- /guestbook/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hello_world", 3 | "version": "1.0.0", 4 | "description": "hello world sample for NodeJS", 5 | "main": "app.js", 6 | "repository": "https://github.com/awslabs/aws-sam-cli/tree/develop/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs", 7 | "author": "SAM CLI", 8 | "license": "Apache-2.0", 9 | "dependencies": { 10 | "aws-sdk": "^2.594.0", 11 | "axios": "^0.18.0", 12 | "body-parser": "^1.19.0", 13 | "casbin": "^3.0.4", 14 | "env-var": "^4.0.1", 15 | "express": "^4.17.1", 16 | "jsonwebtoken": "^8.5.1", 17 | "serverless-http": "^2.3.0", 18 | "uuid": "^3.3.3" 19 | }, 20 | "scripts": { 21 | "test": "mocha tests/unit/" 22 | }, 23 | "devDependencies": { 24 | "chai": "^4.2.0", 25 | "mocha": "^6.1.4" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /guestbook/rbac.js: -------------------------------------------------------------------------------- 1 | const casbin = require('casbin'); 2 | 3 | const model = ` 4 | [request_definition] 5 | r = sub, obj, act 6 | 7 | [policy_definition] 8 | p = sub, obj, act 9 | 10 | [role_definition] 11 | g = _, _ 12 | 13 | [policy_effect] 14 | e = some(where (p.eft == allow)) 15 | 16 | [matchers] 17 | m = g(r.sub, p.sub) && keyMatch2(r.obj, p.obj) && r.act == p.act 18 | ` 19 | 20 | const policy = ` 21 | p, role:reader, /, read 22 | p, role:writer, /, write 23 | p, role:deleter, /, delete 24 | 25 | g, role:deleter, role:writer 26 | g, role:writer, role:reader 27 | ` 28 | 29 | const enforcerPromise = casbin.newEnforcer( 30 | casbin.newModel(model), 31 | new casbin.StringAdapter(policy)); 32 | 33 | async function enforce(sub, obj, act) { 34 | const e = await enforcerPromise; 35 | return await e.enforce(sub, obj, act); 36 | } 37 | 38 | async function addRolesToUser(sub, roles) { 39 | const e = await enforcerPromise; 40 | await Promise.all(roles.map(role => e.addRoleForUser(sub, `role:${role}`))); 41 | } 42 | 43 | module.exports.enforce = enforce; 44 | module.exports.addRolesToUser = addRolesToUser; 45 | -------------------------------------------------------------------------------- /guestbook/tests/unit/test-handler.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const app = require('../../app.js'); 4 | const chai = require('chai'); 5 | const expect = chai.expect; 6 | var event, context; 7 | 8 | describe('Tests index', function () { 9 | it('verifies successful response', async () => { 10 | const result = await app.lambdaHandler(event, context) 11 | 12 | expect(result).to.be.an('object'); 13 | expect(result.statusCode).to.equal(200); 14 | expect(result.body).to.be.an('string'); 15 | 16 | let response = JSON.parse(result.body); 17 | 18 | expect(response).to.be.an('object'); 19 | expect(response.message).to.be.equal("hello world"); 20 | // expect(response.location).to.be.an("string"); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /template-cognito.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Transform: AWS::Serverless-2016-10-31 3 | Parameters: 4 | Email: 5 | Type: String 6 | Resources: 7 | UserPool: 8 | Type: AWS::Cognito::UserPool 9 | Properties: 10 | AdminCreateUserConfig: 11 | AllowAdminCreateUserOnly: true 12 | AutoVerifiedAttributes: 13 | - email 14 | UsernameAttributes: 15 | - email 16 | 17 | UserPoolDomain: 18 | Type: AWS::Cognito::UserPoolDomain 19 | Properties: 20 | Domain: !Ref Client 21 | UserPoolId: !Ref UserPool 22 | 23 | Client: 24 | Type: AWS::Cognito::UserPoolClient 25 | Properties: 26 | AllowedOAuthFlows: 27 | - implicit 28 | AllowedOAuthScopes: 29 | - email 30 | - openid 31 | - profile 32 | SupportedIdentityProviders: 33 | - COGNITO 34 | UserPoolId: !Ref UserPool 35 | CallbackURLs: 36 | - http://localhost 37 | DefaultRedirectURI: http://localhost 38 | AllowedOAuthFlowsUserPoolClient: true 39 | SupportedIdentityProviders: 40 | - COGNITO 41 | 42 | CommentWriterGroup: 43 | Type: AWS::Cognito::UserPoolGroup 44 | Properties: 45 | Description: Comment Writer 46 | GroupName: writer 47 | Precedence: 0 48 | UserPoolId: !Ref UserPool 49 | 50 | CommentReaderGroup: 51 | Type: AWS::Cognito::UserPoolGroup 52 | Properties: 53 | Description: Comment Reader 54 | GroupName: reader 55 | Precedence: 0 56 | UserPoolId: !Ref UserPool 57 | 58 | CommentDeleterGroup: 59 | Type: AWS::Cognito::UserPoolGroup 60 | Properties: 61 | Description: Comment Deleter 62 | GroupName: deleter 63 | Precedence: 0 64 | UserPoolId: !Ref UserPool 65 | 66 | User: 67 | Type: AWS::Cognito::UserPoolUser 68 | Properties: 69 | UserPoolId: !Ref UserPool 70 | Username: !Ref Email 71 | DesiredDeliveryMediums: 72 | - EMAIL 73 | UserAttributes: 74 | - Name: email 75 | Value: !Ref Email 76 | 77 | AttachUserToWriterGroup: 78 | Type: AWS::Cognito::UserPoolUserToGroupAttachment 79 | Properties: 80 | GroupName: !Ref CommentWriterGroup 81 | Username: !Ref User 82 | UserPoolId: !Ref UserPool 83 | 84 | AttachUserToReaderGroup: 85 | Type: AWS::Cognito::UserPoolUserToGroupAttachment 86 | Properties: 87 | GroupName: !Ref CommentReaderGroup 88 | Username: !Ref User 89 | UserPoolId: !Ref UserPool 90 | 91 | AttachUserToDeleterGroup: 92 | Type: AWS::Cognito::UserPoolUserToGroupAttachment 93 | Properties: 94 | GroupName: !Ref CommentDeleterGroup 95 | Username: !Ref User 96 | UserPoolId: !Ref UserPool 97 | 98 | Outputs: 99 | iss: 100 | Value: !Sub 'https://cognito-idp.${AWS::Region}.amazonaws.com/${UserPool}' 101 | OpenIDConnectUrl: 102 | Value: !Sub 'https://cognito-idp.${AWS::Region}.amazonaws.com/${UserPool}/.well-known/jwks.json' 103 | AudClientId: 104 | Value: !Ref Client 105 | LoginURL: 106 | Value: !Sub 'https://${Client}.auth.${AWS::Region}.amazoncognito.com/login?response_type=token&client_id=${Client}&redirect_uri=http://localhost&scope=openid+profile' -------------------------------------------------------------------------------- /template.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Transform: AWS::Serverless-2016-10-31 3 | Parameters: 4 | Aud: 5 | Type: String 6 | Issuer: 7 | Type: String 8 | Description: > 9 | simple-node-api 10 | Sample SAM Template for simple-node-api 11 | 12 | # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst 13 | Globals: 14 | Function: 15 | Timeout: 3 16 | Tracing: Active 17 | 18 | Resources: 19 | GuestBookApi: 20 | Type: AWS::Serverless::HttpApi 21 | Properties: 22 | DefinitionBody: 23 | 'Fn::Transform': 24 | Name: AWS::Include 25 | Parameters: 26 | Location: api.yaml 27 | Auth: 28 | Authorizers: 29 | OpenIdAuthorizer: 30 | IdentitySource: $request.header.Authorization 31 | JwtConfiguration: 32 | audience: 33 | - !Ref Aud 34 | issuer: !Ref Issuer 35 | OpenIdConnectUrl: !Sub '${Issuer}/.well-known/jwks.json' 36 | DefaultAuthorizer: OpenIdAuthorizer 37 | 38 | 39 | CommentsBucket: 40 | Type: AWS::S3::Bucket 41 | 42 | ExpressBackend: 43 | Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction 44 | Properties: 45 | CodeUri: guestbook/ 46 | Handler: app.lambdaHandler 47 | Runtime: nodejs12.x 48 | Environment: 49 | Variables: 50 | BUCKET: !Ref CommentsBucket 51 | Policies: 52 | - S3CrudPolicy: 53 | BucketName: !Ref CommentsBucket 54 | Events: 55 | Get: 56 | Type: HttpApi # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api 57 | Properties: 58 | Path: / 59 | Method: get 60 | ApiId: !Ref GuestBookApi 61 | Auth: 62 | Authorizer: OpenIdAuthorizer 63 | Post: 64 | Type: HttpApi 65 | Properties: 66 | Path: / 67 | Method: post 68 | ApiId: !Ref GuestBookApi 69 | Auth: 70 | Authorizer: OpenIdAuthorizer 71 | 72 | 73 | Outputs: 74 | GuestBookApi: 75 | Description: API Gateway endpoint URL for Prod stage for Hello World function 76 | Value: 77 | Fn::Sub: https://${GuestBookApi}.execute-api.${AWS::Region}.amazonaws.com/ 78 | ExpressBackendFunction: 79 | Description: Express Backend Lambda Function ARN 80 | Value: !Sub ExpressBackend.Arn 81 | ExpressBackendIamRole: 82 | Description: Implicit IAM Role created for Hello World function 83 | Value: !Sub ExpressBackendFunctionRole.Arn 84 | 85 | --------------------------------------------------------------------------------