Skip to content

Reject invalid configuration keys - #4

Open
SoundGoof wants to merge 1 commit into
masterfrom
fix/strict-configuration
Open

SoundGoof wants to merge 1 commit into
masterfrom
fix/strict-configuration

Conversation

@SoundGoof

Copy link
Copy Markdown
Member

Summary

Reject invalid or misspelled configuration keys instead of silently ignoring
them.

In bolkedebruin#153, unsupported values such as the top-level authentication key and
Server.Tls: off were ignored. This resulted in a misleading
Not enough hosts to connect to specified error instead of identifying the
invalid configuration.

Changes

  • Decode the complete configuration in strict mode.
  • Report unknown top-level and nested keys.
  • Validate Server.Tls against auto, enable, and disable.
  • Report decoding and validation errors together.
  • Preserve case-insensitive YAML keys and inline comments.
  • Remove obsolete defaults that do not correspond to configuration fields.

Testing

  • Added tests for unknown top-level and nested keys.
  • Added coverage for invalid TLS modes and combined errors.
  • Verified valid lowercase YAML with comments still loads.
  • go test -mod=mod ./...
  • go vet -mod=mod ./...

Fixes bolkedebruin#153

@SoundGoof
SoundGoof force-pushed the fix/strict-configuration branch from 64fc5a4 to e25be77 Compare August 21, 2026 13:25
@SoundGoof
SoundGoof force-pushed the fix/strict-configuration branch from e25be77 to bb5b70e Compare August 21, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not enough hosts to connect to specified

1 participant