fix: require private Paykit auth scope - #1131
Conversation
Greptile SummaryThe PR strengthens watch-only Paykit authorization by requiring both public and private capabilities, makes capability comparison order-independent, and upgrades Paykit to rc41. It also shares a local-testnet Pubky client configuration between session bootstrap and the long-lived SDK while routing emulator-based local E2E traffic through
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified. The authorization parser now enforces both required scopes while preserving order-independent matching, and bootstrap and SDK operations consistently derive their Pubky network settings from the same configuration function.
|
| Filename | Overview |
|---|---|
| app/src/main/java/to/bitkit/models/PubkyAuthRequest.kt | Requires the public and private watch-only scopes and compares capability tokens independently of order. |
| app/src/main/java/to/bitkit/services/PaykitSdkService.kt | Shares environment-aware Pubky client configuration across bootstrap operations and the Paykit SDK. |
| app/build.gradle.kts | Changes the default local E2E Homegate address to the Android emulator host alias. |
| gradle/libs.versions.toml | Upgrades the Paykit Android dependency from rc40 to rc41. |
| app/src/test/java/to/bitkit/models/PubkyAuthRequestTest.kt | Adds coverage for reordered scopes and rejection of requests missing the private scope. |
| app/src/test/java/to/bitkit/services/PaykitSdkServiceTest.kt | Verifies production defaults and local E2E Pubky testnet configuration. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Env["Env.isLocalE2eBackend"] --> Config["paykitPubkyClientConfig()"]
Config -->|Local E2E| Local["LOCAL_TESTNET<br/>10.0.2.2"]
Config -->|Other builds| Production["Default production client"]
Local --> Bootstrap["PubkySessionBootstrap"]
Local --> SDK["PaykitSdk"]
Production --> Bootstrap
Production --> SDK
Reviews (1): Last reviewed commit: "feat: use Paykit local testnet in E2E bu..." | Re-trigger Greptile
Description
10.0.2.2)0.1.0-rc41and select its local Pubky testnet client through10.0.2.2for local E2E buildsPaykit
0.1.0-rc41is published for Android and iOS. The local test environment fixes are in pubky/locks#11.Preview
N/A — no user-facing UI changes.
QA Notes
./gradlew detektpassed; reported only existing unrelated warnings.E2E_HOMEGATE_URLand confirm both Homegate and Paykit resolve through10.0.2.2.