From 1ab24eedd9bc35e0a6f0506b00c0def3e838f100 Mon Sep 17 00:00:00 2001 From: Leonardo Dorneles Date: Fri, 29 May 2026 15:17:08 -0300 Subject: [PATCH 1/3] HYPERFLEET-1133 - fix: make production the default runtime environment --- cmd/hyperfleet-api/environments/types.go | 2 +- docs/development.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/hyperfleet-api/environments/types.go b/cmd/hyperfleet-api/environments/types.go index 10c30ae0..cf267930 100755 --- a/cmd/hyperfleet-api/environments/types.go +++ b/cmd/hyperfleet-api/environments/types.go @@ -15,7 +15,7 @@ const ( ProductionEnv string = "production" EnvironmentStringKey string = "HYPERFLEET_ENV" - EnvironmentDefault = DevelopmentEnv + EnvironmentDefault = ProductionEnv // Database SSL modes SSLModeDisable string = "disable" diff --git a/docs/development.md b/docs/development.md index aeff986a..ecb4b050 100644 --- a/docs/development.md +++ b/docs/development.md @@ -91,6 +91,8 @@ pre-commit run --all-files make run-no-auth ``` +**Note**: The default runtime environment is `production` (JWT and TLS enabled). The `make run-no-auth` target explicitly disables authentication for local development. If running the binary directly, set `HYPERFLEET_ENV=development` or use `--server-jwt-enabled=false`. + The service starts on `localhost:8000`: - REST API: `http://localhost:8000/api/hyperfleet/v1/` - OpenAPI spec: `http://localhost:8000/api/hyperfleet/v1/openapi` From 288dc00b434ff821ea4cc34c7ff49e068017def8 Mon Sep 17 00:00:00 2001 From: Leonardo Dorneles Date: Fri, 29 May 2026 16:43:38 -0300 Subject: [PATCH 2/3] HYPERFLEET-1133 - test: add test coverage --- cmd/hyperfleet-api/environments/framework_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/hyperfleet-api/environments/framework_test.go b/cmd/hyperfleet-api/environments/framework_test.go index 00fe8346..c9af05ea 100755 --- a/cmd/hyperfleet-api/environments/framework_test.go +++ b/cmd/hyperfleet-api/environments/framework_test.go @@ -4,6 +4,7 @@ import ( "reflect" "testing" + . "github.com/onsi/gomega" "github.com/spf13/pflag" "github.com/openshift-hyperfleet/hyperfleet-api/pkg/config" @@ -51,3 +52,8 @@ func TestLoadServices(t *testing.T) { } } } + +func TestEnvironmentDefaultIsProduction(t *testing.T) { + RegisterTestingT(t) + Expect(EnvironmentDefault).To(Equal(ProductionEnv), "EnvironmentDefault must be ProductionEnv for secure-by-default behavior") +} From e82bac4591c2738afd8fcbb6a01e913683d0f03b Mon Sep 17 00:00:00 2001 From: Leonardo Dorneles Date: Fri, 29 May 2026 18:47:32 -0300 Subject: [PATCH 3/3] HYPERFLEET-1133 - test: add test coverage --- cmd/hyperfleet-api/environments/framework_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/hyperfleet-api/environments/framework_test.go b/cmd/hyperfleet-api/environments/framework_test.go index c9af05ea..8ec30df5 100755 --- a/cmd/hyperfleet-api/environments/framework_test.go +++ b/cmd/hyperfleet-api/environments/framework_test.go @@ -55,5 +55,8 @@ func TestLoadServices(t *testing.T) { func TestEnvironmentDefaultIsProduction(t *testing.T) { RegisterTestingT(t) - Expect(EnvironmentDefault).To(Equal(ProductionEnv), "EnvironmentDefault must be ProductionEnv for secure-by-default behavior") + Expect(EnvironmentDefault).To( + Equal(ProductionEnv), + "EnvironmentDefault must be ProductionEnv for secure-by-default behavior", + ) }