[PR #6537] [MERGED] [PM-32251] Decouple SDK token repository from network module #32664

Closed
opened 2026-04-18 16:01:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: decouple-sdk-and-network


📝 Commits (1)

  • 77d6309 Decouple SDK token repository from network module

📊 Changes

5 files changed (+49 additions, -24 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt (+2 -2)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/SdkRepositoryFactoryImpl.kt (+3 -3)
📝 app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/repository/SdkTokenRepository.kt (+8 -3)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/SdkRepositoryFactoryTests.kt (+3 -6)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/repository/SdkTokenRepositoryTest.kt (+33 -10)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-32251

📔 Objective

Decouple the SDK bridge layer from the :network module by replacing BitwardenServiceClient.tokenProvider with direct AuthDiskSource access in SdkTokenRepository.

Previously, SdkRepositoryFactoryImpl depended on BitwardenServiceClient solely to extract its tokenProvider. This created an unnecessary coupling between the SDK bridge and the entire :network module for a single method call. Since access tokens ultimately come from AuthDiskSource (encrypted disk storage), we can bypass :network entirely.

Changes:

  • SdkTokenRepository now takes AuthDiskSource directly and reads getAccountTokens(userId)?.accessToken
  • SdkRepositoryFactoryImpl constructor parameter changed from BitwardenServiceClient to AuthDiskSource
  • PlatformManagerModule Hilt wiring updated accordingly
  • Tests updated to mock AuthDiskSource instead of TokenProvider/BitwardenServiceClient

🔄 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/6537 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 2/13/2026 **Status:** ✅ Merged **Merged:** 2/13/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `decouple-sdk-and-network` --- ### 📝 Commits (1) - [`77d6309`](https://github.com/bitwarden/android/commit/77d630960eaef82a1e48660aa22911d5e3ff910d) Decouple SDK token repository from network module ### 📊 Changes **5 files changed** (+49 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt` (+2 -2) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/SdkRepositoryFactoryImpl.kt` (+3 -3) 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/repository/SdkTokenRepository.kt` (+8 -3) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/SdkRepositoryFactoryTests.kt` (+3 -6) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/sdk/repository/SdkTokenRepositoryTest.kt` (+33 -10) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-32251 ## 📔 Objective Decouple the SDK bridge layer from the `:network` module by replacing `BitwardenServiceClient.tokenProvider` with direct `AuthDiskSource` access in `SdkTokenRepository`. Previously, `SdkRepositoryFactoryImpl` depended on `BitwardenServiceClient` solely to extract its `tokenProvider`. This created an unnecessary coupling between the SDK bridge and the entire `:network` module for a single method call. Since access tokens ultimately come from `AuthDiskSource` (encrypted disk storage), we can bypass `:network` entirely. **Changes:** - `SdkTokenRepository` now takes `AuthDiskSource` directly and reads `getAccountTokens(userId)?.accessToken` - `SdkRepositoryFactoryImpl` constructor parameter changed from `BitwardenServiceClient` to `AuthDiskSource` - `PlatformManagerModule` Hilt wiring updated accordingly - Tests updated to mock `AuthDiskSource` instead of `TokenProvider`/`BitwardenServiceClient` --- <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-18 16:01:18 -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#32664