Skip to content

Instantly share code, notes, and snippets.

@skytreader
Created December 17, 2019 13:41
Show Gist options
  • Save skytreader/97e76bb18db36fcdee036f5c9bae3230 to your computer and use it in GitHub Desktop.
Save skytreader/97e76bb18db36fcdee036f5c9bae3230 to your computer and use it in GitHub Desktop.
Invalid Token Error SSCCE
{
"name": "invalid-token-sscce",
"version": "0.0.1",
"description": "",
"main": "index.js",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "nyc ava",
"pretest": "xo"
},
"keywords": [],
"author": "Chad Estioco (https://github.com/skytreader)",
"license": "MIT",
"devDependencies": {
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"ava": "^2.4.0",
"finepack": "^2.9.1",
"husky": "^3.1.0",
"nyc": "^14.1.1",
"semantic-release": "^15.13.31",
"xo": "^0.25.3"
},
"xo": {
"semicolon": false,
"space": true
},
"dependencies": {
"dotenv-safe": "^8.2.0",
"got": "^9.6.0",
"jsonwebtoken": "^8.5.1",
"serverless": "^1.59.3"
},
"postinstaller": {
"add your config here": true,
"see": "https://npmjs.com/postinstaller#readme"
}
}
service: invalid-token-error-sscce
# app and org for use with dashboard.serverless.com
app: sscce
org: skytreader
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"
provider:
name: aws
runtime: nodejs12.x
# you can overwrite defaults here
# stage: dev
# region: us-east-1
functions:
jwt-authorizer:
handler: put-me-address
name: "foo_authorizer"
updateAddress:
handler: sscce
events:
- http:
path: /me/address
method: put
cors: true
request:
parameters:
headers:
authorization: true
authorizer:
name: foo_authorizer
resultTtlInSeconds: 60
identitySource: method.request.header.Authorization
identityValidationExpression: '^Bearer [-0-9a-zA-Z.+/=_]*$'
module.exports = async event => {
return {
statusCode: 200,
body: "OK"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment