fix(agent): secure diagnostics and require TLS to central
Heimdall Gitea / Build and tests (pull_request) Failing after 2m24s
Heimdall Gitea / Publish versioned release (pull_request) Skipped

This commit is contained in:
Arnaud Dartois committed 2026-10-22 06:56:06 +02:00
1 parent 75a09aaf9a
commit 8ebcdb81a6
7 files changed
+30 -11

No files matched your search

+4
View File
@@ -39,6 +39,10 @@ if (!string.IsNullOrEmpty(sentryDsn))
builder.Services.AddOptions<AgentOptions>()
.BindConfiguration(AgentOptions.SectionName)
.ValidateDataAnnotations()
.Validate(options => Uri.TryCreate(options.CentralUrl, UriKind.Absolute, out var centralUri) &&
(centralUri.Scheme == Uri.UriSchemeHttps ||
(options.AllowInsecureHttp && centralUri.Scheme == Uri.UriSchemeHttp)),
"Agent:CentralUrl must use HTTPS unless Agent:AllowInsecureHttp is explicitly enabled.")
.ValidateOnStart();
// HTTP clients