Skip to content

Support env var references for Stripe API keys#132

Merged
reshmabidikar merged 1 commit intokillbill:pr-132from
swistaczek:feature/env-var-api-keys
Feb 20, 2026
Merged

Support env var references for Stripe API keys#132
reshmabidikar merged 1 commit intokillbill:pr-132from
swistaczek:feature/env-var-api-keys

Conversation

@swistaczek
Copy link
Copy Markdown
Contributor

Summary

  • Add ${env:VAR_NAME} syntax for Stripe API key config so secrets never enter the database
  • Resolve env var references in StripeConfigProperties for apiKey and publicKey
  • Existing plaintext configurations continue to work with zero changes

This is a lighter alternative to #131. That PR adds AES-256-GCM encryption (ENC()) + env var references. This PR takes a simpler approach: env var references only, with no crypto code. Both are backward compatible. See #131 for the encryption approach if multi-tenant per-DB-row secrets are needed.

Test plan

  • TestStripeConfigPropertyResolver.testPlaintextPassthrough — raw values returned as-is
  • TestStripeConfigPropertyResolver.testNullPassthrough — null handled gracefully
  • TestStripeConfigPropertyResolver.testEnvVarResolution${env:HOME} resolves correctly
  • TestStripeConfigPropertyResolver.testEnvVarNotSetFails — missing env var throws IllegalStateException
  • TestStripeConfigPropertyResolver.testBackwardCompatibilityWithStripeConfigProperties — existing plaintext config works through StripeConfigProperties

🤖 Generated with Claude Code

Allow operators to reference environment variables in tenant config
using ${env:VAR_NAME} syntax so that Stripe API keys never enter the
database. Existing plaintext configurations continue to work unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@reshmabidikar reshmabidikar left a comment

Choose a reason for hiding this comment

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

There are some ci failures, could you look at those?

@reshmabidikar reshmabidikar changed the base branch from master to pr-132 February 20, 2026 08:15
@reshmabidikar reshmabidikar merged commit 1009b55 into killbill:pr-132 Feb 20, 2026
8 of 22 checks passed
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