chore: remove dead code left over from the API-key migration - #30
Merged
Conversation
The CLI talks exclusively to the web API, but internal/config still declared storage (S3/MinIO/local) and Couchbase sections that nothing reads, inviting users to put live credentials in a config file for no reason. Remove them along with the never-called users API client (which also hardcoded the production URL), its entity, the unused users endpoint on Service, the unused statusQueued/statusScanning constants, and the env switch in config.Load that was only ever called with the default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fifth item from the improvement backlog. The CLI is web-API-only, but several leftovers from the direct-storage/DB era were still around:
internal/config:StorageCfg,AWSS3Cfg,MinIOCfg,LocalFsCfg, andDatabaseCfgwere loaded intoConfigbut read by nothing. Beyond being dead weight, they invited users to keep live S3/MinIO/Couchbase credentials in the config file that the tool never uses.Configis now justcredentials, matching whatsaferwall-cli initwrites.internal/webapi/users.go+internal/entity/user.go:ListUsers/ListUsersWithIndexare referenced nowhere, hardcoded the production API URL (ignoring the configured one), and contained an uncheckedpages.Items.([]any)assertion. Deleted, along with the unusedusersURL/usersEndpointonService.cmd/scan.go: the unusedstatusQueued/statusScanningconstants flagged by the linter (statusCompletedstays — it's used by the scan TUI).config.Load: theenvparameter and its local/dev/prod switch were only ever called with""; the function now just loadsconfig.toml.Verified before each deletion that nothing outside the deleted code references it.
Test plan
go build ./... && go vet ./... && go test -race ./...passes locally;go mod tidyis a no-op.