Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotswap Stripe API secrets when they are updated. #512

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

jonashendrickx
Copy link
Member

@jonashendrickx jonashendrickx commented Mar 21, 2024

Description

This pull request allows that Stripe API secrets are updated automatically without having to restart the Passwordless.dev admin console in production. Effectively reducing down-time.

The Stripe .NET SDK unfortunately does not support the options pattern.

Shape

The background service remains active during the entire application life cycle until it shuts down.

Screenshots

n/a

Checklist

I did the following to ensure that my changes were tested thoroughly:

  • Tested for Self-hosting
  • Tested for Cloud

I did the following to ensure that my changes do not introduce security vulnerabilities:

  • __

@jonashendrickx jonashendrickx requested a review from a team as a code owner March 21, 2024 08:54
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 32.55%. Comparing base (f9e27c8) to head (162a71b).

Files Patch % Lines
...ces/StripeConfigurationUpdaterBackgroundService.cs 0.00% 13 Missing ⚠️
src/AdminConsole/Pages/Billing/webhook.cshtml.cs 0.00% 3 Missing ⚠️
src/AdminConsole/Billing/BillingBootstrap.cs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #512      +/-   ##
==========================================
- Coverage   32.56%   32.55%   -0.02%     
==========================================
  Files         511      512       +1     
  Lines       26530    26543      +13     
  Branches      834      836       +2     
==========================================
  Hits         8640     8640              
- Misses      17773    17786      +13     
  Partials      117      117              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jrmccannon jrmccannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work for now. This also might be an opportunity to contribute to the sdk to add this support. Looks like they also have an open issue for better DI integration.

@jonashendrickx jonashendrickx merged commit 9152620 into main Mar 21, 2024
16 checks passed
@jonashendrickx jonashendrickx deleted the stripe-api-secrets-hotswapping branch March 21, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants