Skip to content

Fix adversarial options injection - #267

Closed
snapetech wants to merge 1 commit into
mainfrom
agent/fix-adversarial-options-injection
Closed

Fix adversarial options injection#267
snapetech wants to merge 1 commit into
mainfrom
agent/fix-adversarial-options-injection

Conversation

@snapetech

Copy link
Copy Markdown
Owner

What changed

  • inject IOptions<AdversarialOptions> into SecurityController
  • retain the resolved value for the existing settings and statistics endpoints
  • update the focused controller test and changelog

Root cause

The experimental service graph registers AdversarialOptions through the options framework, but SecurityController requested the value object directly. Dependency injection therefore supplied the constructor's optional null default, and GET /api/v0/security/adversarial returned 404 even when adversarial settings were configured.

Impact

Configured adversarial settings are now available to the security controller through the same registration used by the rest of the service graph.

Validation

dotnet test tests/slskd.Tests.Unit/slskd.Tests.Unit.csproj -c Release --filter FullyQualifiedName~SecurityControllerTests --no-restore

Result: 6 passed.

@snapetech snapetech closed this Jul 17, 2026
@snapetech
snapetech deleted the agent/fix-adversarial-options-injection branch July 24, 2026 17:36
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.

1 participant