diff --git a/README.md b/README.md index e5f9f1b2f..3ed1081fc 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Staart is a Node.js backend starter for SaaS startups written in TypeScript. It - [x] 👩‍💻 Helpers for database query, finding users, creating tokens, etc. - [x] 🔐 JWT-based authentication with email/password and scopes - [x] 💳 Support for multiple emails per user account -- [ ] 🔐 Login with Google (and Facebook?) +- [x] 🔐 Login with Google - [x] 👩‍💻 Configuration based on environment variables - [x] 👩‍💻 TypeScript interfaces for `User`, `HTTPError`, etc. - [ ] 💳 Organizations, inviting team members with permissions diff --git a/package.json b/package.json index fd93716bc..e468ac47a 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "body-parser": "^1.19.0", "express-async-handler": "^1.1.4", "fs-extra": "^7.0.1", + "googleapis": "^39.2.0", "jsonwebtoken": "^8.5.1", "marked": "^0.6.2", "mustache": "^3.0.1", diff --git a/src/config.ts b/src/config.ts index b250aa44b..5775db30e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -29,3 +29,7 @@ export const TOKEN_EXPIRY_PASSWORD_RESET = process.env.TOKEN_EXPIRY_PASSWORD_RESET || "1d"; export const TOKEN_EXPIRY_LOGIN = process.env.TOKEN_EXPIRY_LOGIN || "1d"; export const TOKEN_EXPIRY_REFRESH = process.env.TOKEN_EXPIRY_REFRESH || "30d"; + +export const GOOGLE_CLIENT_ID = process.env.GOOGLE_CLIENT_ID || ""; +export const GOOGLE_CLIENT_SECRET = process.env.GOOGLE_CLIENT_SECRET || ""; +export const GOOGLE_CLIENT_REDIRECT = process.env.GOOGLE_CLIENT_REDIRECT || ""; diff --git a/src/helpers/google.ts b/src/helpers/google.ts new file mode 100644 index 000000000..f6a7a5384 --- /dev/null +++ b/src/helpers/google.ts @@ -0,0 +1,48 @@ +import { google } from "googleapis"; +import { + GOOGLE_CLIENT_ID, + GOOGLE_CLIENT_SECRET, + GOOGLE_CLIENT_REDIRECT +} from "../config"; +import { ErrorCode } from "../interfaces/enum"; +import { GetTokenResponse } from "google-auth-library/build/src/auth/oauth2client"; + +export const googleCreateConnection = () => { + return new google.auth.OAuth2( + GOOGLE_CLIENT_ID, + GOOGLE_CLIENT_SECRET, + GOOGLE_CLIENT_REDIRECT + ); +}; + +export const googleGetConnectionUrl = () => { + const auth = googleCreateConnection(); + return auth.generateAuthUrl({ + access_type: "offline", + prompt: "consent", + scope: [ + "https://www.googleapis.com/auth/plus.me", + "https://www.googleapis.com/auth/userinfo.email" + ] + }); +}; + +export const googleGetTokensFromCode = async (code: string) => { + const auth = googleCreateConnection(); + const tokens = await auth.getToken(code); + if (!tokens) throw new Error(ErrorCode.GOOGLE_AUTH_ERROR); + return tokens; +}; + +export const googleGetEmailFromToken = async (data: GetTokenResponse) => { + const auth = googleCreateConnection(); + auth.setCredentials(data.tokens); + const plus = google.plus({ version: "v1", auth }); + const user = await plus.people.get({ userId: "me" }); + const email = + user.data.emails && user.data.emails.length + ? user.data.emails[0].value + : ""; + if (!email) throw new Error(ErrorCode.GOOGLE_AUTH_ERROR); + return email; +}; diff --git a/src/i18n.ts b/src/i18n.ts index 20ae98a3f..a3e176dfd 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,5 +1,5 @@ interface Lang { - [index: string]: any; + [index: string]: string | Lang; } interface I18N { [index: string]: Lang; diff --git a/src/interfaces/enum.ts b/src/interfaces/enum.ts index 624f46123..15b019a5b 100644 --- a/src/interfaces/enum.ts +++ b/src/interfaces/enum.ts @@ -49,7 +49,8 @@ export enum ErrorCode { INSUFFICIENT_PERMISSION = "401/insufficient-permission", DEFAULT = "500/server-error", EMAIL_CANNOT_DELETE = "400/email.cannotDelete", - UNVERIFIED_EMAIL = "401/unverified-email" + UNVERIFIED_EMAIL = "401/unverified-email", + GOOGLE_AUTH_ERROR = "401/google-auth-error" } export enum Templates { diff --git a/src/rest/auth.ts b/src/rest/auth.ts index d23f1743b..28c389887 100644 --- a/src/rest/auth.ts +++ b/src/rest/auth.ts @@ -1,6 +1,7 @@ import { User } from "../interfaces/tables/user"; import { createUser, updateUser, getUserByEmail, getUser } from "../crud/user"; import { InsertResult } from "../interfaces/mysql"; +import { google } from "googleapis"; import { createEmail, updateEmail, @@ -26,6 +27,11 @@ import { import { compare, hash } from "bcrypt"; import { deleteSensitiveInfoUser } from "../helpers/utils"; import { createMembership } from "../crud/membership"; +import { + googleGetConnectionUrl, + googleGetTokensFromCode, + googleGetEmailFromToken +} from "../helpers/google"; export const validateRefreshToken = async (token: string, locals: Locals) => { const data = await verifyToken(token, Tokens.REFRESH); @@ -147,3 +153,24 @@ export const updatePassword = async ( ); return; }; + +export const loginWithGoogleLink = () => googleGetConnectionUrl(); + +export const loginWithGoogleVerify = async (code: string, locals: Locals) => { + const data = await googleGetTokensFromCode(code); + const email = await googleGetEmailFromToken(data); + const user = await getUserByEmail(email); + if (!user.id) throw new Error(ErrorCode.USER_NOT_FOUND); + await createEvent( + { + userId: user.id, + type: EventType.AUTH_LOGIN, + data: { strategy: "google" } + }, + locals + ); + return { + token: await loginToken(deleteSensitiveInfoUser(user)), + refresh: await refreshToken(user.id) + }; +}; diff --git a/src/routes/auth.ts b/src/routes/auth.ts index 56a2a5f84..4326cbdb6 100644 --- a/src/routes/auth.ts +++ b/src/routes/auth.ts @@ -5,7 +5,9 @@ import { login, updatePassword, register, - validateRefreshToken + validateRefreshToken, + loginWithGoogleLink, + loginWithGoogleVerify } from "../rest/auth"; import { verifyToken } from "../helpers/jwt"; @@ -80,3 +82,20 @@ export const routeAuthResetPasswordRecover = async ( await updatePassword(token, password, res.locals); res.json({ success: true }); }; + +export const routeAuthLoginWithGoogleLink = async ( + req: Request, + res: Response +) => { + res.json({ redirect: loginWithGoogleLink() }); +}; + +export const routeAuthLoginWithGoogleVerify = async ( + req: Request, + res: Response +) => { + const code = + req.body.code || (req.get("Authorization") || "").replace("Bearer ", ""); + if (!code) throw new Error(ErrorCode.MISSING_TOKEN); + res.json(await loginWithGoogleVerify(code, res.locals)); +}; diff --git a/src/routes/index.ts b/src/routes/index.ts index 5e6bef91a..97f7a7597 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -20,7 +20,9 @@ import { routeAuthResetPasswordRequest, routeAuthResetPasswordRecover, routeAuthRegister, - routeAuthRefresh + routeAuthRefresh, + routeAuthLoginWithGoogleLink, + routeAuthLoginWithGoogleVerify } from "./auth"; import { routeMembershipGet, routeMembershipCreate } from "./membership"; @@ -48,6 +50,8 @@ const routesAuth = (app: Application) => { "/auth/reset-password/recover", asyncHandler(routeAuthResetPasswordRecover) ); + app.get("/auth/google/link", asyncHandler(routeAuthLoginWithGoogleLink)); + app.post("/auth/google/verify", asyncHandler(routeAuthLoginWithGoogleVerify)); }; const routesUser = (app: Application) => { diff --git a/yarn.lock b/yarn.lock index a2ce166f4..1ae25b2c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -456,6 +456,13 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + accepts@~1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" @@ -487,6 +494,13 @@ acorn@^6.0.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== +agent-base@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== + dependencies: + es6-promisify "^5.0.0" + ajv@^6.5.5: version "6.10.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" @@ -702,6 +716,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +base64-js@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -730,7 +749,7 @@ bcrypt@^3.0.6: nan "2.13.2" node-pre-gyp "0.12.0" -bignumber.js@7.2.1: +bignumber.js@7.2.1, bignumber.js@^7.0.0: version "7.2.1" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f" integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ== @@ -1368,6 +1387,18 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" +es6-promise@^4.0.3: + version "4.2.6" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f" + integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -1415,6 +1446,11 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + exec-sh@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" @@ -1532,7 +1568,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.2: +extend@^3.0.2, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -1576,6 +1612,11 @@ fast-levenshtein@~2.0.4: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-text-encoding@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz#3e5ce8293409cfaa7177a71b9ca84e1b1e6f25ef" + integrity sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ== + fb-watchman@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" @@ -1705,6 +1746,24 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +gaxios@^1.0.2, gaxios@^1.0.4, gaxios@^1.2.1, gaxios@^1.2.2: + version "1.8.4" + resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-1.8.4.tgz#e08c34fe93c0a9b67a52b7b9e7a64e6435f9a339" + integrity sha512-BoENMnu1Gav18HcpV9IleMPZ9exM+AvUjrAOV4Mzs/vfz2Lu/ABv451iEXByKiMPn2M140uul1txXCg83sAENw== + dependencies: + abort-controller "^3.0.0" + extend "^3.0.2" + https-proxy-agent "^2.2.1" + node-fetch "^2.3.0" + +gcp-metadata@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-1.0.0.tgz#5212440229fa099fc2f7c2a5cdcb95575e9b2ca6" + integrity sha512-Q6HrgfrCQeEircnNP3rCcEgiDv7eF9+1B+1MMgpE190+/+0mjQR8PxeOaRgxZWmdDAF9EIryHB9g1moPiw1SbQ== + dependencies: + gaxios "^1.0.2" + json-bigint "^0.3.0" + get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" @@ -1766,6 +1825,49 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.11.0.tgz#dcf93757fa2de5486fbeed7118538adf789e9c2e" integrity sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw== +google-auth-library@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-3.1.2.tgz#ff2f88cd5cd2118a57bd3d5ad3c093c8837fc350" + integrity sha512-cDQMzTotwyWMrg5jRO7q0A4TL/3GWBgO7I7q5xGKNiiFf9SmGY/OJ1YsLMgI2MVHHsEGyrqYnbnmV1AE+Z6DnQ== + dependencies: + base64-js "^1.3.0" + fast-text-encoding "^1.0.0" + gaxios "^1.2.1" + gcp-metadata "^1.0.0" + gtoken "^2.3.2" + https-proxy-agent "^2.2.1" + jws "^3.1.5" + lru-cache "^5.0.0" + semver "^5.5.0" + +google-p12-pem@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-1.0.4.tgz#b77fb833a2eb9f7f3c689e2e54f095276f777605" + integrity sha512-SwLAUJqUfTB2iS+wFfSS/G9p7bt4eWcc2LyfvmUXe7cWp6p3mpxDo6LLI29MXdU6wvPcQ/up298X7GMC5ylAlA== + dependencies: + node-forge "^0.8.0" + pify "^4.0.0" + +googleapis-common@^0.7.0: + version "0.7.2" + resolved "https://registry.yarnpkg.com/googleapis-common/-/googleapis-common-0.7.2.tgz#a694f55d979cb7c2eac21a0e0439af12f9b418ba" + integrity sha512-9DEJIiO4nS7nw0VE1YVkEfXEj8x8MxsuB+yZIpOBULFSN9OIKcUU8UuKgSZFU4lJmRioMfngktrbkMwWJcUhQg== + dependencies: + gaxios "^1.2.2" + google-auth-library "^3.0.0" + pify "^4.0.0" + qs "^6.5.2" + url-template "^2.0.8" + uuid "^3.2.1" + +googleapis@^39.2.0: + version "39.2.0" + resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-39.2.0.tgz#5c81f721e9da2e80cb0b25821ed60d3bc200c3da" + integrity sha512-66X8TG1B33zAt177sG1CoKoYHPP/B66tEpnnSANGCqotMuY5gqSQO8G/0gqHZR2jRgc5CHSSNOJCnpI0SuDxMQ== + dependencies: + google-auth-library "^3.0.0" + googleapis-common "^0.7.0" + got@^6.7.1: version "6.7.1" resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" @@ -1798,6 +1900,17 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= +gtoken@^2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-2.3.3.tgz#8a7fe155c5ce0c4b71c886cfb282a9060d94a641" + integrity sha512-EaB49bu/TCoNeQjhCYKI/CurooBKkGxIqFHsWABW0b25fobBYVTMe84A8EBVVZhl8emiUdNypil9huMOTmyAnw== + dependencies: + gaxios "^1.0.4" + google-p12-pem "^1.0.0" + jws "^3.1.5" + mime "^2.2.0" + pify "^4.0.0" + handlebars@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" @@ -1922,6 +2035,14 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + iconv-lite@0.4.23: version "0.4.23" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" @@ -2724,6 +2845,13 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +json-bigint@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-0.3.0.tgz#0ccd912c4b8270d05f056fbd13814b53d3825b1e" + integrity sha1-DM2RLEuCcNBfBW+9E4FLU9OCWx4= + dependencies: + bignumber.js "^7.0.0" + json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -2793,7 +2921,7 @@ jwa@^1.4.1: ecdsa-sig-formatter "1.0.11" safe-buffer "^5.0.1" -jws@^3.2.2: +jws@^3.1.5, jws@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== @@ -2960,6 +3088,13 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" +lru-cache@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -3078,6 +3213,11 @@ mime@1.4.1: resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== +mime@^2.2.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78" + integrity sha512-zJBfZDkwRu+j3Pdd2aHsR5GfH2jIWhmL1ZzBoc+X+3JEti2hbArWcyJ+1laC1D2/U/W1a/+Cegj0/OnEU2ybjg== + mimic-fn@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -3218,6 +3358,16 @@ node-emoji@^1.10.0: dependencies: lodash.toarray "^4.4.0" +node-fetch@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.4.1.tgz#b2e38f1117b8acbedbe0524f041fb3177188255d" + integrity sha512-P9UbpFK87NyqBZzUuDBDz4f6Yiys8xm8j7ACDbi6usvFm6KItklQUKjeoqTrYS/S1k6I8oaOC2YLLDr/gg26Mw== + +node-forge@^0.8.0: + version "0.8.2" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.8.2.tgz#b4bcc59fb12ce77a8825fc6a783dfe3182499c5a" + integrity sha512-mXQ9GBq1N3uDCyV1pdSzgIguwgtVpM7f5/5J4ipz12PKWElmPpVWLDuWl8iXmhysr21+WmX/OJ5UKx82wjomgg== + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" @@ -3609,7 +3759,7 @@ pify@^3.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= -pify@^4.0.1: +pify@^4.0.0, pify@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== @@ -3722,7 +3872,7 @@ qs@6.5.2, qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -qs@6.7.0: +qs@6.7.0, qs@^6.5.2: version "6.7.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== @@ -4644,6 +4794,11 @@ url-parse-lax@^1.0.0: dependencies: prepend-http "^1.0.1" +url-template@^2.0.8: + version "2.0.8" + resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" + integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" @@ -4667,7 +4822,7 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.3.2: +uuid@^3.2.1, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==