Carry every configured ETSI field into the TSL registry - #159
Merged
Merged
Conversation
Configuring the ETSI registry from a config file built etsi.TSLConfig without copying TSLURLs across, nor FollowRefs, MaxRefDepth, UserAgent, AllowNetworkAccess or FetchTimeout. A config file with tsl_urls therefore produced a registry with nothing to load, and the process exited with no trust data loaded - configure CertBundle, TSLFiles, or TSLURLs while the operator was looking at a file that plainly configures TSLURLs. The message points at the configuration rather than at the code that ignored it, so the natural reaction is to doubt the key name. A dropped field does not produce a wrong value, it produces the zero value, which is why nothing caught this. The mapping is now its own function so it can be tested, and the test asserts every field individually rather than the one that happened to be noticed - reverting the fix fails it on all five. FetchTimeout follows the LoTE registry's existing pattern: parse the duration, warn and leave the default on a bad value. Verified against a real deployment: an ETSI registry configured with tsl_urls now fetches and parses the list over HTTP, where before it refused to start. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWj5aAxqWjEm5ESCX4P1hk
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change directly addresses a concrete config-mapping bug with low risk and clear behavior, with only a minor consistency nit noted.
Pull request overview
This PR fixes ETSI TSL registry configuration mapping when configuring from a YAML config file by ensuring all relevant ETSIRegistryConfig fields are carried into etsi.TSLConfig, preventing “no trust data loaded” failures when tsl_urls is set.
Changes:
- Refactors ETSI config-to-registry mapping into a dedicated
etsiTSLConfig(...)helper. - Ensures
TSLURLs,FollowRefs,MaxRefDepth,UserAgent,AllowNetworkAccess, andFetchTimeoutare propagated from file config into the registry config (with duration parsing + warning on invalid values).
File summaries
| File | Description |
|---|---|
| cmd/gt/main.go | Extracts ETSI TSL config mapping into a testable helper and carries previously-dropped ETSI fields into etsi.TSLConfig. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| tslConfig.Name = "ETSI-TSL" | ||
| } | ||
| if tslConfig.Description == "" { | ||
| tslConfig.Description = "ETSI TS 119612 Trust Status List Registry" |
|
leifj
added a commit
that referenced
this pull request
Sep 4, 2026
#159 described a test asserting every ETSI field is carried into the registry config. The test was written and passing locally, and it is not in the repository: .gitignore's third line was an unanchored `gt`, which matches the cmd/gt *directory* as well as the built binary, so `git add -A` skipped the new file without a word and the commit looked complete. Anchors those patterns to the repository root so cmd/gt is tracked normally, and adds the missing test. Reverting #159's mapping fails it on all five fields it restored. The same shape as the bug #159 fixed, one level up: a dropped thing produces silence rather than an error, so nothing looks wrong until something downstream is missing. Claude-Session: https://claude.ai/code/session_01DWj5aAxqWjEm5ESCX4P1hk Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The bug
Configuring the ETSI registry from a config file built
etsi.TSLConfigwithout copyingTSLURLsacross — norFollowRefs,MaxRefDepth,UserAgent,AllowNetworkAccessorFetchTimeout.A config file with
tsl_urlstherefore produced a registry with nothing to load, and the process exited with:...while the operator was looking at a file that plainly configures
TSLURLs. The message points at the configuration rather than at the code that ignored it, so the natural reaction is to doubt the key name or the URL. Theloteregistry's config path has no such gap, which makes the ETSI one look like the operator's mistake.Only
tsl_filesworked, and only by accident of being one of the fields that was mapped.Why nothing caught it
A dropped field does not produce a wrong value, it produces the zero value — an empty slice, a false bool, a zero duration. Every one of those is a plausible default, so nothing downstream looks wrong until the registry has no trust data at all.
The mapping is now its own function so it can be tested, and the test asserts every field individually rather than the one that happened to be noticed. Reverting the fix fails it on all five:
FetchTimeoutfollows the LoTE registry's existing pattern: parse the duration, warn and leave the default on a bad value. A test pins that an unparseable value leaves the zero so the registry applies its default, rather than propagating "no timeout".Verified against a real deployment
An ETSI registry configured with
tsl_urlsnow fetches and parses over HTTP, where before it refused to start:The list is one published by
siros-wrpac-tool.go test ./cmd/... ./pkg/config/... ./pkg/registry/etsi/...andgolangci-lintare clean.Found while wiring sirosid-dev to a TSL; that stack currently works around this with
tsl_filesand a bind mount, which can go once this is released.🤖 Generated with Claude Code
https://claude.ai/code/session_01DWj5aAxqWjEm5ESCX4P1hk