JanssenProject / JanssenProject/jans

feat(jans-fido2): remove stale TODO and commented-out /options/generate block in AssertionController

Open
#14,042 1 comment 1 reaction 1 assignee Claimed by @imran-ishaq View on GitHub
comp-jans-fido2 kind-feature
Dominant language
Java
Stars
648
Forks
174
Avg merge
1d 18h
Merged PRs (30d)
110

Description

Describe the bug

[AssertionController.java](vscode-webview://1reblc1tfr3jcmu4ndk5asfc7846nlmid2deapa06l6m3h4j0s0o/jans-fido2/server/src/main/java/io/jans/fido2/ws/rs/controller/AssertionController.java) contained a stale //TODO: delete this when checking issue related to isAssertionOptionsGenerateEndpointEnabled marker on line 71, followed by a large /* ... */ block (originally lines 72–84) holding a disabled generateAuthenticate endpoint mapped to /options/generate. This dead code added noise, misled readers into thinking the endpoint was still part of the controller's API surface, and left a long-lingering TODO with no owner or tracking issue. The corresponding test file ([AssertionControllerTest.java](vscode-webview://1reblc1tfr3jcmu4ndk5asfc7846nlmid2deapa06l6m3h4j0s0o/jans-fido2/server/src/test/java/io/jans/fido2/ws/rs/controller/AssertionControllerTest.java)) carried matching commented-out test blocks plus a misleadingly-named active test (generateAuthenticate_ifValidData_success, line 212) that actually exercises the unrelated /options endpoint.

To Reproduce
Steps to reproduce the behavior:

Open jans-fido2/server/src/main/java/io/jans/fido2/ws/rs/controller/AssertionController.java.
Scroll to line 71.
Observe the //TODO: delete this ... comment followed by the commented-out @POST /options/generate method.
Note that the TODO has been carried in source control without resolution despite the underlying isAssertionOptionsGenerateEndpointEnabled work being tracked elsewhere.
Expected behavior
The controller should contain only the active, supported endpoints (/options and /result). Temporary debug/placeholder code and resolved TODO markers should not be checked in. Removing the block must not affect any active runtime behavior, public API surface, or test outcomes — the related types (AssertionOptionsGenerate, AsserOptGenerateResponse, assertionService.generateOptions, isAssertionOptionsGenerateEndpointEnabled) remain in active use by the server AssertionService, the client AssertionService, ConfigurationController, and model classes, and must be left untouched.

Screenshots
N/A — code-only change. Diff is limited to deletion of lines 71–84 in AssertionController.java.

Desktop (please complete the following information):

OS: N/A (server-side Java change, platform-independent)
Browser: N/A
Version: jans-fido2 (current main)
Smartphone (please complete the following information):

Device: N/A
OS: N/A
Browser: N/A
Version: N/A
Additional context

Scope of fix: pure dead-code removal in a single file; no behavioral change, no API change, no dependency change.
Verification performed before deletion:
Grepped the repository for every symbol referenced inside the commented block (AssertionOptionsGenerate, AsserOptGenerateResponse, generateOptions, isAssertionOptionsGenerateEndpointEnabled, /options/generate) and confirmed they remain referenced by live, non-deleted code paths.
Inspected [AssertionControllerTest.java](vscode-webview://1reblc1tfr3jcmu4ndk5asfc7846nlmid2deapa06l6m3h4j0s0o/jans-fido2/server/src/test/java/io/jans/fido2/ws/rs/controller/AssertionControllerTest.java): all real tests targeting the dormant endpoint are themselves commented out (lines 123–209); the only active test with a generateAuthenticate* name (line 212) actually calls assertionController.authenticate(...) against the still-present /options endpoint, so it is unaffected.
Follow-up (out of scope for this fix): the misleadingly named test on line 212 of AssertionControllerTest.java should be renamed to reflect that it exercises authenticate(...) / /options, not the removed generateAuthenticate.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.