mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 03:15: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:
@@ -529,7 +529,7 @@ struct AddRemoteServerView: View {
|
||||
allowInvalidCertificates: allowInvalidCertificates
|
||||
)
|
||||
|
||||
appEnvironment.yatteeServerCredentialsManager.setCredentials(
|
||||
appEnvironment.basicAuthCredentialsManager.setCredentials(
|
||||
username: yatteeServerUsername,
|
||||
password: yatteeServerPassword,
|
||||
for: instance
|
||||
|
||||
@@ -346,7 +346,7 @@ private struct EditRemoteServerContent: View {
|
||||
|
||||
// Load existing Yattee Server credentials
|
||||
if instance.type == .yatteeServer,
|
||||
let credentials = appEnvironment?.yatteeServerCredentialsManager.credentials(for: instance) {
|
||||
let credentials = appEnvironment?.basicAuthCredentialsManager.credentials(for: instance) {
|
||||
yatteeServerUsername = credentials.username
|
||||
yatteeServerPassword = credentials.password
|
||||
}
|
||||
@@ -438,7 +438,7 @@ private struct EditRemoteServerContent: View {
|
||||
|
||||
// Save Yattee Server credentials if provided
|
||||
if instance.type == .yatteeServer && !yatteeServerUsername.isEmpty && !yatteeServerPassword.isEmpty {
|
||||
appEnvironment?.yatteeServerCredentialsManager.setCredentials(
|
||||
appEnvironment?.basicAuthCredentialsManager.setCredentials(
|
||||
username: yatteeServerUsername,
|
||||
password: yatteeServerPassword,
|
||||
for: instance
|
||||
|
||||
@@ -290,7 +290,7 @@ private struct ChannelNotificationToggle: View {
|
||||
|
||||
private var authHeader: String? {
|
||||
guard let server = yatteeServer else { return nil }
|
||||
return appEnvironment?.yatteeServerCredentialsManager.basicAuthHeader(for: server)
|
||||
return appEnvironment?.basicAuthCredentialsManager.basicAuthHeader(for: server)
|
||||
}
|
||||
|
||||
private var toggleBinding: Binding<Bool> {
|
||||
|
||||
Reference in New Issue
Block a user