mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 07:34:09 +01:00
Make ArticleExtractor reference SecretKey instead of passing in secrets. Remove unused imports of Secrets.
This commit is contained in:
parent
445306ef2a
commit
aa807249b9
@ -13,7 +13,6 @@ import Tree
|
||||
import Web
|
||||
import Account
|
||||
import CoreResources
|
||||
import Secrets
|
||||
import OSLog
|
||||
import Core
|
||||
import CrashReporter
|
||||
|
@ -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
|
||||
|
@ -11,7 +11,6 @@ import Web
|
||||
import Articles
|
||||
import ArticlesDatabase
|
||||
import Database
|
||||
import Secrets
|
||||
|
||||
@MainActor public final class AccountManager: UnreadCountProvider {
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
import XCTest
|
||||
import Web
|
||||
@testable import Account
|
||||
import Secrets
|
||||
|
||||
//class AccountCredentialsTest: XCTestCase {
|
||||
//
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
import XCTest
|
||||
@testable import Account
|
||||
import Secrets
|
||||
|
||||
//class FeedlyLogoutOperationTests: XCTestCase {
|
||||
//
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
import XCTest
|
||||
import Parser
|
||||
import Secrets
|
||||
@testable import Account
|
||||
import os.log
|
||||
import SyncDatabase
|
||||
|
@ -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")
|
||||
|
@ -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)"
|
||||
|
@ -11,7 +11,6 @@ import Web
|
||||
import Account
|
||||
@preconcurrency import BackgroundTasks
|
||||
import os.log
|
||||
import Secrets
|
||||
import WidgetKit
|
||||
import Core
|
||||
import Images
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user