-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preliminary support for subscription keychain sharing #2538
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about using a pattern that @graeme used for macOS and from the providing a convenience initializer to the changes with the AccountManager
on most places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use convenience init.
@@ -319,7 +322,7 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature, ObservableObjec | |||
func restoreAccountFromAppStorePurchase() async throws { | |||
setTransactionStatus(.restoring) | |||
|
|||
let result = await AppStoreRestoreFlow.restoreAccountFromPastPurchase() | |||
let result = await AppStoreRestoreFlow.restoreAccountFromPastPurchase(appGroup: Bundle.main.appGroup(bundle: .subs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the param name should be subscriptionAppGroup
for consistency @miasma13.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
# Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved # DuckDuckGo/SettingsViewModel.swift # DuckDuckGo/Subscription/UserScripts/SubscriptionPagesUseSubscriptionFeature.swift
Task/Issue URL: https://app.asana.com/0/414235014887631/1206564116141608/f iOS PR: duckduckgo/iOS#2538 BSK PR: duckduckgo/BrowserServicesKit#690 **Optional**: Tech Design URL: https://app.asana.com/0/481882893211075/1206591576458107/f CC: @quanganhdo @diegoreymendez **Description**: For the macOS: Recheck entitlements and display error messaging for cancelled subscriptions we need to make sure the VPN is no longer usable once their entitlement to use it are withdrawn. In [iOS: Integrate with Subscription](https://app.asana.com/0/0/1204886111391114), we’re already checking the entitlements intermittently and on rekey, disabling the VPN*. To authenticate the VPN's register requests (to receive a server + keypair for the tunnel configuration), the PacketTunnelProvider (central component of the VPN extension) needs an access token which is to be provided by the Subscription library built in O-1. This can be pulled accessed directly from the library and, in the iOS and macOS AppStore case, shared between processes (the app, the VPN agent, the VPN extension) using a keychain group. We would like the fetching and lifecycle to be managed exclusively by the Subscription library. We will need to share / delete the subscription access token between processes, so this task covers: - Adding a new subscriptions app group - Injecting this app group into the subscriptions library to be used to create keychain entries. **Steps to test this PR**: 1. Make sure subscriptions flow still works (don’t attempt to connect VPN yet) 2. (Remaining steps in DEBUG only) Open the console and start logging 3. Connect to Network Protection. 4. After the macOS menu item has appeared, check the console and ensure there is a log saying "VPN Agent found token" --- ###### Internal references: [Pull Request Review Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f) [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) [Pull Request Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)
# By Anh Do # Via GitHub * main: Add preliminary support for subscription keychain sharing (#2538) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
* main: Point to BSK hotfix (#2558) Prevent redeeming invite codes after the VPN test ends (#2559) Updates Kingfisher to 7.11.0 (#2545) Makes network path metadata description anonymous (#2544) Adds pixels to track main VPN funnels (#2543) Cleanup after rolling out autoconsent enabled by default (#2537) Add #URL macro (#2540) Handle expired entitlement in NetP (#2525) Remove isSubscriptionEnabled check when attempting to delete NetP token (#2548) Validate correct environment (#2546) Remove CGNAT range (#2524) Add preliminary support for subscription keychain sharing (#2538) fix opening tabs with transitional (#2542) Integrate confirm entitlements endpoint (#2541) Makes dbSaveBloomFilterError daily and count (#2526) 16. Subscription: Display "Activation in progress" message (#2535) Autofill support for deleting all passwords (#2497) Bump BrowserServicesKit (#2532) Release 7.111.0-0 (#2534) if dax dialogs are showing then dismiss (#2506)
…-lottie-animation * sam/vpn-ui-improvements: Point to BSK hotfix (#2558) Prevent redeeming invite codes after the VPN test ends (#2559) Updates Kingfisher to 7.11.0 (#2545) Makes network path metadata description anonymous (#2544) Adds pixels to track main VPN funnels (#2543) Cleanup after rolling out autoconsent enabled by default (#2537) Add #URL macro (#2540) Handle expired entitlement in NetP (#2525) Remove isSubscriptionEnabled check when attempting to delete NetP token (#2548) Validate correct environment (#2546) Remove CGNAT range (#2524) Add preliminary support for subscription keychain sharing (#2538) fix opening tabs with transitional (#2542) Integrate confirm entitlements endpoint (#2541) Makes dbSaveBloomFilterError daily and count (#2526) 16. Subscription: Display "Activation in progress" message (#2535) Autofill support for deleting all passwords (#2497) Bump BrowserServicesKit (#2532) Release 7.111.0-0 (#2534) if dax dialogs are showing then dismiss (#2506)
…n-ui-improvements-3-combine-notification-settings * sam/vpn-ui-improvements-2-lottie-animation: (22 commits) Point to BSK hotfix (#2558) Prevent redeeming invite codes after the VPN test ends (#2559) Updates Kingfisher to 7.11.0 (#2545) Makes network path metadata description anonymous (#2544) Adds pixels to track main VPN funnels (#2543) Cleanup after rolling out autoconsent enabled by default (#2537) Add #URL macro (#2540) Handle expired entitlement in NetP (#2525) Remove isSubscriptionEnabled check when attempting to delete NetP token (#2548) Add dark mode animation. Allow the animation intro to be skipped Validate correct environment (#2546) Remove CGNAT range (#2524) Add preliminary support for subscription keychain sharing (#2538) fix opening tabs with transitional (#2542) Integrate confirm entitlements endpoint (#2541) Makes dbSaveBloomFilterError daily and count (#2526) 16. Subscription: Display "Activation in progress" message (#2535) Autofill support for deleting all passwords (#2497) Bump BrowserServicesKit (#2532) ...
…' into sam/vpn-ui-improvements-4-location-setting-change # By Sam Symons (4) and others # Via Sam Symons (3) and others * sam/vpn-ui-improvements-3-combine-notification-settings: (22 commits) Point to BSK hotfix (#2558) Prevent redeeming invite codes after the VPN test ends (#2559) Updates Kingfisher to 7.11.0 (#2545) Makes network path metadata description anonymous (#2544) Adds pixels to track main VPN funnels (#2543) Cleanup after rolling out autoconsent enabled by default (#2537) Add #URL macro (#2540) Handle expired entitlement in NetP (#2525) Remove isSubscriptionEnabled check when attempting to delete NetP token (#2548) Add dark mode animation. Allow the animation intro to be skipped Validate correct environment (#2546) Remove CGNAT range (#2524) Add preliminary support for subscription keychain sharing (#2538) fix opening tabs with transitional (#2542) Integrate confirm entitlements endpoint (#2541) Makes dbSaveBloomFilterError daily and count (#2526) 16. Subscription: Display "Activation in progress" message (#2535) Autofill support for deleting all passwords (#2497) Bump BrowserServicesKit (#2532) ... # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
* main: (28 commits) Fix VPN view model memory leak (#2570) Bump submodules/privacy-reference-tests from `40ce868` to `a603ff9` (#2500) 18. Subscription Entitlements caching (#2556) Release 7.111.0-2 (#2563) Revert "Report Apple Ad attribution using pixel (#2510)" (#2562) Vanilla browser integration (#2550) Fix blank space after URL bar hides (#2549) Release 7.111.0-1 (#2561) Point to BSK hotfix (#2558) Prevent redeeming invite codes after the VPN test ends (#2559) Updates Kingfisher to 7.11.0 (#2545) Makes network path metadata description anonymous (#2544) Adds pixels to track main VPN funnels (#2543) Cleanup after rolling out autoconsent enabled by default (#2537) Add #URL macro (#2540) Handle expired entitlement in NetP (#2525) Remove isSubscriptionEnabled check when attempting to delete NetP token (#2548) Validate correct environment (#2546) Remove CGNAT range (#2524) Add preliminary support for subscription keychain sharing (#2538) ...
Task/Issue URL: https://app.asana.com/0/414235014887631/1206564116141608/f
Tech Design URL:
CC:
Description:
This PR does the followings:
Steps to test this PR:
It shouldn’t break any existing flow.
Copy Testing:
’
rather than'
Orientation Testing:
Device Testing:
OS Testing:
Theme Testing:
Internal references:
Software Engineering Expectations
Technical Design Template