invertase / stripe-firebase-extensions

Repository of Firebase Extensions built by Stripe.
https://firebase.google.com/products/extensions
Apache License 2.0
438 stars 172 forks source link

STRIPE_API_KEY issues within Google Cloud Manager #467

Open b0ot opened 1 year ago

b0ot commented 1 year ago

Bug report

Describe the bug

I created separate Firebase Project for Dev/Prod and noticed that I was getting the errors in the firebase-debug.log that were stating that NO API KEY was being provided on my checkout session requests. A lot of digging later and I think that there may be an issue related to how the extension is handling the STRIPE_API_KEYS

Details:

After configuring the Stripe Extension via the Firebase Console I'm seeing 2x 'secret' keys being added to Google 'Secret Manager' for the STRIPE_API_KEY

  1. firestore-stripe-payments-STRIPE_API_KEY
  2. firestore-stripe-payments-STRIPE_API_KEY-XXXX

where XXXX appears to be lowercase letters/numbers

If I look at the auto-generated ./extensions/firestore-stripe-payments.env file it seems to reference the -XXXX version STRIPE_API_KEY=projects/${param:PROJECT_NUMBER}/secrets/firestore-stripe-payments-STRIPE_API_KEY-XXXX/versions/latest

Expectations: It should only have one value in Secret Manager for EACH project for the API KEY within Google Cloud Manager

Issues Caused:

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Configure or Reconfigure the Firebase Run Payments with Stripe extension.

Expected behavior

Additional expectation (more feature request) that the Stripe Extension would have allowed you to configure both a 'Test' and 'Prod' key for a single project. This supports the workflow for local testing on emulators to pushing to production online.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

Additional context

Add any other context about the problem here.

imbradyboy commented 1 year ago

@jsteele-stripe can you take a look at this? It's been dormant for quite a while, but is being raised as a critical issue in the Firebase Me Discord community