@@ -59,19 +59,17 @@ GOPROXY=direct go build -o bin/boot-service ./cmd/server
5959make build
6060```
6161
62- ** Note** : ` go.mod ` has ` replace github.com/openchami/fabrica => ../fabrica ` for local development.
63-
6462### Running
6563
6664``` bash
6765# Copy and edit config first
6866cp config.example.yaml config.yaml
6967
7068# Run with config file
71- ./bin/boot-service serve
69+ ./bin/server serve
7270
7371# Override with flags
74- ./bin/boot-service serve --port 8082 --enable-auth --hsm-url http://localhost:27779
72+ ./bin/server serve --port 8082 --enable-auth --hsm-url http://localhost:27779
7573```
7674
7775### Testing
@@ -148,7 +146,7 @@ Three templates exist: `DefaultIPXETemplate`, `MinimalIPXETemplate`, `ErrorIPXET
148146
149147### TokenSmith Integration
150148
151- Authentication is ** optional ** and controlled via config. Three modes:
149+ The repository contains a reusable ` pkg/auth ` package with three common modes:
152150
153151``` go
154152// Development - auth disabled
@@ -163,6 +161,11 @@ config.JWKSURL = "https://auth.openchami.org/.well-known/jwks.json"
163161config.RequiredScopes = []string {" boot:read" }
164162```
165163
164+ ** Important current runtime note** : the standalone server in ` cmd/server/main.go `
165+ does not currently attach ` pkg/auth.CreateMiddleware(...) ` to its route tree.
166+ ` enable_auth ` currently affects startup validation and TokenSmith-backed HSM
167+ service-token exchange, not documented request-time route enforcement.
168+
166169### Middleware Application
167170
168171** IMPORTANT** : Apply middleware to router ** before** registering routes:
@@ -200,35 +203,38 @@ Common scopes: `boot:read`, `boot:write`, `boot:admin`, `node:read`, `node:write
200203# config.yaml structure
201204port : 8080
202205enable_auth : false
203- enable_metrics : true
206+ enable_metrics : false
204207enable_legacy_api : true
208+ # metrics_port is configured separately because it becomes active as soon as
209+ # metrics are enabled, even though metrics default to off.
210+ metrics_port : 9090
205211hsm_url : " http://localhost:27779"
206-
207- auth :
208- enabled : false
209- jwks_url : " https://auth.example.com/.well-known/jwks.json"
210- required_scopes : ["boot:read"]
212+ tokensmith_url : " http://localhost:8080"
211213` ` `
212214
213- Environment variables use prefix ` BOOT_SERVICE_` (e.g., `BOOT_SERVICE_PORT=8082`).
215+ Environment variables use prefix ` BOOT_SERVICE_` for standard server settings,
216+ plus `TOKENSMITH_*` for bootstrap-token exchange settings.
214217
215218# # External Service Integration
216219
217220# ## HSM (Hardware State Manager)
218221
219222**Auto-enabled** when `--hsm-url` flag is provided or `hsm_url` is set in config.
220223
221- **Current Status**: HSM client is initialized and validates connectivity, but not yet fully integrated into the boot script generation pipeline.
224+ **Current Status**: HSM-backed node resolution is wired into the server through
225+ ` FlexibleBootScriptController` in `cmd/server/server_extensions.go` when
226+ ` hsm_url` is configured.
222227
223228**Implementation**:
224229- HSM client : ` pkg/clients/hsm/client.go` - HTTP client for HSM v2 API with caching
225230- Integration service : ` pkg/clients/hsm/integration.go` - Wraps HSM client with node provider interface
226231- Flexible controller : ` pkg/controllers/bootscript/flexible_controller.go` - Supports pluggable node providers
227232
228- **Integration Options** (see TODOs in `cmd/server/main.go`):
229- 1. **FlexibleBootScriptController** : Use `NewFlexibleBootScriptController` with HSM provider config
230- 2. **Controller-level** : Add NodeProvider parameter to BootScriptController
231- 3. **Storage-level** : Add HSM fallback in storage.GetNode() for transparent integration
233+ **Current Integration Path**:
234+ 1. Build an HSM client in `cmd/server/main.go`
235+ 2. Create `FlexibleBootScriptController` in `cmd/server/server_extensions.go`
236+ 3. Register legacy routes with `NewLegacyHandlerWithController(...)`
237+ 4. Start optional HSM background sync when enabled
232238
233239**Node resolution with HSM** (when integrated):
234240- XName lookups : Direct HSM component query (`/hsm/v2/State/Components/{xname}`)
@@ -237,7 +243,9 @@ Environment variables use prefix `BOOT_SERVICE_` (e.g., `BOOT_SERVICE_PORT=8082`
237243
238244**Caching**: HSM responses are cached (default: 5 minutes) to reduce load on HSM service.
239245
240- **Current Limitation**: Legacy BSS API handlers use standard BootScriptController which queries local storage only. To enable HSM for boot scripts, modify handlers to accept controller interface and pass FlexibleBootScriptController instance.
246+ **Current Limitation**: The legacy `/boot/v1/bootscript` HTTP route ignores the
247+ ` profile` query parameter and always asks the controller to auto-resolve the
248+ best configuration across profiles.
241249
242250# ## TokenSmith
243251
0 commit comments