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

Closed
opened 2026-04-11 03:51:25 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6537

State: closed
Merged: Yes


🎟️ 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
**Original Pull Request:** https://github.com/bitwarden/android/pull/6537 **State:** closed **Merged:** Yes --- ## 🎟️ 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`
GiteaMirror added the pull-request label 2026-04-11 03:51:26 -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#12798