I hereby claim:
- I am joawan on github.
- I am joawan (https://keybase.io/joawan) on keybase.
- I have a public key whose fingerprint is C1B1 515E 188A EFFD F459 BB3B 7556 8E38 128C 1753
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| console.log(process.argv[2].split('').filter((e, i, a) => e === a[(i + 1) % a.length]).reduce((s, c) => s + +c, 0)); |
| const tokenIntrospection = require('token-introspection'); | |
| const crypto = require('crypto'); | |
| const createError = require('http-errors'); | |
| const throwIfTrue = require('throw-if-true'); | |
| const Cache = require('../lib/cache'); | |
| const wrap = require('../lib/routeWrapper'); | |
| const logger = require('../lib/logger'); | |
| const cache = new Cache(); |
| const tokenIntrospection = require('token-introspection')({ | |
| jwks_uri: 'https://example.com/jwks', | |
| endpoint: 'https://example.com/introspect', | |
| client_id: 'client-id', | |
| client_secret: 'client-secret', | |
| }); | |
| tokenIntrospection(token).then(console.log).catch(console.warn); |
| const tokenIntrospection = require('token-introspection'); | |
| const createError = require('http-errors'); | |
| const wrap = (fn) => (...args) => fn(...args).catch(args[2]); | |
| const introspectMiddleware = (opts = {}) => { | |
| const introspect = tokenIntrospection(opts); | |
| return wrap(async (req, res, next) => { | |
| try { |
| ApiGateway: | |
| Type: AWS::Serverless::Api | |
| Properties: | |
| StageName: !Ref Stage | |
| DefinitionBody: | |
| swagger: "2.0" | |
| info: | |
| title: !Ref AWS::StackName | |
| x-amazon-apigateway-request-validators: | |
| body-only: |
| SendLambda: | |
| Type: AWS::Serverless::Function | |
| Properties: | |
| CodeUri: src/send-mail/ | |
| Description: Polls SQS, builds email, sends to SES | |
| MemorySize: 256 | |
| Policies: | |
| - SQSPollerPolicy: | |
| QueueName: !GetAtt ApiQueue.QueueName | |
| - SESCrudPolicy: |
| EventsSNS: | |
| Type: AWS::SNS::Topic | |
| Properties: | |
| TopicName: sam-pigeon-events | |
| Subscription: | |
| - Endpoint: !GetAtt EventsQueue.Arn | |
| Protocol: sqs | |
| EventsQueue: | |
| Type: AWS::SQS::Queue |
| const { readFile } = require('fs').promises; | |
| const mjml = require('mjml'); | |
| const i18n = require('i18n'); | |
| const htmlToText = require('html-to-text'); | |
| const assert = require('assert'); | |
| const mustache = require('mustache'); | |
| const AWS = require('aws-sdk'); | |
| i18n.configure({ | |
| directory: `${process.cwd()}/locales`, |