Add complete OAuth 2.0 Authorization Code Flow with PKCE as alternative to API token authentication, with automatic server detection and graceful fallback to classic login. **OAuth Core (RFC 7636 PKCE):** - PKCEGenerator: S256 challenge generation for secure code exchange - OAuth DTOs: Client registration, token request/response models - OAuthClient, OAuthToken, AuthenticationMethod domain models - API.swift: registerOAuthClient() and exchangeOAuthToken() endpoints - OAuthRepository + POAuthRepository protocol **Browser Integration (ASWebAuthenticationSession):** - OAuthSession: Wraps native authentication session - OAuthFlowCoordinator: Orchestrates 5-phase OAuth flow - readeck:// URL scheme for OAuth callback handling - State verification for CSRF protection - User cancellation handling **Token Management:** - KeychainHelper: OAuth token storage alongside API tokens - TokenProvider: getOAuthToken(), setOAuthToken(), getAuthMethod() - AuthenticationMethod enum to distinguish token types - AuthRepository: loginWithOAuth(), getAuthenticationMethod() - Endpoint persistence in both Keychain and Settings **Server Feature Detection:** - ServerInfo extended with features array and supportsOAuth flag - GET /api/info endpoint integration (backward compatible) - GetServerInfoUseCase with optional endpoint parameter **User Profile Integration:** - ProfileApiClient: Fetch user data via GET /api/profile - UserProfileDto with username, email, provider information - GetUserProfileUseCase: Extract username from profile - Username saved and displayed for OAuth users (like classic auth) **Automatic OAuth Flow (No User Selection):** - OnboardingServerView: 2-phase flow (endpoint → auto-OAuth or classic) - OAuth attempted automatically if server supports it - Fallback to username/password on OAuth failure or unsupported - SettingsServerViewModel: checkServerOAuthSupport(), loginWithOAuth() **Cleanup & Refactoring:** - Remove all #if os(iOS) && !APP_EXTENSION conditionals - Remove LoginMethodSelectionView (no longer needed) - Remove switchToClassicLogin() method - Factories updated with OAuth dependencies **Testing:** - PKCEGeneratorTests: Verify RFC 7636 compliance - ServerInfoTests: Feature detection and backward compatibility - Mock implementations for all OAuth components **Documentation:** - docs/OAuth2-Implementation-Plan.md: Complete implementation guide - openapi.json: Readeck API specification **Scopes Requested:** - bookmarks:read, bookmarks:write, profile:read OAuth users now have full feature parity with classic authentication. Server auto-detects OAuth support via /info endpoint. Seamless UX with browser-based login and automatic fallback.
88 lines
2.5 KiB
Plaintext
88 lines
2.5 KiB
Plaintext
{
|
|
"originHash" : "b964581e1e8d29df3b25b108bf84266454f34a1735bfe719e1926b2c41006a25",
|
|
"pins" : [
|
|
{
|
|
"identity" : "appauth-ios",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/openid/AppAuth-iOS.git",
|
|
"state" : {
|
|
"revision" : "145104f5ea9d58ae21b60add007c33c1cc0c948e",
|
|
"version" : "2.0.0"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "kingfisher",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/onevcat/Kingfisher.git",
|
|
"state" : {
|
|
"revision" : "2015fda791daa72c8058619545a593bf8c1dd59f",
|
|
"version" : "8.5.0"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "netfox",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/kasketis/netfox",
|
|
"state" : {
|
|
"revision" : "557576032736fd3140422baefb68b8f76c55088f",
|
|
"version" : "1.21.0"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "networkimage",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/gonzalezreal/NetworkImage",
|
|
"state" : {
|
|
"revision" : "2849f5323265386e200484b0d0f896e73c3411b9",
|
|
"version" : "6.0.1"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "r.swift",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/mac-cain13/R.swift.git",
|
|
"state" : {
|
|
"revision" : "a9abc6b0afe0fc4a5a71e1d7d2872143dff2d2f1",
|
|
"version" : "7.8.0"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "swift-argument-parser",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/apple/swift-argument-parser",
|
|
"state" : {
|
|
"revision" : "309a47b2b1d9b5e991f36961c983ecec72275be3",
|
|
"version" : "1.6.1"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "swift-cmark",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/swiftlang/swift-cmark",
|
|
"state" : {
|
|
"revision" : "5d9bdaa4228b381639fff09403e39a04926e2dbe",
|
|
"version" : "0.7.1"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "swift-markdown-ui",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/gonzalezreal/swift-markdown-ui",
|
|
"state" : {
|
|
"revision" : "5f613358148239d0292c0cef674a3c2314737f9e",
|
|
"version" : "2.4.1"
|
|
}
|
|
},
|
|
{
|
|
"identity" : "xcodeedit",
|
|
"kind" : "remoteSourceControl",
|
|
"location" : "https://github.com/tomlokhorst/XcodeEdit",
|
|
"state" : {
|
|
"revision" : "0e550cdee72844b35431afc3a1e176042be6d0f0",
|
|
"version" : "2.13.0"
|
|
}
|
|
}
|
|
],
|
|
"version" : 3
|
|
}
|