Skip to content
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

Subscription oauth v2 #1033

Open
wants to merge 132 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
52c4e2f
Networking V2 implemented and tested
federicocappelli Sep 6, 2024
6deb71d
networking v2 refinements and unit tests
federicocappelli Sep 9, 2024
aecc91b
headers renamed
federicocappelli Sep 9, 2024
23800c2
mocks, lint
federicocappelli Sep 10, 2024
d029027
api configuration removed and data moved to api request, lint
federicocappelli Sep 10, 2024
ef4949c
query items changed and tests fixed
federicocappelli Sep 10, 2024
0dbc46e
added unit test
federicocappelli Sep 10, 2024
00bc2b2
Merge branch 'main' into fcappelli/networkingV2
federicocappelli Sep 10, 2024
0000972
privacy ref repo updated
federicocappelli Sep 10, 2024
309770b
pkg updated
federicocappelli Sep 10, 2024
d502223
comments
federicocappelli Sep 10, 2024
0ea4332
Documentation + comments and improvements
federicocappelli Sep 11, 2024
3101949
Doc
federicocappelli Sep 11, 2024
b20199d
Merge branch 'main' into fcappelli/networkingV2
federicocappelli Sep 11, 2024
a11b58b
v1 restore
federicocappelli Sep 11, 2024
46a7423
v1 restore
federicocappelli Sep 11, 2024
a7e2cae
tests fix
federicocappelli Sep 11, 2024
99f80f7
comment fix
federicocappelli Sep 11, 2024
d3ca645
auth client, service etc
federicocappelli Sep 11, 2024
193792f
authorise call + real tests
federicocappelli Sep 12, 2024
969514d
authorisation API done
federicocappelli Sep 13, 2024
bb8fb82
error handling fixed
federicocappelli Sep 13, 2024
6ea42ad
sendotp call
federicocappelli Sep 13, 2024
237c90e
renaming
federicocappelli Sep 16, 2024
ea3d225
Merge branch 'fcappelli/networkingV2' into fcappelli/subscription_oau…
federicocappelli Sep 16, 2024
48091f9
login api call
federicocappelli Sep 16, 2024
8c70535
more APIs
federicocappelli Sep 17, 2024
0b246d0
access token api requests
federicocappelli Sep 17, 2024
aa00362
optimisations
federicocappelli Sep 17, 2024
420f488
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Sep 18, 2024
1567199
JWT and JWKs
federicocappelli Sep 18, 2024
d7e7be2
new jwtpayload
federicocappelli Sep 19, 2024
552b281
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Sep 19, 2024
420be21
files ranamed
federicocappelli Sep 23, 2024
4b60204
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Sep 23, 2024
2d2425f
more oauthclient features
federicocappelli Sep 24, 2024
8bd8835
more account activation and editing
federicocappelli Sep 24, 2024
5b17d89
backup
federicocappelli Sep 27, 2024
8782e77
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Oct 14, 2024
a300bb6
builds
federicocappelli Oct 16, 2024
3bc981d
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Oct 16, 2024
18b64e4
auth and first purchase improved
federicocappelli Oct 21, 2024
0bbb394
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Oct 21, 2024
085e85c
purchase flow fixed
federicocappelli Oct 22, 2024
9400b0c
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Oct 22, 2024
aa8a036
api call param fix
federicocappelli Oct 23, 2024
2e2ada3
purchase fixed
federicocappelli Oct 23, 2024
1aac90f
loggers improved and restore fixed
federicocappelli Oct 24, 2024
69bcced
subscription refresh improved
federicocappelli Oct 25, 2024
3503e04
v1 to v2 auth migration
federicocappelli Oct 25, 2024
b778df6
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Oct 25, 2024
b3873ea
lint
federicocappelli Oct 25, 2024
ec3409a
unit tests improvements
federicocappelli Oct 28, 2024
52ad921
review suggestions applied
federicocappelli Oct 29, 2024
6412ff9
more tests and logs
federicocappelli Oct 30, 2024
196b83e
vpn fixed
federicocappelli Oct 31, 2024
20e63ac
unit tests
federicocappelli Nov 1, 2024
095e7e1
signout as async
federicocappelli Nov 1, 2024
156814d
Merge branch 'main' of https://github.com/duckduckgo/BrowserServicesK…
federicocappelli Nov 4, 2024
e69f756
purchase fixes
federicocappelli Nov 4, 2024
f4e03fd
unit tests fixed + utilities
federicocappelli Nov 4, 2024
bbd9dac
unit tests
federicocappelli Nov 4, 2024
3b05a78
unit tests
federicocappelli Nov 4, 2024
edfdfbb
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 4, 2024
54182e2
subscripti token background refresh added
federicocappelli Nov 5, 2024
976f625
lint + tests
federicocappelli Nov 5, 2024
4bdca2a
lint
federicocappelli Nov 5, 2024
133b245
warnings and concurrency issue fixed
federicocappelli Nov 5, 2024
7a1edcc
tests fix
federicocappelli Nov 5, 2024
3161a3f
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 6, 2024
b01c07d
lint
federicocappelli Nov 6, 2024
92a2154
build import fixed
federicocappelli Nov 6, 2024
da30fc9
cleanup and errors improvements
federicocappelli Nov 6, 2024
b8aad9b
unit tests impr
federicocappelli Nov 7, 2024
a5c6054
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 7, 2024
99ac675
subscription positive integration test
federicocappelli Nov 8, 2024
aab9795
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 14, 2024
b7d4d04
DI improved
federicocappelli Nov 19, 2024
13547dc
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 19, 2024
4f17767
DI done
federicocappelli Nov 20, 2024
571e083
token v1/v2 exchange fixed, token providing improved
federicocappelli Nov 22, 2024
53fcbbb
tokencontainer improvements and data extraction
federicocappelli Nov 22, 2024
7e17373
token container improvements and vpn token propagation
federicocappelli Nov 25, 2024
4a044a8
keychian type moved
federicocappelli Nov 26, 2024
744f3f3
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 26, 2024
9691ad2
it works!
federicocappelli Nov 26, 2024
9570d21
fixing unit tests
federicocappelli Nov 27, 2024
a27984e
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 27, 2024
7c74ea4
subscription manager mock fixed
federicocappelli Nov 28, 2024
43b151f
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Nov 28, 2024
fe8b105
lint cleanup and tests fixed
federicocappelli Nov 28, 2024
4e4605c
unit tests green
federicocappelli Nov 28, 2024
02e7926
lint
federicocappelli Nov 28, 2024
c3c0143
error handling, moks and tests improved
federicocappelli Nov 29, 2024
71155a2
unit tests improved
federicocappelli Nov 29, 2024
1f1b48c
unit tests parallelism disabled
federicocappelli Nov 29, 2024
97ddc9c
Merge branch 'main' of https://github.com/duckduckgo/BrowserServicesK…
federicocappelli Nov 29, 2024
97e986e
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Dec 2, 2024
38dd352
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Dec 2, 2024
f2b8ca9
lint
federicocappelli Dec 2, 2024
c1ce80d
merge issue fixed
federicocappelli Dec 2, 2024
a265567
work-ish
federicocappelli Dec 5, 2024
c5aa475
logs
federicocappelli Dec 5, 2024
bb6f502
get token optimisations
federicocappelli Dec 5, 2024
ebef4d5
asd
federicocappelli Dec 5, 2024
7bbbedf
reverting minor changes
federicocappelli Dec 5, 2024
8e23ae9
Merge branch 'main' into fcappelli/vpn_error_2
federicocappelli Dec 5, 2024
63e5886
subscription purchase notification fixed
federicocappelli Dec 6, 2024
a4b2232
lint and unit tests fix
federicocappelli Dec 6, 2024
2a2fb68
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Dec 6, 2024
dbf72ed
quite tests output
federicocappelli Dec 6, 2024
27f95f1
Merge branch 'main' of https://github.com/duckduckgo/BrowserServicesK…
federicocappelli Dec 6, 2024
79bf3ae
unit tests fixed
federicocappelli Dec 6, 2024
07e8b56
lint
federicocappelli Dec 6, 2024
f85e3a3
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Dec 12, 2024
975eb88
backward compatibility typealias
federicocappelli Dec 12, 2024
2cd4bab
small cleanups
federicocappelli Dec 12, 2024
43774ad
Merge branch 'main' into fcappelli/subscription_oauth_api_v2
federicocappelli Dec 12, 2024
30e74c8
extension moved from macos to bsk
federicocappelli Dec 12, 2024
57fc80b
code comments + sub restore improvements
federicocappelli Dec 12, 2024
50d4d64
mock fixed
federicocappelli Dec 12, 2024
b586366
Update pr.yml
federicocappelli Dec 12, 2024
1292c9d
code cleanup
federicocappelli Dec 12, 2024
f12498a
Merge branch 'fcappelli/subscription_oauth_api_v2' of https://github.…
federicocappelli Dec 12, 2024
a942eea
stripe success integration test
federicocappelli Dec 12, 2024
3ce186f
code cleanup
federicocappelli Dec 12, 2024
77e4a93
date extension improved and unit tests added
federicocappelli Dec 13, 2024
8fec94f
lint
federicocappelli Dec 13, 2024
2f82911
DBP cleanup
federicocappelli Dec 16, 2024
8314ec0
Subscription purchase integration tests for apple and stripe + error …
federicocappelli Dec 18, 2024
771d444
code cleanup and log fixes + get token now uses localValid everywhere
federicocappelli Dec 23, 2024
dfc9582
Adopt function improvements
federicocappelli Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 196 additions & 0 deletions .swiftpm/BrowserServicesKit-Package.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"configurations" : [
{
"id" : "2EA622A1-B72B-456A-A84F-B3979C987FE3",
"name" : "Test Scheme Action",
"options" : {

}
}
],
"defaultOptions" : {
"targetForVariableExpansion" : {
"containerPath" : "container:",
"identifier" : "BookmarksTestDBBuilder",
"name" : "BookmarksTestDBBuilder"
}
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:",
"identifier" : "BookmarksTests",
"name" : "BookmarksTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "BrowserServicesKitTests",
"name" : "BrowserServicesKitTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "CommonTests",
"name" : "CommonTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "ConfigurationTests",
"name" : "ConfigurationTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "CrashesTests",
"name" : "CrashesTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "DDGSyncCryptoTests",
"name" : "DDGSyncCryptoTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "DDGSyncTests",
"name" : "DDGSyncTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "HistoryTests",
"name" : "HistoryTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "NavigationTests",
"name" : "NavigationTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "NetworkProtectionTests",
"name" : "NetworkProtectionTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "NetworkingTests",
"name" : "NetworkingTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "PersistenceTests",
"name" : "PersistenceTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "PixelKitTests",
"name" : "PixelKitTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "PrivacyDashboardTests",
"name" : "PrivacyDashboardTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "RemoteMessagingTests",
"name" : "RemoteMessagingTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "SecureStorageTests",
"name" : "SecureStorageTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "SubscriptionTests",
"name" : "SubscriptionTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "SuggestionsTests",
"name" : "SuggestionsTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "SyncDataProvidersTests",
"name" : "SyncDataProvidersTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "UserScriptTests",
"name" : "UserScriptTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "DuckPlayerTests",
"name" : "DuckPlayerTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "OnboardingTests",
"name" : "OnboardingTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "SpecialErrorPagesTests",
"name" : "SpecialErrorPagesTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "PageRefreshMonitorTests",
"name" : "PageRefreshMonitorTests"
}
},
{
"target" : {
"containerPath" : "container:",
"identifier" : "BrokenSitePromptTests",
"name" : "BrokenSitePromptTests"
}
}
],
"version" : 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
<key>FILEHEADER</key>
<string>
// ___FILENAME___
// DuckDuckGo
//
// Copyright © ___YEAR___ DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -573,11 +573,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:Tests/BrowserServicesKit-Package.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
<Testables>
<TestableReference
skipped = "NO">
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BookmarksTests"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1320"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
67 changes: 67 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/Networking.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Networking"
BuildableName = "Networking"
BlueprintName = "Networking"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Networking"
BuildableName = "Networking"
BlueprintName = "Networking"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
54 changes: 54 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/NetworkingTests.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "NetworkingTests"
BuildableName = "NetworkingTests"
BlueprintName = "NetworkingTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
LastUpgradeVersion = "1600"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading
Loading