[PR #5073] [MERGED] [PM-20389] Define and implement network module CertificateProvider #5455

Closed
opened 2025-11-27 00:00:52 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: network-module/certificate-provider


📝 Commits (1)

  • a75f33e [PM-20389] Define and implement network module CertificateProvider

📊 Changes

13 files changed (+550 additions, -745 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/di/PlatformNetworkModule.kt (+3 -17)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt (+30 -22)
app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/BitwardenX509ExtendedKeyManager.kt (+53 -0)
app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/SslManagerImpl.kt (+0 -116)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/CertificateManager.kt (+3 -15)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/CertificateManagerImpl.kt (+80 -25)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt (+7 -3)
📝 app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/environment/EnvironmentViewModel.kt (+3 -3)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsTest.kt (+6 -101)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/CertificateManagerTest.kt (+326 -220)
app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/SslManagerTest.kt (+0 -218)
📝 app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/environment/EnvironmentViewModelTest.kt (+5 -5)
network/src/main/kotlin/com/bitwarden/network/ssl/CertificateProvider.kt (+34 -0)

📄 Description

🎟️ Tracking

PM-20389

📔 Objective

Refactored the SSL management within the application to use a CertificateProvider interface for handling client certificate operations.

Key Changes:

  • Removal of SslManagerImpl: Removed the SslManagerImpl class as its responsibilities have been redistributed.
  • Introduction of CertificateProvider: Created a new CertificateProvider interface in the network module to handle client certificate management.
  • CertificateManager:
    • Renamed KeyManager to CertificateManager to better reflect its role.
    • Updated CertificateManagerImpl to implement CertificateManager and CertificateProvider
    • CertificateManagerImpl now handles both certificate operations and access to mTLS certificate.
  • Added BitwardenX509ExtendedKeyManager to delegate certificate operations to CertificateProvider.

These changes improve the organization and management of SSL certificates within the application.

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/5073 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 4/17/2025 **Status:** ✅ Merged **Merged:** 4/22/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `network-module/certificate-provider` --- ### 📝 Commits (1) - [`a75f33e`](https://github.com/bitwarden/android/commit/a75f33ebb3fbd4a1dbac2ea09f00bcb173503f5c) [PM-20389] Define and implement network module CertificateProvider ### 📊 Changes **13 files changed** (+550 additions, -745 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/di/PlatformNetworkModule.kt` (+3 -17) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsImpl.kt` (+30 -22) ➕ `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/BitwardenX509ExtendedKeyManager.kt` (+53 -0) ➖ `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/SslManagerImpl.kt` (+0 -116) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/CertificateManager.kt` (+3 -15) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/CertificateManagerImpl.kt` (+80 -25) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/manager/di/PlatformManagerModule.kt` (+7 -3) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/auth/feature/environment/EnvironmentViewModel.kt` (+3 -3) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/retrofit/RetrofitsTest.kt` (+6 -101) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/CertificateManagerTest.kt` (+326 -220) ➖ `app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/network/ssl/SslManagerTest.kt` (+0 -218) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/auth/feature/environment/EnvironmentViewModelTest.kt` (+5 -5) ➕ `network/src/main/kotlin/com/bitwarden/network/ssl/CertificateProvider.kt` (+34 -0) </details> ### 📄 Description ## 🎟️ Tracking PM-20389 ## 📔 Objective Refactored the SSL management within the application to use a `CertificateProvider` interface for handling client certificate operations. Key Changes: - **Removal of `SslManagerImpl`:** Removed the `SslManagerImpl` class as its responsibilities have been redistributed. - **Introduction of `CertificateProvider`:** Created a new `CertificateProvider` interface in the `network` module to handle client certificate management. - **`CertificateManager`:** - Renamed `KeyManager` to `CertificateManager` to better reflect its role. - Updated `CertificateManagerImpl` to implement `CertificateManager` and `CertificateProvider` - `CertificateManagerImpl` now handles both certificate operations and access to mTLS certificate. - Added `BitwardenX509ExtendedKeyManager` to delegate certificate operations to `CertificateProvider`. These changes improve the organization and management of SSL certificates within the application. ## ⏰ 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 2025-11-27 00:00:52 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#5455