[PR #6504] [MERGED] [PM-31982] Add CookieDiskSource for cookie persistence #48229

Closed
opened 2026-04-26 15:48:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6504
Author: @SaintPatrck
Created: 2/10/2026
Status: Merged
Merged: 2/10/2026
Merged by: @SaintPatrck

Base: mainHead: cookie-vending/p2-t2_cookie-disk-source


📝 Commits (5)

  • 30858ed [PM-31982] Add CookieDiskSource for cookie persistence
  • 9559f70 Add test for hostname isolation in CookieDiskSource
  • f3eed1e Remove redundant test
  • 1889cc5 Refactor CookieDiskSource to extend BaseEncryptedDiskSource
  • ea1f816 Refactor: Standardize cookie storage key format

📊 Changes

5 files changed (+228 additions, -0 deletions)

View changed files

app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSource.kt (+25 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceImpl.kt (+36 -0)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/di/PlatformDiskModule.kt (+14 -0)
app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/model/CookieConfigurationData.kt (+27 -0)
app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt (+126 -0)

📄 Description

🎟️ Tracking

PM-31982

📔 Objective

Define and implement cookie disk source.

Storage Layer:

  • CookieDiskSource: Simple get/store interface
  • CookieDiskSourceImpl: Encrypted SharedPreferences storage
  • Stores CookieConfigurationData
  • Hostname-scoped (NOT per-user)
  • Never cleared on logout

Hilt DI:

  • Added provideCookieDiskSource() to PlatformDiskModule

Tests: disk source tests, all passing

  • Get/store operations
  • Hostname scoping verification
  • Multi-cookie handling

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6504 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 2/10/2026 **Status:** ✅ Merged **Merged:** 2/10/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `cookie-vending/p2-t2_cookie-disk-source` --- ### 📝 Commits (5) - [`30858ed`](https://github.com/bitwarden/android/commit/30858ed36f3a121224e3965f5918574313896751) [PM-31982] Add CookieDiskSource for cookie persistence - [`9559f70`](https://github.com/bitwarden/android/commit/9559f7012c085ec42e441a5af3387d6a320942ee) Add test for hostname isolation in CookieDiskSource - [`f3eed1e`](https://github.com/bitwarden/android/commit/f3eed1eb2a92c4daac54b22a9dc58d8a7a671ee9) Remove redundant test - [`1889cc5`](https://github.com/bitwarden/android/commit/1889cc5ee570a3618f28230678daf91e60121dfb) Refactor CookieDiskSource to extend BaseEncryptedDiskSource - [`ea1f816`](https://github.com/bitwarden/android/commit/ea1f816df3bbadb557be92c8f71eb0f4e58d7dc0) Refactor: Standardize cookie storage key format ### 📊 Changes **5 files changed** (+228 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSource.kt` (+25 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceImpl.kt` (+36 -0) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/di/PlatformDiskModule.kt` (+14 -0) ➕ `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/model/CookieConfigurationData.kt` (+27 -0) ➕ `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/disk/CookieDiskSourceTest.kt` (+126 -0) </details> ### 📄 Description ## 🎟️ Tracking PM-31982 ## 📔 Objective Define and implement cookie disk source. Storage Layer: - CookieDiskSource: Simple get/store interface - CookieDiskSourceImpl: Encrypted SharedPreferences storage - Stores CookieConfigurationData - Hostname-scoped (NOT per-user) - Never cleared on logout Hilt DI: - Added provideCookieDiskSource() to PlatformDiskModule Tests: disk source tests, all passing - Get/store operations - Hostname scoping verification - Multi-cookie handling ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-26 15:48:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#48229