-
Notifications
You must be signed in to change notification settings - Fork 7
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
Unify Configuration Management #990
Merged
Merged
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
29689b1
Fix all compilation errors
jaceklyp 3f5a491
Implement AppConfigurationURLProvider
jaceklyp 292e7c3
Use AppVersion from BSK
jaceklyp 08de47e
Set correct user agent
jaceklyp ce7b8ba
Fix for new API in BSK
jaceklyp 8eb836e
Update to the newest bsk changes
jaceklyp 26ad982
Fix tests
jaceklyp 8c29a4d
Point BSK to unify-configuration branch
jaceklyp 78ca58b
Fix crash on startup
jaceklyp ad1eb5d
Update macos client to new BSK changes
jaceklyp 8649763
Revert to old name not to migrate data
jaceklyp 77c255f
Make app compilable
jaceklyp b0841fe
Address comments and update to new BSK
jaceklyp 643895e
Merge branch 'develop' into jacek/unify-configuration
jaceklyp ed207df
Fix tests
jaceklyp db7a653
Update BSK
jaceklyp 4724176
Add Package.resolved
jaceklyp f871daf
Merge branch 'develop' into jacek/unify-configuration
jaceklyp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// AppConfigurationURLProvider.swift | ||
// | ||
// Copyright © 2023 DuckDuckGo. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// 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, | ||
// 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. | ||
// | ||
|
||
import Foundation | ||
import Configuration | ||
|
||
struct AppConfigurationURLProvider: ConfigurationURLProvider { | ||
|
||
func url(for configuration: Configuration) -> URL { | ||
switch configuration { | ||
case .bloomFilterBinary: return URL(string: "https://staticcdn.duckduckgo.com/https/https-mobile-v2-bloom.bin")! | ||
case .bloomFilterSpec: return URL(string: "https://staticcdn.duckduckgo.com/https/https-mobile-v2-bloom-spec.json")! | ||
case .bloomFilterExcludedDomains: return URL(string: "https://staticcdn.duckduckgo.com/https/https-mobile-v2-false-positives.json")! | ||
case .privacyConfiguration: return URL(string: "https://staticcdn.duckduckgo.com/trackerblocking/config/v2/macos-config.json")! | ||
case .surrogates: return URL(string: "https://duckduckgo.com/contentblocking.js?l=surrogates")! | ||
case .trackerDataSet: return URL(string: "https://staticcdn.duckduckgo.com/trackerblocking/v3/apple-tds.json")! | ||
// In archived repo, to be refactored shortly (https://staticcdn.duckduckgo.com/useragents/social_ctp_configuration.json) | ||
case .FBConfig: return URL(string: "https://staticcdn.duckduckgo.com/useragents/")! | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ public struct UserDefaultsWrapper<T> { | |
public enum Key: String, CaseIterable { | ||
|
||
case configLastUpdated = "config.last.updated" | ||
case configStorageTrackerRadarEtag = "config.storage.trackerradar.etag" | ||
case configStorageTrackerRadarEtag = "config.storage.trackerDataSet.etag" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Won't we need some migration code to recognize an etag stored under the old name? |
||
case configStorageBloomFilterSpecEtag = "config.storage.bloomfilter.spec.etag" | ||
case configStorageBloomFilterBinaryEtag = "config.storage.bloomfilter.binary.etag" | ||
case configStorageBloomFilterExclusionsEtag = "config.storage.bloomfilter.exclusions.etag" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this comment still relevant? If so, can you make it more clear? (I have no idea what is it about)
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 have no idea either - it's a one year old comment, and the original author is @ladamski. @ladamski do you know anything about that?