Files
descrybe/apps/api/internal/platformsettings/doc.go
T
greeneclipse 8580c996c3 Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
2026-08-09 22:47:43 +02:00

22 lines
997 B
Go

// Package platformsettings is the durable store for platform-level product and
// integration config (OpenAI, SMTP, OAuth, Stripe, EPREL, Pinecone, feed allowlist,
// generic KV) managed from the admin dashboard — so these values need not live
// only in process env.
//
// Storage (reuse, no new migration): company_settings JSONB for a reserved
// system company (SystemCompanyID). Secrets are AES-GCM enc:v1: blobs, same
// pattern as aiprovider/email/woocommerce. Integration tunables live in Values
// (see keys.go); secret Value keys are encrypted on write.
//
// Runtime reads (prefer DB, fall back to EnvConfig / process env):
//
// svc := platformsettings.NewService(pool, env)
// oi, err := svc.ResolveOpenAI(ctx)
// smtp, err := svc.ResolveSMTP(ctx)
// stripe, err := svc.ResolveStripe(ctx, base)
// eprel, err := svc.ResolveEPREL(ctx)
// pc, err := svc.ResolvePinecone(ctx)
// g, err := svc.ResolveOAuthGoogle(ctx)
// v, ok, err := svc.GetKV(ctx, "my.key")
package platformsettings