Skip to content

fix: require private Paykit auth scope - #1131

Draft
ben-kaufman wants to merge 4 commits into
masterfrom
codex/paykit-local-auth-testnet
Draft

fix: require private Paykit auth scope#1131
ben-kaufman wants to merge 4 commits into
masterfrom
codex/paykit-local-auth-testnet

Conversation

@ben-kaufman

@ben-kaufman ben-kaufman commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

  • require Paykit Server watch-only authorization requests to include both the public and private server capabilities
  • compare capability sets independently of ordering
  • default local E2E Homegate traffic to the Android emulator host alias (10.0.2.2)
  • update to Paykit 0.1.0-rc41 and select its local Pubky testnet client through 10.0.2.2 for local E2E builds
  • use the same Pubky client configuration for session bootstrap and the Paykit SDK
  • keep production network defaults unchanged

Paykit 0.1.0-rc41 is 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 detekt passed; reported only existing unrelated warnings.
  • The rc41 GitHub Packages publication succeeded and the package version is visible through the GitHub Packages API.
  • Local compile/test dependency resolution remains blocked by this machine's credentials for unrelated private LDK/VSS packages; authenticated CI provides the full build verification.
  • Build an E2E variant without overriding E2E_HOMEGATE_URL and confirm both Homegate and Paykit resolve through 10.0.2.2.

@ben-kaufman
ben-kaufman marked this pull request as ready for review August 4, 2026 18:48
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

The 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 10.0.2.2.

  • Requires both Paykit server capability scopes for watch-only companion claims.
  • Accepts equivalent capability sets regardless of ordering.
  • Uses one Pubky client configuration for bootstrap and SDK operations.
  • Updates local E2E host defaults and Paykit to 0.1.0-rc41.

Confidence Score: 5/5

The 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.

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "feat: use Paykit local testnet in E2E bu..." | Re-trigger Greptile

@ben-kaufman
ben-kaufman requested review from jvsena42 and ovitrif August 4, 2026 19:15
@ben-kaufman
ben-kaufman marked this pull request as draft August 4, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant