Harden offline storage and acknowledgment boundaries - #68
Merged
Conversation
✅ Deploy Preview for rdlabo-ionic-angular-library ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Comment on lines
+552
to
+570
| return async () => { | ||
| try { | ||
| const encryptionKey = await createEncryptionKey(); | ||
| if (!encryptionKey) { | ||
| throw new OfflineStorageUnavailableError( | ||
| 'encryption_key_unavailable', | ||
| 'Native offline storage requires a non-empty encryption key on first open', | ||
| ); | ||
| } | ||
| return encryptionKey; | ||
| } catch (error) { | ||
| if (error instanceof OfflineStorageUnavailableError) throw error; | ||
| throw new OfflineStorageUnavailableError( | ||
| 'encryption_key_unavailable', | ||
| error instanceof Error ? error.message : 'Offline encryption key is unavailable.', | ||
| { cause: error }, | ||
| ); | ||
| } | ||
| }; |
Contributor
There was a problem hiding this comment.
🟨 暗号鍵取得失敗の原因メッセージがtyped errorへ転写され、ログ等へ露出しうる
#wrapCreateEncryptionKey (projects/kit/offline/src/lib/sqlite-offline-repository.ts:552-570) は、製品側の鍵生成/取得処理が投げた例外の message をそのまま OfflineStorageUnavailableError のメッセージへ複製し、さらに元例外を cause として保持します。この typed error はコーディネータ経由で onStorageUnavailable コールバックへ渡され、製品のテレメトリやコンソールへ送られることが想定されています。Keychain/Keystore 実装によっては例外メッセージに鍵素材や機微な識別子が含まれる可能性があり、その場合は秘密情報が診断経路へ流出します。
Was this helpful? React with 👍 or 👎 to provide feedback.
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
Verification