Skip to content

[WALLET-185] Add login_hint and scope parameters to signedDcApiRequest - #37

Merged
frostevent merged 1 commit into
mainfrom
jeremie/wallet-185
Jul 31, 2026
Merged

[WALLET-185] Add login_hint and scope parameters to signedDcApiRequest#37
frostevent merged 1 commit into
mainfrom
jeremie/wallet-185

Conversation

@frostevent

Copy link
Copy Markdown
Collaborator

Summary

Extends signedDcApiRequest (server DC API signed request) with optional loginHint and scope, and unifies its parameter type with authorizationUrl.

  • DCAPIAuthorizationRequestParams is now ServerAuthorizationRequestParams & { expectedOrigins } — the same type authorizationUrl accepts, plus the required non-empty expectedOrigins. This brings in:
    • scope (optional) and dcqlQuery as a mutually-exclusive union — exactly one is required, matching authorizationUrl semantics; dcql_query is now optional in the payload.
    • loginHint (optional) → emitted as login_hint.
    • state (optional) → emitted as state, keeping the DC API payload consistent with the redirect flow.
  • Deduplicated the scope XOR dcqlQuery validation into assertScopeOrDcql in internal.ts, now shared by buildAuthorizationSearchParams and the DC API path (runtime guard for JS callers; the union type already guards TS callers).

Tests

  • Extended the main DC API test with state / loginHint assertions.
  • Added a scope-based request test and a both-scope-and-dcqlQuery rejection test.
  • Full suite passes (19 server + 6 common); yarn check-all (format, lint, build, publint) is green; common verified runtime-pure.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@frostevent
frostevent enabled auto-merge (squash) July 31, 2026 11:03
@frostevent
frostevent disabled auto-merge July 31, 2026 11:03
@frostevent
frostevent merged commit 55e481e into main Jul 31, 2026
10 checks passed
@frostevent
frostevent deleted the jeremie/wallet-185 branch July 31, 2026 11:03
@frostevent frostevent mentioned this pull request Jul 31, 2026
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