From 0f0390cb6ab0a55ce8b55946e9be4e4182c5ce58 Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Tue, 7 Jun 2022 13:31:08 -0700 Subject: [PATCH] Fix secret access for some email sending functions (#449) --- functions/src/market-close-emails.ts | 5 +++-- functions/src/stripe.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/functions/src/market-close-emails.ts b/functions/src/market-close-emails.ts index 382751f6..17700613 100644 --- a/functions/src/market-close-emails.ts +++ b/functions/src/market-close-emails.ts @@ -5,8 +5,9 @@ import { Contract } from '../../common/contract' import { getPrivateUser, getUserByUsername } from './utils' import { sendMarketCloseEmail } from './emails' -export const marketCloseEmails = functions.pubsub - .schedule('every 1 hours') +export const marketCloseEmails = functions + .runWith({ secrets: ['MAILGUN_KEY'] }) + .pubsub.schedule('every 1 hours') .onRun(async () => { await sendMarketCloseEmails() }) diff --git a/functions/src/stripe.ts b/functions/src/stripe.ts index a5d1482f..f9da593f 100644 --- a/functions/src/stripe.ts +++ b/functions/src/stripe.ts @@ -90,7 +90,7 @@ export const createCheckoutSession = functions export const stripeWebhook = functions .runWith({ minInstances: 1, - secrets: ['STRIPE_APIKEY', 'STRIPE_WEBHOOKSECRET'], + secrets: ['MAILGUN_KEY', 'STRIPE_APIKEY', 'STRIPE_WEBHOOKSECRET'], }) .https.onRequest(async (req, res) => { const stripe = initStripe()