fix: require private Paykit auth scope - #653
Conversation
Greptile SummaryThe PR tightens watch-only Paykit authorization to require both public and private capabilities, compares those capabilities without ordering sensitivity, and upgrades Paykit to rc41. It also shares a local-testnet Pubky client configuration between session bootstrap and the SDK, but the new Homegate plist placeholder prevents the intended localhost fallback when no override is defined.
Confidence Score: 4/5The local E2E Homegate configuration failure should be fixed before merging because profile identity creation otherwise uses an invalid endpoint when no override is defined. The authorization and Pubky-client changes are internally consistent, but the new nonempty Info.plist placeholder overrides the existing localhost default despite having no repository build-setting definition. Files Needing Attention: Bitkit/Info.plist, Bitkit/Constants/Env.swift
|
| Filename | Overview |
|---|---|
| Bitkit/Models/PubkyAuthRequest.swift | Requires the public and private watch-only capabilities and accepts either ordering through strict set equality. |
| Bitkit/Services/PubkyService.swift | Supplies one shared Pubky client configuration to both session bootstrap and Paykit SDK initialization. |
| Bitkit/Constants/Env.swift | Exposes local-E2E detection and retains the Homegate localhost fallback, which the newly inserted unresolved plist value can bypass. |
| Bitkit/Info.plist | Adds an E2E_HOMEGATE_URL build-setting placeholder without defining the setting, breaking local E2E fallback behavior. |
| Bitkit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | Resolves Paykit 0.1.0-rc41 at the corresponding pinned revision. |
| BitkitTests/PubkyAuthRequestTests.swift | Covers reordered capabilities and rejection of watch-only requests missing the private capability. |
| BitkitTests/PaykitSdkClientConfigTests.swift | Verifies production defaults and local-E2E testnet selection. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Local E2E profile creation] --> B[Read E2E_HOMEGATE_URL from Info.plist]
B --> C{Build setting defined?}
C -- No --> D[Literal placeholder is nonempty]
D --> E[Localhost fallback is skipped]
E --> F[Invalid Homegate signup endpoint]
F --> G[Identity creation fails]
C -- Yes --> H[Use configured Homegate URL]
Reviews (1): Last reviewed commit: "feat: use Paykit local testnet in E2E bu..." | Re-trigger Greptile
Description
Info.plist0.1.0-rc41and select its local Pubky testnet client for local E2E buildsValidation: Paykit
0.1.0-rc41resolved from its published tag, 33 focused tests passed, SwiftFormat passed,Info.plistlint passed, and the PR diff passed whitespace checks.Linked Issues/Tasks
Screenshot / Video
N/A — no user-facing UI changes.