diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index d0430601f..4cf830285 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -13,7 +13,6 @@ import Tree import Web import Account import CoreResources -import Secrets import OSLog import Core import CrashReporter diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index e744c182f..141483313 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -13,7 +13,6 @@ import Account import Core import AppKitExtras import ArticleExtractor -import Secrets enum TimelineSourceMode { case regular, search @@ -1278,7 +1277,7 @@ private extension MainWindowController { } func startArticleExtractorForCurrentLink() { - if let link = currentLink, let extractor = ArticleExtractor(link, clientID: SecretKey.mercuryClientID, clientSecret: SecretKey.mercuryClientSecret) { + if let link = currentLink, let extractor = ArticleExtractor(link) { extractor.delegate = self extractor.process() articleExtractor = extractor diff --git a/Modules/Account/Sources/Account/AccountManager.swift b/Modules/Account/Sources/Account/AccountManager.swift index abc31d5d1..13c50013b 100644 --- a/Modules/Account/Sources/Account/AccountManager.swift +++ b/Modules/Account/Sources/Account/AccountManager.swift @@ -11,7 +11,6 @@ import Web import Articles import ArticlesDatabase import Database -import Secrets @MainActor public final class AccountManager: UnreadCountProvider { diff --git a/Modules/Account/Tests/AccountTests/AccountCredentialsTest.swift b/Modules/Account/Tests/AccountTests/AccountCredentialsTest.swift index 59ffe08bd..54fc8962c 100644 --- a/Modules/Account/Tests/AccountTests/AccountCredentialsTest.swift +++ b/Modules/Account/Tests/AccountTests/AccountCredentialsTest.swift @@ -9,7 +9,6 @@ import XCTest import Web @testable import Account -import Secrets //class AccountCredentialsTest: XCTestCase { // diff --git a/Modules/Account/Tests/AccountTests/Feedly/FeedlyLogoutOperationTests.swift b/Modules/Account/Tests/AccountTests/Feedly/FeedlyLogoutOperationTests.swift index 4956be004..4d09d8534 100644 --- a/Modules/Account/Tests/AccountTests/Feedly/FeedlyLogoutOperationTests.swift +++ b/Modules/Account/Tests/AccountTests/Feedly/FeedlyLogoutOperationTests.swift @@ -8,7 +8,6 @@ import XCTest @testable import Account -import Secrets //class FeedlyLogoutOperationTests: XCTestCase { // diff --git a/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift b/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift index ab05798fd..797884549 100644 --- a/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift +++ b/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift @@ -8,7 +8,6 @@ import XCTest import Parser -import Secrets @testable import Account import os.log import SyncDatabase diff --git a/Modules/ArticleExtractor/Package.swift b/Modules/ArticleExtractor/Package.swift index af892f032..3cec4c9d7 100644 --- a/Modules/ArticleExtractor/Package.swift +++ b/Modules/ArticleExtractor/Package.swift @@ -11,13 +11,15 @@ let package = Package( targets: ["ArticleExtractor"]), ], dependencies: [ - .package(path: "../FoundationExtras") + .package(path: "../FoundationExtras"), + .package(path: "../Secrets") ], targets: [ .target( name: "ArticleExtractor", dependencies: [ "FoundationExtras", + "Secrets" ], swiftSettings: [ .enableExperimentalFeature("StrictConcurrency") diff --git a/Modules/ArticleExtractor/Sources/ArticleExtractor/ArticleExtractor.swift b/Modules/ArticleExtractor/Sources/ArticleExtractor/ArticleExtractor.swift index 61b5274d2..7b2daa839 100644 --- a/Modules/ArticleExtractor/Sources/ArticleExtractor/ArticleExtractor.swift +++ b/Modules/ArticleExtractor/Sources/ArticleExtractor/ArticleExtractor.swift @@ -8,6 +8,7 @@ import Foundation import FoundationExtras +import Secrets public enum ArticleExtractorState: Sendable { case ready @@ -33,12 +34,12 @@ public protocol ArticleExtractorDelegate { private var dataTask: URLSessionDataTask? = nil private let url: URL! - public init?(_ articleLink: String, clientID: String, clientSecret: String) { + public init?(_ articleLink: String) { self.articleLink = articleLink let clientURL = "https://extract.feedbin.com/parser" - let username = clientID - let signature = articleLink.hmacUsingSHA1(key: clientSecret) + let username = SecretKey.mercuryClientID + let signature = articleLink.hmacUsingSHA1(key: SecretKey.mercuryClientSecret) if let base64URL = articleLink.data(using: .utf8)?.base64EncodedString() { let fullURL = "\(clientURL)/\(username)/\(signature)?base64_url=\(base64URL)" diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 3df2f67fa..0f4ddd703 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -11,7 +11,6 @@ import Web import Account @preconcurrency import BackgroundTasks import os.log -import Secrets import WidgetKit import Core import Images diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 9d975b336..72e0a9b1e 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -16,7 +16,6 @@ import Core import ArticleExtractor import Images import Web -import Secrets protocol WebViewControllerDelegate: AnyObject { @@ -697,7 +696,7 @@ private extension WebViewController { func startArticleExtractor() { guard articleExtractor == nil else { return } - if let link = article?.preferredLink, let extractor = ArticleExtractor(link, clientID: SecretKey.mercuryClientID, clientSecret: SecretKey.mercuryClientSecret) { + if let link = article?.preferredLink, let extractor = ArticleExtractor(link) { extractor.delegate = self extractor.process() articleExtractor = extractor