Skip to content

Remove AI API key and brew-by-weight webhook credentials from exports - #1207

Open
bangarang wants to merge 1 commit into
graphefruit:developfrom
bangarang:fix/export-strip-credentials
Open

bangarang wants to merge 1 commit into
graphefruit:developfrom
bangarang:fix/export-strip-credentials

Conversation

@bangarang

Copy link
Copy Markdown

Description

UIStorage.export() already blanks the Visualizer username and password before writing an export (#520), but other credentials stored in settings were still written into manual exports and the automatic backup ZIPs:

  • cloud_ai_api_key, the AI provider key for bean import (added in c1f8580)
  • brew_by_weight_webhook.bearerToken, basicUsername, basicPassword and customHeaderValue (added in 80d7184)

Backups are often shared, for example attached to a support request or moved to another device, so these keys could leave the device without the user knowing.

This PR blanks all of them in one place (UIStorage.removeCredentialsFromSettings), next to the existing Visualizer handling. Everything else in settings, including the webhook URL and the AI model, stays in the export. As with the Visualizer credentials today, after importing a backup the user re-enters these keys.

GitHub Issue / Discussion Reference

Ref: #520 (same handling for the Visualizer credentials)

AI Assistance Disclosure

AI Usage Level

  • Completely on my own (0% AI)
  • Assisted by AI (up to 50% AI)
  • Completely or mostly generated by AI (50% - 100% AI)

AI Provider / Tool

  • Provider / Tool: Claude

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring / Code cleanup
  • Documentation update
  • Other (please describe):

Screenshots / Videos (if applicable)

No UI change. New unit tests in src/services/__tests__/uiStorage-export.spec.ts:

  • all stored credentials are blanked in the export
  • non-secret settings (webhook URL, header name, AI model, Visualizer URL) are kept
  • settings from older data without brew_by_weight_webhook export fine
  • exports without settings are unchanged

The credential tests fail on develop and pass with this change. The full suite is 691 tests. 2 UnwrappedService frozen-bean tests fail, and they fail on develop too.

Tested Platforms

  • Android
  • iOS
  • Web (unit tests in headless Chrome only)

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings or lint errors

UIStorage.export() already blanked the Visualizer username and password (graphefruit#520),
but the cloud AI API key and the brew-by-weight webhook bearer token, basic auth
credentials and custom header value were still written into manual exports and
the automatic backup ZIPs.

Blank all of them in one place and cover it with unit tests.
@CLAassistant

CLAassistant commented Nov 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
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.

2 participants