Skip to content

Remove connection details from stats response - #658

Open
andrew wants to merge 1 commit into
mainfrom
hide-stats-connection-details
Open

andrew wants to merge 1 commit into
mainfrom
hide-stats-connection-details

Conversation

@andrew

@andrew andrew commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The unauthenticated /stats endpoint exposes the storage URL and database connection description. On a public instance, this reveals internal paths and hosts, and the storage URL is returned verbatim, including any embedded credentials.

Remove storage_url and database_path so public deployments can expose cache statistics without disclosing their storage and database configuration. Update the OpenAPI schema and README example to match, and remove assertions for the deleted fields.

Summary by CodeRabbit

  • Changes
    • The /stats response no longer includes storage URL or database path details. Cache and download totals, ecosystem breakdowns, and availability information remain available.
  • Documentation
    • Updated the README and API reference to reflect the revised /stats response fields.

@andrew andrew added the breaking Changes behaviour users rely on; needs a minor release label Nov 5, 2026
Copilot AI balanced review requested due to automatic review settings November 5, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The /stats response no longer includes storage_url or database_path. The README example, Swagger definitions, and related tests reflect the updated response.

Changes: Stats response

Layer / File(s) Summary
Remove storage fields from stats response
internal/server/server.go, internal/server/server_test.go, internal/server/stats_test.go, docs/swagger/docs.go, docs/swagger/swagger.json, README.md
StatsResponse and /stats no longer expose or populate StorageURL and DatabasePath. The README example, Swagger definitions, and tests are updated.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: wickedone

Merge Risk: Minimal · up to 308cc

The narrowed /stats response contract is consistently implemented and documented, with no concrete merge-blocking risk identified.

Security architecture risk: Minimal · up to 308cc

The change reduces information disclosure without expanding endpoint access, accepting new inputs, or changing authentication. The published schema matches the narrower response. No material security risk introduced or worsened by this change was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The benefit applies to callers that can reach the unauthenticated /stats endpoint: its response no longer directly returns the configured storage URL or database connection location. The remaining aggregate-statistics exposure predates this PR.

Trust Boundaries and Controls

  • observed — The change does not add a caller, alter authentication middleware, or grant additional authority. It narrows data crossing the existing server-to-client response boundary.
Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: removing connection details from the stats response.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6010f057-6750-405a-864f-1a4da45e6bc2
Commits

Reviewing files that changed from the base of the PR and between 6c8fb35 and 308cc13.

Files selected for processing: 6

  • README.md
  • docs/swagger/docs.go
  • docs/swagger/swagger.json
  • internal/server/server.go
  • internal/server/server_test.go
  • internal/server/stats_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@simonchrz simonchrz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Nothing else reads the two fields.

One related spot: the startup log in internal/server/server.go ("storage", s.storage.URL()) still writes the storage URL verbatim, while the database next to it goes through u.Redacted(). Logs aren't public, but if embedded credentials are the concern, that line could redact too, here or separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Changes behaviour users rely on; needs a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants