mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 19:05:03 +00:00
Generalize Yattee Server credentials manager to BasicAuthCredentialsManager
Renames YatteeServerCredentialsManager → BasicAuthCredentialsManager so the same Keychain-backed username/password storage can be reused for any instance type that sits behind a reverse proxy requiring HTTP Basic Auth. Adds a one-time migration that moves existing items from the legacy 'com.yattee.yatteeserver' Keychain service to 'com.yattee.basicauth', preserving the iCloud-sync attribute. No behavior change for end users.
This commit is contained in:
@@ -45,7 +45,7 @@ struct ManageChannelsView: View {
|
||||
private var yatteeServerURL: URL? { yatteeServer?.url }
|
||||
private var yatteeServerAuthHeader: String? {
|
||||
guard let server = yatteeServer else { return nil }
|
||||
return appEnvironment?.yatteeServerCredentialsManager.basicAuthHeader(for: server)
|
||||
return appEnvironment?.basicAuthCredentialsManager.basicAuthHeader(for: server)
|
||||
}
|
||||
|
||||
/// Channels filtered by search query and sorted by selected order.
|
||||
@@ -439,7 +439,7 @@ struct ManageChannelsView: View {
|
||||
|
||||
do {
|
||||
let api = YatteeServerAPI(httpClient: HTTPClient())
|
||||
let authHeader = appEnvironment.yatteeServerCredentialsManager.basicAuthHeader(for: yatteeServer)
|
||||
let authHeader = appEnvironment.basicAuthCredentialsManager.basicAuthHeader(for: yatteeServer)
|
||||
await api.setAuthHeader(authHeader)
|
||||
let response = try await api.channelsMetadata(channelIDs: channelIDs, instance: yatteeServer)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ struct SubscriptionsView: View {
|
||||
private var yatteeServerURL: URL? { yatteeServer?.url }
|
||||
private var yatteeServerAuthHeader: String? {
|
||||
guard let server = yatteeServer else { return nil }
|
||||
return appEnvironment?.yatteeServerCredentialsManager.basicAuthHeader(for: server)
|
||||
return appEnvironment?.basicAuthCredentialsManager.basicAuthHeader(for: server)
|
||||
}
|
||||
|
||||
/// Generates a unique ID based on instances configuration.
|
||||
|
||||
Reference in New Issue
Block a user