Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/hyperfleet-api/environments/framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"reflect"
"testing"

. "github.com/onsi/gomega"
"github.com/spf13/pflag"

"github.com/openshift-hyperfleet/hyperfleet-api/pkg/config"
Expand Down Expand Up @@ -51,3 +52,11 @@ 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",
)
}
2 changes: 1 addition & 1 deletion cmd/hyperfleet-api/environments/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
ProductionEnv string = "production"

EnvironmentStringKey string = "HYPERFLEET_ENV"
EnvironmentDefault = DevelopmentEnv
EnvironmentDefault = ProductionEnv

// Database SSL modes
SSLModeDisable string = "disable"
Expand Down
2 changes: 2 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down