feat(ios): add auth services — KeychainService, AuthManager, APIClient#72
Merged
ZingerLittleBee merged 1 commit intodhakafrom Mar 28, 2026
Merged
feat(ios): add auth services — KeychainService, AuthManager, APIClient#72ZingerLittleBee merged 1 commit intodhakafrom
ZingerLittleBee merged 1 commit intodhakafrom
Conversation
Implement Unit 2 of the iOS companion app: networking and authentication infrastructure. - KeychainService: generic Security.framework wrapper for token/user persistence - InstallationID: stable UUID persisted in Keychain across reinstalls - AuthManager: @observable auth state with Keychain restore and token refresh - APIClient: actor-based HTTP client with automatic 401 retry and coalesced token refresh - Model types: MobileUser, MobileTokenResponse, ApiResponse, auth request DTOs - Minimal app shell (ServerBeeApp, project.yml, Info.plist) for build verification Targets iOS 17+, Swift 6.0 strict concurrency. Builds with zero warnings.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security.frameworkwrapper (SecItemAdd/SecItemCopyMatching/SecItemDelete) for persisting tokens, user data, server URL, and installation ID under thecom.serverbee.mobileservice namespace.@Observableauth state manager that restores Keychain state on launch, validates sessions via token refresh, and exposes reactiveisAuthenticated/user/isLoadingfor SwiftUI.@MainActorisolation on all UI-mutating methods.actor-based HTTP client with automatic Bearer token attachment, 401 auto-refresh with a single retry, and coalesced concurrent refresh requests viaCheckedContinuation.MobileUser,MobileTokenResponse,ApiResponse<T>, auth request DTOs with explicitCodingKeysfor snake_case mapping.ServerBeeApp,project.yml(XcodeGen), andInfo.plistfor build verification.All files target iOS 17+, Swift 6.0 strict concurrency (
@unchecked Sendable,actor,@MainActor). Builds with zero Swift warnings.Test plan
xcodegen generatesucceedsxcodebuild buildsucceeds with zero Swift warnings on iPhone 17 Pro simulator