Skip to content

chore: remove dead code left over from the API-key migration - #30

Merged
ayoubfaouzi merged 1 commit into
mainfrom
chore/remove-dead-code
Aug 3, 2026
Merged

chore: remove dead code left over from the API-key migration#30
ayoubfaouzi merged 1 commit into
mainfrom
chore/remove-dead-code

Conversation

@ayoubfaouzi

@ayoubfaouzi ayoubfaouzi commented Aug 3, 2026

Copy link
Copy Markdown
Member

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, and DatabaseCfg were loaded into Config but 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. Config is now just credentials, matching what saferwall-cli init writes.
  • internal/webapi/users.go + internal/entity/user.go: ListUsers/ListUsersWithIndex are referenced nowhere, hardcoded the production API URL (ignoring the configured one), and contained an unchecked pages.Items.([]any) assertion. Deleted, along with the unused usersURL/usersEndpoint on Service.
  • cmd/scan.go: the unused statusQueued/statusScanning constants flagged by the linter (statusCompleted stays — it's used by the scan TUI).
  • config.Load: the env parameter and its local/dev/prod switch were only ever called with ""; the function now just loads config.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 tidy is a no-op.

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.
@ayoubfaouzi
ayoubfaouzi merged commit 0d3deb0 into main Aug 3, 2026
3 checks passed
@ayoubfaouzi
ayoubfaouzi deleted the chore/remove-dead-code branch August 3, 2026 13:25
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