Skip to content

feat(app): SEP-10 wallet session for hire calls - #174

Closed
TOMOKI977 wants to merge 4 commits into
mainfrom
feat/136-wallet-sessions-02-flutter
Closed

TOMOKI977 wants to merge 4 commits into
mainfrom
feat/136-wallet-sessions-02-flutter

Conversation

@TOMOKI977

Copy link
Copy Markdown
Contributor

Refs #136

Summary

Local Flutter work for the wallet session: load the SEP-10 auth config, check the challenge before the Freighter prompt, and keep the session across hire calls. The server half of #136 is already on main and live.

Acceptance criteria

  • The app signs a server challenge and keeps that session for hire calls.
  • This branch is rebased onto current main. It is not.

Verification evidence

Not rebased. git rebase origin/main stops on commit 5de25ac with conflicts in:

  • puls3_flutter/lib/src/wallet/wallet_port.dart
  • puls3_flutter/lib/src/wallet/mock_wallet.dart
  • puls3_flutter/test/screens/hire_sheet_test.dart

main already has WalletPort.signChallenge(SignInChallenge). This branch adds signChallenge(String challengeXdr, ChallengeExpectations). Keep main's signature and port Sep10ChallengeCheck onto it.

Notes for reviewers

Draft on purpose. Do not merge. Four commits, tip 3bcf562, 33 commits behind main. See the issue comment for the handoff.

Made with Cursor

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying puls3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3bcf562
Status: ✅  Deploy successful!
Preview URL: https://340da2a7.puls3-4lw.pages.dev
Branch Preview URL: https://feat-136-wallet-sessions-02.puls3-4lw.pages.dev

View logs

@TOMOKI977

Copy link
Copy Markdown
Contributor Author

Closing this draft. #176 replaces the rebase.

main already has the app half of #136 through #149: WalletPort.signChallenge, WalletSession, readAuthConfig, and sign-in before createHire. Rebasing these commits would land a second implementation (Sep10ChallengeCheck, AuthConfig, another wallet session). assets/config.json also pins a server key and domains the live server does not use (GDVEU3… / puls3.app / auth.puls3.app against GBEELN… / puls3-hub-on-stellar.api.serverpod.space).

#176 pins those live SEP-10 checks on the existing path, including the Pages build.

@TOMOKI977 TOMOKI977 closed this Oct 14, 2026
moises-cisneros pushed a commit that referenced this pull request Oct 14, 2026
…ore the wallet prompt (#136) (#176)

Ports what the #174 draft added over main's sign-in (#149), onto main's
WalletPort.signChallenge(SignInChallenge):

- assertSep10Challenge now also requires a web_auth_domain operation from
  the server, checks its value when the app knows it, and verifies the
  server's own signature (the transaction source, on Testnet) before
  Freighter is prompted. Before, a challenge with no server signature was
  signed.
- SignInChallenge, WalletSession and readAuthConfig carry webAuthDomain.
  readAuthConfig takes build-time pins (PULS3_AUTH_SERVER_SIGNING_KEY,
  PULS3_AUTH_HOME_DOMAIN, PULS3_AUTH_WEB_AUTH_DOMAIN) that win over
  config.json, because the static Pages build has no server-published
  auth block, so today it pins nothing.
- cloudflare-pages-build.sh passes the pins as dart-defines, fails when
  PULS3_HIRE=server is missing any of them, and refuses a server key that
  is not a public G... address without echoing it.
- README (Deploy) and .env.example list the three Pages variables and the
  values of the deployed server.

The #174 config.json pinned GDVEU3..., puls3.app and auth.puls3.app; the
live server signs with GBEEL... and uses
puls3-hub-on-stellar.api.serverpod.space for both domains, so those pins
would refuse every real challenge. They are not carried over.

Tests: signed challenge with the pinned web_auth_domain; refused without
web_auth_domain, with another web_auth_domain, unsigned, and signed by
another key; pins over config.json; Pages build pins and fail-closed cases.

Refs #136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants