[PM-38442] feat: Add Fill-Assist endpoint and models#2760
Conversation
…msMapResponseModel
…//github.com/bitwarden/ios into pm-38442/add-fill-assist-endpoint-and-models
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the Fill-Assist networking layer and supporting models: the new Code Review DetailsNo findings at or above the confidence threshold. Notes considered and dropped during validation:
|
There was a problem hiding this comment.
Pull request overview
Adds “Fill-Assist” support to the iOS codebase by introducing a dedicated API surface for fetching map-the-web targeting rules, wiring a configurable base URL through environment configuration, and updating environment URL models/services accordingly.
Changes:
- Added
FillAssistAPIService+FormsMap*request/response models and tests to fetchforms.v0.jsonfrom the map-the-web release endpoint. - Extended server/environment configuration (
EnvironmentServerConfigResponseModel/EnvironmentURL*) to include an optional Fill-Assist rules base URL override, and exposed it viaEnvironmentService. - Updated state/config handling to persist the Fill-Assist rules URL from server config into per-account environment URL data.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| BitwardenShared/Core/Platform/Services/Stores/AppSettingsStoreTests.swift | Updates test fixtures to include the new fillAssistRules config field. |
| BitwardenShared/Core/Platform/Services/StateServiceTests.swift | Adds coverage ensuring server config updates fillAssistRulesUrl in environment URL data. |
| BitwardenShared/Core/Platform/Services/StateService.swift | Persists Fill-Assist rules URL from server config into account environment URL state. |
| BitwardenShared/Core/Platform/Services/Services.swift | Adds HasFillAssistAPIService to the shared services composition. |
| BitwardenShared/Core/Platform/Services/ServiceContainer.swift | Exposes fillAssistAPIService from the shared container via apiService. |
| BitwardenShared/Core/Platform/Services/ServerCommunicationConfigClientSingletonTests.swift | Updates test config models to include fillAssistRules. |
| BitwardenShared/Core/Platform/Services/EnvironmentService.swift | Exposes fillAssistRulesURL from EnvironmentURLs. |
| BitwardenShared/Core/Platform/Services/API/APIServiceTests.swift | Validates mapTheWebService base URL + token provider configuration. |
| BitwardenShared/Core/Platform/Services/API/APIService.swift | Adds mapTheWebService HTTP service bound to environmentService.fillAssistRulesURL. |
| BitwardenShared/Core/Autofill/Services/API/Requests/FormsMapRequestTests.swift | Adds tests for FormsMapRequest path/method. |
| BitwardenShared/Core/Autofill/Services/API/Requests/FormsMapRequest.swift | Introduces request for forms.v0.json. |
| BitwardenShared/Core/Autofill/Services/API/Fixtures/APITestData+FillAssist.swift | Adds fixture JSON for Forms Map responses. |
| BitwardenShared/Core/Autofill/Services/API/FillAssistAPIServiceTests.swift | Adds request-building test for getFormsMap(). |
| BitwardenShared/Core/Autofill/Services/API/FillAssistAPIService.swift | Introduces FillAssistAPIService protocol and APIService conformance. |
| BitwardenShared/Core/Autofill/Models/FormsMapResponseModel.swift | Adds decoding models for the Forms Map schema (hosts/pathnames/forms/selectors). |
| BitwardenKit/Core/Platform/Services/Mocks/MockEnvironmentService.swift | Adds fillAssistRulesURL to the mock environment service. |
| BitwardenKit/Core/Platform/Services/EnvironmentService.swift | Extends the EnvironmentService protocol with fillAssistRulesURL. |
| BitwardenKit/Core/Platform/Services/AppInfoServiceTests.swift | Updates test fixtures to include fillAssistRules. |
| BitwardenKit/Core/Platform/Services/API/Response/ConfigResponseModel.swift | Adds fillAssistRules to the environment server config response model. |
| BitwardenKit/Core/Platform/Models/Domain/ServerConfig.swift | Propagates fillAssistRules into the domain environment server config model. |
| BitwardenKit/Core/Platform/Models/Domain/EnvironmentURLsTests.swift | Updates expected EnvironmentURLs to include default fillAssistRulesURL. |
| BitwardenKit/Core/Platform/Models/Domain/EnvironmentURLs.swift | Adds fillAssistRulesURL with default GitHub release download base and override support. |
| BitwardenKit/Core/Platform/Models/Domain/EnvironmentURLData.swift | Adds per-account fillAssistRulesUrl storage and helper to update it. |
Comments suppressed due to low confidence (1)
BitwardenKit/Core/Platform/Models/Domain/EnvironmentURLData.swift:96
isEmptyis documented as "true if none of the URLs are set", but it doesn't account for the newly addedfillAssistRulesUrl. IffillAssistRulesUrlis set via server config,isEmptywill still return true, which can cause callers to treat the environment as having no overrides.
/// Whether all of the environment URLs are not set.
var isEmpty: Bool {
api == nil
&& base == nil
&& events == nil
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…URLData before region remapping
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2760 +/- ##
==========================================
- Coverage 80.82% 78.55% -2.28%
==========================================
Files 1019 1144 +125
Lines 64856 72254 +7398
==========================================
+ Hits 52418 56756 +4338
- Misses 12438 15498 +3060 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-38442
📔 Objective
Adds the networking layer and data models needed to fetch Fill-Assist targeting rules from the map-the-web repository.
API & Models
FillAssistAPIService— fetchesforms.v0.jsonvia a dedicatedmapTheWebServiceHTTP serviceFormsMapResponseModeland supporting types (FormsMapHostEntry,FormsMapPathnameEntry,FormsMapContent,FormsMapSelector) — decode the forms map JSON, including a custominit(from:)that silently excludes null-valued host entriesEnvironment URL plumbing
fillAssistRules: String?added toEnvironmentServerConfigResponseModelandEnvironmentServerConfigso the server can provide a custom rules URLfillAssistRulesUrl: URL?added toEnvironmentURLData(persisted per account) with awith(fillAssistRulesUrl:)copy helperfillAssistRulesURL: URLadded toEnvironmentURLs,EnvironmentServiceprotocol, and bothDefaultEnvironmentServiceimplementations (PM and Authenticator), defaulting to the GitHub releases URLDefaultStateService.setServerConfigstamps the server-providedfillAssistRulesURL into the active account'sEnvironmentURLDataso it is available the next timeloadURLsForActiveAccount()runs