Skip to content

fix: show relay on pubky auth approval - #2075

Merged
ovitrif merged 6 commits into
masterfrom
fix/pubky-auth-relay-origin
Nov 27, 2026
Merged

ovitrif merged 6 commits into
masterfrom
fix/pubky-auth-relay-origin

Conversation

@jvsena42

@jvsena42 jvsena42 commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Fixes #1505
Twin: synonymdev/bitkit-ios#1502

Shows which relay receives a Pubky authorization on the approval sheet, as the Figma "Authorize paykit" frame draws it: RELAY label, globe icon, full relay URL with its path.

Description

  • PubkyAuthRequest.relayDisplayUrl: scheme, lower-cased host, port, path and query of the request's relay URL. User info and fragment are left out, so https://trusted.example@relay.example/ cannot pass for trusted.example. It is read the way the Pubky SDK's URL parser reads it; a relay that cannot be read that way with certainty (backslash, non-ASCII, percent-encoded or numeric host, no host) makes the request invalid, so the section is never missing for a request that has a relay.
  • PubkyAuthApprovalSheet: a "Relay" section below the requested permissions on the Authorize and Authorizing steps, with a divider between sections: caption, 16dp globe icon and the URL in the same row layout as the permission rows. The URL wraps instead of truncating and is selectable. Test tag PubkyAuthRelayOrigin (shared with iOS).
  • profile__auth_approval_relay added in English and all 15 locales.
  • signin-cold-start.xml gains the relay check.
  • The first revision of this PR ported iOS's origin-only "Authorization relay" section. It now follows Figma instead, by decision of the author; the iOS twin changes iOS the same way.
  • The issue also asks for the relay line in the watch-only intro (pubky_auth__watch_only_intro_relay). iOS removed that line in 47aa7a8cd (twin of feat: refine usdt payment and earn screens #1494), and Figma's Earn frames have none, so it is not ported. The relay is shown on the Authorize step that follows the intro.
  • PubkyAuthApprovalViewModel.authorize also compares the relay shown with the relay of the re-parsed request before approving.
  • New rejection: a request with an unreadable relay is refused as an invalid link. Nothing else about approval or signing changes.

Out of Scope

  • PubkyAuthApprovalSheet.kt: the rest of the "Authorize paykit" frame (folder/permission icon header, swipe to authorize, avatar in the header). Only the relay block, the section order and the dividers are taken from it.
  • Dimming the relay path and query so the host stands out: Figma draws one text style.

Design

Authorize paykit in the Auth (paykit) flow: the Relay block (Section Header, 16px globe icon, 4px gap, URL in Body S semibold). Figma shows a one-line URL and no long-URL state; long URLs wrap.

Preview

Pending device run.

QA Notes

Setup

Dev (regtest) debug build, package to.bitkit.dev, wallet onboarded, a Pubky profile created in Bitkit. The links below are dummy requests: do not tap Authorize.

adb shell "am start -a android.intent.action.VIEW -d 'pubkyauth://signin_grant?caps=/pub/locks.app/:rw&relay=https%3A%2F%2Fhttprelay.pubky.app%2Finbox%2F&secret=e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3t7e3s&cid=locks.test&cpk=5jsjx1o6fzu6aeeo697r3i5rx15zq41kikcye8wtwdqm4nb4tryo' to.bitkit.dev"

Journeys

  • J1: updated signin-cold-start.xml — the authorization sheet shows the relay URL with its path (PubkyAuthRelayOrigin) next to a globe icon under the RELAY label

Manual Tests

  • 1. Open the link above → the sheet shows RELAY, a globe icon and https://httprelay.pubky.app/inbox/ (id PubkyAuthRelayOrigin) below the requested permissions; Cancel closes it — J1 needs a live requesting app, this dummy link does not
  • 2. Same link with relay=https%3A%2F%2FRelay.Example.com%3A8443%2Flink%2F → https://relay.example.com:8443/link/
  • 3. Same link with caps=/pub/paykit/:rw&x-bitkit-claim=watch-only-account-v1 → Earn intro without a relay line; after Approve, the Authorize step shows the relay; Cancel
  • 4. Same link with a long relay path → the URL wraps, nothing is cut off, long-press selects it
  • 5. Same link with relay=https%3A%2F%2Ftrusted.example%40httprelay.pubky.app%2Finbox%2F → https://httprelay.pubky.app/inbox/, no trusted.example@
  • 6. Same link with relay=https%3A%2F%2Fevil.example%5C%40httprelay.pubky.app%2Flink → the sheet shows https://evil.example/@httprelay.pubky.app/link, or the invalid-link toast; never a URL starting with https://httprelay.pubky.app
  • 7. Same link with relay=https%3A%2F%2Fhttprelay.pubky.app%2Fa%7Cb%2F%5Bc%5D%2F → the RELAY section is present (or the invalid-link toast); never a sheet without it

Cases 1–3 keep their IDs from the first revision; their expected text changed from the origin to the full URL, so earlier results (none were recorded) would not carry over.

Automated Checks

  • added PubkyAuthRequestTest.kt — the relay display URL keeps scheme, lower-cased host, port, path and query and drops user info and fragment; relays with a backslash, raw IDN, percent-encoded or numeric host, or no host make the request invalid, also on the Ring signup path; a request has a relay display URL whenever it has a relay
  • updated PubkyAuthApprovalViewModelTest.kt — the loaded state carries the relay URL

Evidence

Device screenshots: pending device run

Local checks at cf1f899af, all passed:

  • ./gradlew compileDevDebugKotlin testDevDebugUnitTest detekt lintDevDebug — BUILD SUCCESSFUL; 339 test classes, 6923 tests, 0 failures (PubkyAuthRequestTest 37).

After review round 2, at d47852f6c: ./gradlew compileDevDebugKotlin testDevDebugUnitTest --tests '*PubkyAuthRequestTest' --tests '*PubkyAuthApproval*' detekt — BUILD SUCCESSFUL; PubkyAuthRequestTest 37, PubkyAuthApprovalViewModelTest 37, 0 failures. The full suite and Android Lint were last run at cf1f899af.

Gaps

  • No device run yet; cases 1–7 and J1 are unverified on a device.
  • The section-level check is at the model and view-model level (a request with a relay always yields a display URL, and the state carries it); there is no Compose UI test for the sheet.

Review

An independent review (fresh agent, no implementation context) found two HIGH, three MEDIUM and several LOW items. All were checked against the code before changing anything.

  • H1/H2, relay shown differently from where the SDK sends, or not shown at all. The first version read the relay with the platform URL parser (java.net.URI), which disagrees with the Rust url crate that delivers the grant: a backslash before @, raw IDN and numeric hosts displayed another host, and characters such as | or [ made the section disappear while the request stayed approvable. Fixed: displayRelay extracts the authority the WHATWG way (text between :// and the first /, ? or #, everything through the last @ dropped) and accepts only what Rust leaves unchanged: printable ASCII without backslash or space, a plain host or bracketed IPv6, and no numeric host other than a dotted IPv4. A request whose relay is set but cannot be read this way is now an invalid request, so the sheet never opens for it. The section shows whenever a request has a relay.
  • M1/M2, overlap with the spk PR. The spk PR (fix: refuse pubky auth requests for another pubky #2104) adds to the same companion object and test file, so the second of the two to merge needs a textual conflict resolved by keeping both sides. Not reducible without restructuring the file.
  • M3, tests. Added cases for backslash, IDN (raw and punycode), | and brackets in the path, IPv6, trailing dot, percent-encoded host, numeric hosts, the Ring signup raw path, and "relay set but unreadable" (invalid, not hidden).
  • LOW, section order. RELAY now sits below the requested permissions with a divider between sections, as in Figma. The divider has 12 above and below, the padding the Figma Relay and Details frames use.
  • LOW, dimming the path. Not done: Figma draws the URL in one text style.
  • LOW, re-check at approval. authorize() now compares the relay as well.
  • LOW, journey. signin-cold-start.xml states an example of the expected relay string and its position.
  • LOW, RTL. Left to the device run.

Round 2 found no HIGH.

  • MEDIUM, dot segments on the Ring signup path. Real: the raw relay was shown as written while the url crate delivers to the resolved path. A relay with a . or .. path segment, in any %2e spelling, is now unreadable, so the request is invalid.
  • LOW, show only what the crate keeps. Also unreadable now: ports above 65535, zero-padded ports, the scheme's default port, non-canonical IPv6, and the characters the crate percent-encodes (narrowed per component in the review round below). A relay without a path is shown with the root path the crate adds (https://host/).
  • LOW, tests. Added @ in the query and after #, upper-case scheme, port 0, port above 65535, default port, dot segments, non-canonical IPv6 and localhost:port. Android also has a newline case and a view-model test that authorize() fails closed when the re-parsed relay differs from the one shown.

Round 3 found no HIGH or MEDIUM and no behaviour bugs, only test gaps. Added rows for <, > and a backtick, %2e and .%2E segments, a default port on an IPv6 host, port 65535, upper-case and IPv4-mapped IPv6, and ..;x / ..%2f segments that are not dot segments; Android also checks .. and %252e%252e relays at parse level. The targeted test class passed.

Merge order. This PR and #2104 edit neighbouring lines of the same files. Merge this PR first; #2104 then needs a rebase, keeping both sides of each conflict.

Review round, 2026-11-27.

  • piotr-iohk LOW (inline thread) and ovi-reviewer MEDIUM (review on 02355e40d), relay check too strict: real, fixed in 08420a11c. The filter rejected ', ^, {, } and a backtick anywhere, although rust-url 2.5.8 keeps ', ^, |, [, ] unchanged in a path and {, }, ^, backtick, | and \ unchanged in an http(s) query. The check is now per component: the path rejects ", <, >, backtick, {, } and \ (its PATH set, plus the backslash it turns into /); the query rejects ", <, > and ' (SPECIAL_QUERY); a backslash before the query is rejected. My earlier statement that the filter only affected raw Ring signup relays was wrong and is removed.
  • New tests: a row per character and component, accepted and rejected. PubkyAuthRequestTest failed on the old code for https://relay.example/o'neil/inbox/ and passes now (37 tests); detekt and Android Lint pass.
  • Not re-driven on a device: the reviewer's Case 14 (/inbox/?token={abc}, /inbox/o'connor, /inbox/a^b, backtick and backslash in the query) needs a run on this head.

Models used

  • Planning/scoping: claude-fable-5-2 (reasoning: Not exposed)
  • Implementation: claude-fable-5-2 (reasoning: Not exposed)
  • Review: claude-fable-5-2 (reasoning: Not exposed)
  • Review rounds: 3

Metadata note: the sessions report the model id but no reasoning setting; the reviewer model is as reported by the coordinating session.

Device check at 08420a1

Pixel_9, wallet A with a profile, dev debug build, install -r. Authorize never tapped; each sheet cancelled.

Case Result Notes Screenshot
1 relay shown PASS PubkyAuthRelayOrigin = https://httprelay.pubky.app/inbox/. android r6 auth relay case 1
14 punctuation PASS (5 of 5) Sheet opened with RELAY exactly ...?token={abc}, .../o'connor, .../a^b, ...?token=a`b, ...?token=a\b; no invalid-link toast. android r6 case 14 braces android r6 case 14 apostrophe android r6 case 14 caret

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jvsena42 jvsena42 self-assigned this Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 08420a1 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jvsena42 jvsena42 changed the title fix: show relay origin on pubky auth approval fix: show relay on pubky auth approval Nov 26, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
jvsena42 and others added 2 commits November 26, 2026 13:30
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jvsena42
jvsena42 marked this pull request as ready for review November 26, 2026 18:20
@jvsena42
jvsena42 requested review from a team, ovitrif and piotr-iohk and removed request for a team November 26, 2026 18:20
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new blocking issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issues were found.

Summary

Shows the relay URL below requested permissions on the Pubky approval sheet.

  • Pubky approval sheets show the relay URL below the requested permissions.
  • Pubky requests with an unreadable or changed relay stop before approval.

No new actionable issues were found. jvsena42 intentionally left out the watch-only intro relay line to match the current design and iOS flow, and deferred separate styling for the path and query.

Reviews (2) · Last reviewed commit: "fix: accept relay characters the sdk kee..." · Reviewed by Greptile

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. Shows the relay URL (scheme, lower-cased host, port, path, query; no user info or fragment) on the Pubky auth approval sheet, refuses a request whose relay cannot be read the way the SDK's URL parser reads it, and re-checks the shown relay at authorize(). Reviewed 02355e40d, full tier (auth path).

What I checked, and 4 candidates I ruled out

Read in full: PubkyAuthRequest.kt (displayRelay, isUnchangedRelayHostPort, isCanonicalIpv6, parse), PubkyAuthApprovalViewModel.kt, the relay block of PubkyAuthApprovalSheet.kt, PubkyRepo.parseAuthUrl.
Call sites traced: PubkyAuthRequest.parse from parseGrantSignup, parseSignup (raw Ring relay) and PubkyRepo.parseAuthUrl (SDK-normalized details.relayUrl); all three now pass through the relay check.
CI at this head: build-local, lint, detekt, Greptile green; build-and-test, compose-ui and e2e pending. Static review: on bitkit-android the PR's branch is not built or run by this reviewer, so this rests on the code and on CI.

Ruled out

  • Host disguised through user info: the authority is cut at the first /, ? or # and everything through the last @ is dropped, the WHATWG way, so https://trusted.example@relay/ shows relay; a backslash makes the request invalid rather than shown.
  • Section silently missing: parse rejects any non-empty relay displayRelay cannot render, so relayUrl is null only when the request has no relay.
  • Shown relay differing from the one approved: authorize() re-parses the request and fails with RequesterChanged when relayDisplayUrl changed.
  • Rejecting relays the SDK already normalized: SDK output has dot segments resolved, default ports dropped and the listed characters encoded, so only hand-written Ring signup relays can hit the new rejection, as the body states.

Merge confidence: 4/5, no findings and the parser is covered by PubkyAuthRequestTest.kt, but build-and-test and e2e are pending, the sheet has no Compose test, and the branch was not run here.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the session metadata names the model, not a reasoning setting)

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: full PR diff against its merge base, at 02355e4.

1 actionable finding — resolve or provide an evidence-backed rebuttal.

The relay section, the fail-closed relay check and the relay re-check in authorize() hold up for the security goal. I tried every way I could find to make the sheet show one host while the SDK delivers to another: user info, backslash, percent-encoded or numeric hosts, non-canonical IPv6, dot segments in any %2e spelling, default, padded or out-of-range ports, and tab or newline. The new check refuses all of them, and I found no case where the displayed relay differs from the real destination. One LOW issue: the check also refuses some relays the SDK already accepts unchanged, so those grant links now fail as an invalid link.

Dependency source inspected: paykit-rs v0.1.1-rc9 (0b9c63d25dbd, matching paykit-android 0.1.1-rc9). In that version parse_pubky_auth_url returns relay_url as the url crate's Url::to_string(). Also pubky-core v0.16.2 (f60e502fb4fc), where parse_relay is Url::parse and the inbox channel adds the channel ID with path_segments_mut, so the displayed path is kept. And rust-url v2.5.8 (d6ea13c5f8e7) for its percent-encode sets. crates.io was not reachable, so these came from GitHub tags.

Validation: a local Kotlin probe of the PR's displayRelay (kotlinc, functions copied verbatim) confirmed F1. I did not run the Gradle suite. CI on this head reports build-and-test, compose-ui and the local e2e jobs green. No test asserts the Compose relay section itself.

Parity: compared the relay flow with the iOS twin #1502 at 7115c8d. It uses the same displayRelay rules, the same rejected characters and the same section order and dividers, so F1 applies there too. This is not a review of the iOS PR.

Gaps: the companion bitkit-e2e-tests repo was not inspected. bitkit-core's own relay parsing on the Ring signup path was not inspected. I relied on its expected url-crate behaviour.

Device testing: not performed in this review.

Suggested additional test cases

  • Android, dev regtest build with a Pubky profile, using the PR's setup link: replace relay with https%3A%2F%2Fhttprelay.pubky.app%2Finbox%2F%3Fx%3D%7By%7D (decodes to https://httprelay.pubky.app/inbox/?x={y}). Expected: the sheet opens and RELAY shows https://httprelay.pubky.app/inbox/?x={y}. At this head an invalid-link toast is expected instead (F1).
  • Android, same setup with a relay containing an apostrophe in the path, for example https%3A%2F%2Fhttprelay.pubky.app%2Fo'k%2F. Expected: the sheet shows https://httprelay.pubky.app/o'k/, not the invalid-link toast.

Findings

  • [LOW] Stop rejecting relays the SDK already sends to unchanged — inline at app/src/main/java/to/bitkit/models/PubkyAuthRequest.kt:161.

Reviewer model: claude-opus-5-5
Reasoning effort: high

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: ⛔️ Request changes — valid grant links can be rejected before consent.

Findings:

  • MEDIUM — Valid normalized relay URLs fail as invalid links, app/src/main/java/to/bitkit/models/PubkyAuthRequest.kt:186. The filter rejects punctuation across the entire URL, although the pinned SDK preserves apostrophes and carets in paths, and braces, backticks, carets and backslashes in queries. A relay such as https://httprelay.staging.pubky.app/inbox/?token={abc} passes SDK parsing, then fails the new display check. Validate by URL component and cover these normalized grant forms. This confirms @piotr-iohk's existing finding with device evidence; no duplicate inline finding.

QA for 02355e4: Android 15 emulator, dev regtest debug build compiled from this head, staging Pubky identity and relay.

Sign in from a cold start and approve to the displayed relay ✅ J1: loading toast, full relay, and successful authorization; the requester SDK confirmed the matching wallet pubky and permissions.

The app showed Loading Your Pubky Profile, then the full relay below requested permissions with PubkyAuthRelayOrigin. Approval completed with PubkyAuthOK.

cold-signin2x.2x.mp4

Requester confirmation, checked in its SDK result:

approved: true
pubky: pubky79effrkbyzggz5xxzbtct1fezh33m7ozdp9s4jt9u35t9yfbsnqo
capabilities: /pub/locks.app/:rw
Show the relay for Ring signup before creating a profile ✅ Case 10: the fresh wallet showed the full relay below permissions; Cancel returned without creating a profile.

The sheet showed the staging homeserver and https://httprelay.staging.pubky.app/inbox/. After cancellation, Profile still offered initial profile setup.

ring-signup2x.2x.mp4

Accept SDK-normalized relay paths and queries ❌ Case 14: the control opened consent, while valid punctuation forms produced the invalid-link toast; all five rejections were confirmed in the app log.

The same grant request was opened with these relay suffixes:

  • /inbox/ — consent opened.
  • /inbox/?token={abc} — rejected.
  • /inbox/o'connor — rejected.
  • /inbox/a^b — rejected.
  • /inbox/?token=a`b — rejected.
  • /inbox/?token=a\b — rejected.

relay-punctuation2x.2x.mp4

Each rejection reached the new check after SDK parsing:

PubkyAuthApprovalViewModel: Failed to parse auth request [InvalidUrl]
Caused by: java.lang.IllegalArgumentException: Unreadable Pubky auth relay

Not re-driven: manual cases 1–7, relying on the author's device evidence at this exact head. No planned case remains unrun. The changes to translations and approval-time relay comparison were checked in code and focused tests; other locales were not driven on a device.

Coverage: full 576ac143..02355e4, including all changed files, signup/sign-in callers and the pinned SDK URL handling. Read all PR comments and reviews; also checked @talosmachina's review and @piotr-iohk's review.

Twin: synonymdev/bitkit-ios#1502 at 7115c8d matches the relay layout and parser rules, including this rejection. iOS was compared in code; no iOS device run here.


Reviewed by gpt-6.1-sol-high

@jvsena42
jvsena42 marked this pull request as draft November 27, 2026 08:20
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jvsena42

Copy link
Copy Markdown
Member Author

Re the MEDIUM finding in the ovi-reviewer review on 02355e4 ("Valid normalized relay URLs fail as invalid links", PubkyAuthRequest.kt:186): fixed in 08420a1, together with the inline thread it confirms.

The relay check now filters per URL component, using rust-url 2.5.8's own sets: the path rejects ", <, >, backtick, {, } and \; the query rejects ", <, > and '. All five forms from Case 14 that the SDK keeps unchanged are accepted and shown as written: /inbox/?token={abc}, /inbox/o'connor, /inbox/a^b, /inbox/?token=a + backtick + b, and /inbox/?token=a\b. A backslash before the query is still rejected, because there the crate rewrites it to /.

Proof: PubkyAuthRequestTest failed on the old code for https://relay.example/o'neil/inbox/ and passes now, with rows for each character in the path and in the query. Twin: synonymdev/bitkit-ios#1502 at 01415bed7.

Not re-driven on a device; Case 14 needs a re-run on this head.

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: ✅ Approve

Findings: None. The previous valid-relay rejection is fixed. The path/query filters match the pinned rust-url component encoding sets, while authority/path backslashes remain rejected.

QA for 08420a1: Android 15 emulator, dev regtest debug build compiled from this head. Requests were cancelled before authorization.

Accept SDK-normalized relay paths and queries ✅ Case 14: all five previously rejected forms now open consent and show the complete relay unchanged.

Checked the normal relay, an apostrophe and caret in paths, and braces, backtick and backslash in queries. Exact text matched PubkyAuthRelayOrigin in each UI dump; each request cancelled cleanly.

grant-punctuation2x.2x.mp4

Validate raw Ring relay components ✅ Case 15: ambiguous authority/path forms stay invalid; preserved query punctuation opens consent and cancels without creating a profile.

Authority/path backslashes and a query apostrophe produced the invalid-link toast, with Unreadable Pubky auth relay confirmed in the app log. A query backslash remained visible. A relay without a path gained / and preserved braces, a second ?, and a query backslash, checked against its UI dump. Profile still offered initial setup after cancellation.

ring-components2x.2x.mp4

Build, focused PubkyAuthRequestTest and PubkyAuthApproval* tests, detekt and Android Lint passed.

Not repeated: manual display cases 1–7 rely on the author's evidence at 02355e4; J1 cold-start approval and Ring signup case 10 rely on the previous recorded review. Their successful inputs and delivery/layout paths are unchanged. No planned case remains unrun. This delta changes only component validation and its test rows; it adds no layout or translation changes.

Coverage: contiguous delta 02355e4..08420a1, both changed files, the open finding, SDK grant and raw Ring callers, and approval-time reparse comparison.

Twin: synonymdev/bitkit-ios#1502 at 01415be now matches the component-specific fix; compared in code, with no iOS device run here.


Reviewed by gpt-6.1-sol-high

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

@jvsena42
jvsena42 marked this pull request as ready for review November 27, 2026 09:28
@jvsena42
jvsena42 requested a review from piotr-iohk November 27, 2026 09:29

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: changes since 02355e4, including affected code paths, at 08420a1. Baseline: prior review (unchanged approval view model, approval sheet UI, localized strings, changelog, and journey coverage inherited).

No new actionable code findings.

  • Relay character validation: PubkyAuthRequest.displayRelay now applies per-component rejection matching rust-url 2.5.8 (url/src/parser.rs, used by paykit-rs v0.1.1-rc9 and pubky v0.16.2): backslashes are rejected in authority and path, PATH percent-encoded characters ("<>{}) are rejected only in path, and SPECIAL_QUERY percent-encoded characters ("<>') are rejected only in the query. Verified with an exhaustive Rust url = "=2.5.8" probe across printable ASCII (0x21..0x7E) in path, query (with and without root path), userinfo, and fragment plus dot-segment, host, port, and IPv6 edge cases (0 mismatches against Url::parsewith userinfo/fragment stripped). Also verified thatPubkyAuthApprovalSheet's asLiteralRequestText()` leaves all newly accepted characters untouched.
  • Twin parity: Compared against synonymdev/bitkit-ios#1502 at 01415be; PubkyAuthRequest.displayRelay and PubkyAuthRequestTests apply the same per-component sets and test cases.
  • Validation & limitations: Local Gradle unit tests could not run because no Android SDK is installed in this review environment. On 08420a1, CI checks build-and-test, compose-ui / ui-tests, detekt, lint, and build succeeded (a re-triggered build-and-test job and e2e-tests-local shards were still in progress at review time).

Ready for device testing once any in-progress CI checks complete and any carried-forward review items are confirmed closed.

Device testing: not performed in this review (code-only). The author reports a Pixel_9 check at 08420a1 passing Case 1 and the five punctuation variants (braces, apostrophe, caret, backtick, and backslash in query); author manual cases 2–7 and journey J1 (signin-cold-start.xml) remain unverified on device.

Earlier findings reconciled at this revision: 1 verified fixed.

Reviewer model: gemini-4-neon
Reasoning effort: high

@ovitrif

ovitrif commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Merged: approved on 08420a1, cases 1, 14 and 15 passed on emulator runs of that head, checks green, no open threads.

@ovitrif
ovitrif merged commit 6da0ef6 into master Nov 27, 2026
40 checks passed
@ovitrif
ovitrif deleted the fix/pubky-auth-relay-origin branch November 27, 2026 10:16
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.

Pubky auth approval does not show the relay origin on Android

4 participants