[PR #5068] [MERGED] [PM-20305] Migrate BaseUrlInterceptor and BaseUrlInterceptors to network module #80687

Closed
opened 2026-05-19 18:41:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/5068
Author: @SaintPatrck
Created: 4/16/2025
Status: Merged
Merged: 4/17/2025
Merged by: @SaintPatrck

Base: mainHead: network-module/base-url-interceptor


📝 Commits (1)

  • e87b108 [PM-20305] Migrate BaseUrlInterceptor and BaseUrlInterceptors to network module

📊 Changes

22 files changed (+257 additions, -255 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/di/PlatformNetworkModule.kt (+9 -1)
app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/interceptor/BaseUrlInterceptors.kt (+0 -44)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/Retrofits.kt (+1 -1)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt (+2 -2)
app/src/main/java/com/x8bit/bitwarden/data/platform/provider/BaseUrlsProviderImpl.kt (+34 -0)
app/src/main/java/com/x8bit/bitwarden/data/platform/provider/di/PlatformProvidersModule.kt (+25 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsTest.kt (+1 -1)
app/src/test/java/com/x8bit/bitwarden/data/platform/manager/provider/BaseUrlsProviderTest.kt (+69 -0)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/di/PlatformNetworkModule.kt (+9 -1)
authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptor.kt (+0 -58)
authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptors.kt (+0 -33)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/retrofit/Retrofits.kt (+1 -1)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/retrofit/RetrofitsImpl.kt (+3 -3)
authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/provider/BaseUrlsProviderImpl.kt (+23 -0)
authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/provider/di/PlatformProviderModule.kt (+21 -0)
authenticator/src/test/java/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptorTest.kt (+0 -37)
authenticator/src/test/java/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptorsTest.kt (+0 -69)
📝 authenticator/src/test/java/com/bitwarden/authenticator/data/platform/datasource/network/retrofit/RetrofitsTest.kt (+1 -1)
📝 network/src/main/kotlin/com/bitwarden/network/interceptor/BaseUrlInterceptor.kt (+1 -1)
network/src/main/kotlin/com/bitwarden/network/interceptor/BaseUrlInterceptors.kt (+35 -0)

...and 2 more files

📄 Description

🎟️ Tracking

PM-20305

📔 Objective

Move the BaseUrlInterceptor and BaseUrlInterceptors to the network module. Also, it introduces a new BaseUrlsProvider interface in the network module.

The changes include:

  • New Interface: BaseUrlsProvider interface added to network module to abstract the logic of providing base URLs.
  • Network Module: Added BaseUrlInterceptor and BaseUrlInterceptors to the network module.
  • App and Authenticator Modules: Removed BaseUrlInterceptor and BaseUrlInterceptors from the app and authenticator modules.
  • Authenticator module Introduced new BaseUrlsManager and BaseUrlsManagerImpl
  • App module Introduced new BaseUrlsManager and BaseUrlsManagerImpl.
  • Dependencies Update: Updated all usages of BaseUrlInterceptor and BaseUrlInterceptors to use the new implementations in the network module.
  • Test Updates: Moved and updated tests related to BaseUrlInterceptor and BaseUrlInterceptors.
  • App and Authenticator modules: Updated Retrofits and RetrofitsImpl.
  • Network: Added dependencies to network module.
  • Tests: Added new tests for BaseUrlsManagerImpl.

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/5068 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 4/16/2025 **Status:** ✅ Merged **Merged:** 4/17/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `network-module/base-url-interceptor` --- ### 📝 Commits (1) - [`e87b108`](https://github.com/bitwarden/android/commit/e87b10884cf8c271e0ee66f6a7a576cfe4c890ef) [PM-20305] Migrate BaseUrlInterceptor and BaseUrlInterceptors to `network` module ### 📊 Changes **22 files changed** (+257 additions, -255 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/di/PlatformNetworkModule.kt` (+9 -1) ➖ `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/interceptor/BaseUrlInterceptors.kt` (+0 -44) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/Retrofits.kt` (+1 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt` (+2 -2) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/provider/BaseUrlsProviderImpl.kt` (+34 -0) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/provider/di/PlatformProvidersModule.kt` (+25 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsTest.kt` (+1 -1) ➕ `app/src/test/java/com/x8bit/bitwarden/data/platform/manager/provider/BaseUrlsProviderTest.kt` (+69 -0) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/di/PlatformNetworkModule.kt` (+9 -1) ➖ `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptor.kt` (+0 -58) ➖ `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptors.kt` (+0 -33) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/retrofit/Retrofits.kt` (+1 -1) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/datasource/network/retrofit/RetrofitsImpl.kt` (+3 -3) ➕ `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/provider/BaseUrlsProviderImpl.kt` (+23 -0) ➕ `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/platform/provider/di/PlatformProviderModule.kt` (+21 -0) ➖ `authenticator/src/test/java/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptorTest.kt` (+0 -37) ➖ `authenticator/src/test/java/com/bitwarden/authenticator/data/platform/datasource/network/interceptor/BaseUrlInterceptorsTest.kt` (+0 -69) 📝 `authenticator/src/test/java/com/bitwarden/authenticator/data/platform/datasource/network/retrofit/RetrofitsTest.kt` (+1 -1) 📝 `network/src/main/kotlin/com/bitwarden/network/interceptor/BaseUrlInterceptor.kt` (+1 -1) ➕ `network/src/main/kotlin/com/bitwarden/network/interceptor/BaseUrlInterceptors.kt` (+35 -0) _...and 2 more files_ </details> ### 📄 Description ## 🎟️ Tracking PM-20305 ## 📔 Objective Move the `BaseUrlInterceptor` and `BaseUrlInterceptors` to the `network` module. Also, it introduces a new `BaseUrlsProvider` interface in the `network` module. The changes include: - **New Interface**: `BaseUrlsProvider` interface added to network module to abstract the logic of providing base URLs. - **Network Module**: Added `BaseUrlInterceptor` and `BaseUrlInterceptors` to the network module. - **App and Authenticator Modules**: Removed `BaseUrlInterceptor` and `BaseUrlInterceptors` from the app and authenticator modules. - **Authenticator module** Introduced new `BaseUrlsManager` and `BaseUrlsManagerImpl` - **App module** Introduced new `BaseUrlsManager` and `BaseUrlsManagerImpl`. - **Dependencies Update**: Updated all usages of `BaseUrlInterceptor` and `BaseUrlInterceptors` to use the new implementations in the `network` module. - **Test Updates**: Moved and updated tests related to `BaseUrlInterceptor` and `BaseUrlInterceptors`. - **App and Authenticator modules**: Updated `Retrofits` and `RetrofitsImpl`. - **Network**: Added dependencies to `network` module. - **Tests**: Added new tests for `BaseUrlsManagerImpl`. ## ⏰ 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-05-19 18:41:56 -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#80687