This commit is contained in:
greeneclipse committed 2026-10-20 17:03:09 +02:00
1 parent 486502852e
commit 0e48ea427b
23 files changed
+386 -78

No files matched your search

+27 -24
View File
@@ -35,6 +35,8 @@ const (
KeyEPRELAPIKey = "eprel.api_key"
KeyFeedPrivateAllowlist = "feeds.private_url_allowlist"
// Admin reference valuation for one processing credit; not a Stripe price.
KeyBillingReferenceEURPerCredit = "billing.reference_eur_per_credit"
KeyPineconeAPIKey = "pinecone.api_key"
KeyPineconeHost = "pinecone.host"
@@ -55,30 +57,31 @@ func SecretValueKeys() map[string]struct{} {
// AllowedValueKeys is the allowlist for Values bag writes (mass-assignment guard).
func AllowedValueKeys() map[string]struct{} {
out := map[string]struct{}{
KeyStripeSecretKey: {},
KeyStripeWebhookSecret: {},
KeyStripeMock: {},
KeyStripePriceStarterMo: {},
KeyStripePriceStarterYr: {},
KeyStripePricePlusMo: {},
KeyStripePricePlusYr: {},
KeyStripePriceGrowthMo: {},
KeyStripePriceGrowthYr: {},
KeyStripePriceBizMo: {},
KeyStripePriceBizYr: {},
KeyStripePriceScaleMo: {},
KeyStripePriceScaleYr: {},
KeyEPRELEnabled: {},
KeyEPRELBaseURL: {},
KeyEPRELTimeout: {},
KeyEPRELFicheLanguage: {},
KeyEPRELAPIKey: {},
KeyFeedPrivateAllowlist: {},
KeyPineconeAPIKey: {},
KeyPineconeHost: {},
KeyPineconeNamespace: {},
ValueKeyResendAPIKey: {},
ValueKeyEmailDryRun: {},
KeyStripeSecretKey: {},
KeyStripeWebhookSecret: {},
KeyStripeMock: {},
KeyStripePriceStarterMo: {},
KeyStripePriceStarterYr: {},
KeyStripePricePlusMo: {},
KeyStripePricePlusYr: {},
KeyStripePriceGrowthMo: {},
KeyStripePriceGrowthYr: {},
KeyStripePriceBizMo: {},
KeyStripePriceBizYr: {},
KeyStripePriceScaleMo: {},
KeyStripePriceScaleYr: {},
KeyEPRELEnabled: {},
KeyEPRELBaseURL: {},
KeyEPRELTimeout: {},
KeyEPRELFicheLanguage: {},
KeyEPRELAPIKey: {},
KeyFeedPrivateAllowlist: {},
KeyBillingReferenceEURPerCredit: {},
KeyPineconeAPIKey: {},
KeyPineconeHost: {},
KeyPineconeNamespace: {},
ValueKeyResendAPIKey: {},
ValueKeyEmailDryRun: {},
}
for _, pack := range billing.DefaultCreditPacks() {
out[billing.CreditPackSettingsKey(pack.ID)] = struct{}{}
@@ -61,6 +61,12 @@ func TestSecretValueKeys(t *testing.T) {
}
func TestAllowedValueKeys(t *testing.T) {
if !isAllowedValueKey(KeyBillingReferenceEURPerCredit) {
t.Fatal("admin EUR per credit reference must be writable")
}
if isSecretValueKey(KeyBillingReferenceEURPerCredit) {
t.Fatal("EUR per credit reference is not a secret")
}
if !isAllowedValueKey(KeyEPRELFicheLanguage) {
t.Fatal("eprel.fiche_language must be allowed")
}