Skip to content

chore: remove verified-dead code (token adapter, role domain repo, 2FA setup port)#218

Open
ahmetabdullahgultekin wants to merge 1 commit into
mainfrom
chore/dead-code-2026-06-12
Open

chore: remove verified-dead code (token adapter, role domain repo, 2FA setup port)#218
ahmetabdullahgultekin wants to merge 1 commit into
mainfrom
chore/dead-code-2026-06-12

Conversation

@ahmetabdullahgultekin

Copy link
Copy Markdown
Contributor

Pure removal of verified-dead code in identity-core-api. No behavior changes, no enum pruning, no config edits, no bug fixes. Each candidate was verified dead multiple ways before removal; anything with any sign of use was KEPT.

PR-only — do NOT merge before independent review.

Per-item verification

Item name-grep (api+web+client) Spring DI-by-type reflection / yml / SpEL REST path (all 3 repos) Decision
TokenGenerationAdapter.java only its own decl 2nd impl of TokenGenerationPort; JwtService is @Service @Primary + also implements port → all by-type sites resolve to JwtService; no @Qualifier to adapter none n/a (internal) DELETED
RoleDomainRepository.java + RoleDomainRepositoryAdapter.java interface has 0 injection sites; adapter only its own decl + a doc comment ManageRoleService injects RoleRepositoryPort, not the domain repo; nothing injects RoleDomainRepository none n/a (internal) DELETED
Setup2FAUseCase.java + TwoFactorSetupResponse.java 0 implementations, 0 callers; DTO referenced only by that port no bean depends on Setup2FAUseCase none n/a (internal) DELETED
StepUpController.java (/api/v1/step-up/*) /step-up/* actively called by web-app features/auth/components/StepUpDeviceRegistration.tsx and client-apps AuthBiometricApiImpl.kt (BASE_PATH="step-up", DI-wired NetworkModule → FingerprintRepositoryImpl). NOT a duplicate of the distinct /api/v1/auth/biometric/{devices,challenge,verify} on BiometricController. KEPT (not dead)

Removed files

  • infrastructure/adapter/TokenGenerationAdapter.java
  • domain/repository/RoleDomainRepository.java
  • infrastructure/adapter/RoleDomainRepositoryAdapter.java
  • application/port/input/Setup2FAUseCase.java
  • application/dto/response/TwoFactorSetupResponse.java

Verification & V&V

  • mvn -B -ntp -o compile → BUILD SUCCESS (583 sources)
  • mvn -B -ntp -o test1778 run, 0 fail, 0 error, 67 skipped (skipped = env-gated Testcontainers ITs)
  • Re-run after clearing compiled output → identical green. Two stable green runs.

…epo, 2FA setup port)

Pure removal of code with zero references, verified multiple ways
(name-grep across identity-core-api + web-app + client-apps, Spring
DI-by-type injection-site analysis, resource/reflection scan). No
behavior changes, no enum/config edits.

Removed:
- infrastructure/adapter/TokenGenerationAdapter.java
  Second @component impl of TokenGenerationPort. JwtService is @service
  @primary and also implements the port; all by-type injection sites
  resolve to JwtService. Adapter had no name/qualifier references.
- domain/repository/RoleDomainRepository.java
  infrastructure/adapter/RoleDomainRepositoryAdapter.java
  Domain-model repo port + its @repository adapter. Interface had zero
  injection sites; ManageRoleService uses RoleRepositoryPort instead.
- application/port/input/Setup2FAUseCase.java
  application/dto/response/TwoFactorSetupResponse.java
  Input port with zero implementations and zero callers; its response
  DTO was referenced only by that port.

Kept (NOT dead): StepUpController — /api/v1/step-up/* is still called
live by web-app (StepUpDeviceRegistration.tsx) and client-apps
(AuthBiometricApiImpl BASE_PATH=step-up); not a duplicate of the
distinct /api/v1/auth/biometric/* routes on BiometricController.

Verification: mvn -B -ntp -o test green twice (1778 run, 0 fail,
67 env-gated ITs skipped).
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