feat(kit): separate offline route access from remote auth - #33
Merged
Conversation
✅ Deploy Preview for rdlabo-ionic-angular-library ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
rdlabo
marked this pull request as ready for review
July 25, 2026 02:19
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.
概要
オフライン時の認証を、期限付きトークンの延長ではなく、共有された
none / local / remoteのアクセス状態として定義します。Guardだけでなく、SQLite/outbox、HTTP、Realtime、オンライン復帰まで同じ状態境界に従います。状態と不変条件
nonelocalremoterequired、明示logout、HTTP 401/403は必ずnoneremote能力を即座にnoneへ降格required/confirm確定時は、anonymous fallback待機前に既存local能力も即座に失効required/confirmをauthoritative denialとして扱い、既存能力を残さないlocalへ遷移可能localでは optimistic write とoutbox追加を許可するが、送信は行わないreauthenticate → activate identity → publish remote → resume transportの順序を固定変更内容
KitAuthAccessServicenone / local / remoteを同期値とObservableで公開KitAuthRecoveryServiceErrorHandlerへ報告KitAuthStateを維持し、guard入力だけunavailableを追加onUnavailableで検証済みローカルmanifestを復元onAuthorized/onUnauthenticatedは、従来のboolean/UrlTreeに加えて二段階remote activationを返せるgetLocalSession()と既存のremote用getSession()を分離activateOfflineSession、prepareRemoteSession、resumeRemoteSessionを追加enforceAuthAccessModeopt-in時、local/noneでは認証header生成とtransportを実行しないrequireRemoteAccessopt-in時、local/noneでsocketを閉じ、remote復帰後に再接続後方互換
KitAuthStateは従来の4状態unionのままOfflineSyncContext.getLocalSession()は任意で、未実装時は既存getSession()を利用activateSession()は従来どおり一段階APIとして維持検証
npm run lintnpx ng test kit --watch=false(35 files / 467 tests)npm run prebuild(全entry point)tsc -p projects/kit/offline/tsconfig.nonstrict-null.jsongit diff --check