feat: allow production provider bootstrap

This commit is contained in:
inman
2026-08-18 00:36:05 +08:00
parent 6480e503eb
commit 22fc7a56d8
21 changed files with 192 additions and 18 deletions

View File

@@ -77,6 +77,19 @@ func TestApplicationRejectsInvalidProductionDatabaseConfiguration(t *testing.T)
}
}
func TestProductionProviderBootstrapFlagAllowsApplicationComposition(t *testing.T) {
app, err := application.New(application.Options{Getenv: applicationEnv(map[string]string{
"NODE_ENV": "production",
"ZHINIAN_DATA_BACKEND": "postgres",
"DATABASE_URL": "postgres://user:password@127.0.0.1:5432/zhinian",
"ZHINIAN_ALLOW_UNCONFIGURED_PROVIDERS": "true",
})})
if err != nil {
t.Fatalf("New() with provider bootstrap flag = %v", err)
}
app.Close()
}
func TestProductionLocalBackendNeverGrantsAnonymousAdministrator(t *testing.T) {
app, err := application.New(application.Options{Getenv: applicationEnv(map[string]string{
"NODE_ENV": "production",