Skip to content

# Class diagram for explicit session configuration utilities in dapp-client #238

@Dargon789

Description

@Dargon789

Reviewer's Guide

Adds explicit session configuration utilities and exports to the dapp-client, extends login methods to support EOA, adjusts Apple OAuth authcode flow to omit scope, and bumps multiple package versions and changelogs for 3.0.0-beta.10 with associated changesets.

Sequence diagram for Apple authcode OAuth URL generation without scope

sequenceDiagram
  actor User
  participant DappClient
  participant AuthCodeHandler
  participant OAuthProvider

  User->>DappClient: initiateLogin(method apple)
  DappClient->>AuthCodeHandler: buildAuthUrl(signupKind apple)
  AuthCodeHandler->>AuthCodeHandler: generateState()
  AuthCodeHandler->>AuthCodeHandler: buildSearchParams(client_id, redirect_uri, response_type, state)
  AuthCodeHandler-->>DappClient: oauthUrlWithoutScope
  DappClient-->>User: redirectTo(oauthUrlWithoutScope)
  User->>OAuthProvider: open oauthUrlWithoutScope
  OAuthProvider-->>User: Apple consent and login flow
Loading

Class diagram for explicit session configuration utilities in dapp-client

classDiagram
  class SessionDuration {
    +number days
    +number hours
    +number minutes
  }

  class NativeTokenSpending {
    +bigint valueLimit
    +Address.Address[] allowedRecipients
  }

  class ExplicitSessionParams {
    +number chainId
    +SessionDuration expiresIn
    +Permission.Permission[] permissions
    +NativeTokenSpending nativeTokenSpending
  }

  class ExplicitSessionConfig {
    +number chainId
    +bigint valueLimit
    +bigint deadline
    +Permission.Permission[] permissions
  }

  class DappClientUtils {
    +createExplicitSessionConfig(params ExplicitSessionParams) ExplicitSessionConfig
  }

  class Permission {
  }

  class Address {
  }

  ExplicitSessionParams --> SessionDuration : uses
  ExplicitSessionParams --> NativeTokenSpending : optional
  ExplicitSessionParams --> Permission : uses
  NativeTokenSpending --> Address : allowedRecipients
  ExplicitSessionConfig --> Permission : uses
  DappClientUtils ..> ExplicitSessionParams : input
  DappClientUtils ..> ExplicitSessionConfig : output
Loading

File-Level Changes

Change Details Files
Introduce utilities and exports for constructing explicit session configs in the dapp-client utils and main entrypoint.
  • Import ExplicitSessionConfig, Permission, Address types to support explicit session construction.
  • Define SessionDuration, NativeTokenSpending, and ExplicitSessionParams types to describe session lifetimes and native token spending constraints.
  • Implement createExplicitSessionConfig to compute a deadline from relative duration, enforce at least one base permission, derive native token spending permissions, and assemble ExplicitSessionConfig.
  • Export VALUE_FORWARDER_ADDRESS and new helper functions (network/relayer/RPC URL accessors) plus new session-related types from the dapp-client index and utils.
  • Re-export Network from wallet-primitives via the dapp-client entrypoint.
packages/wallet/dapp-client/src/utils/index.ts
packages/wallet/dapp-client/src/index.ts
Extend authentication and login surface to support EOA and refine Apple OAuth behavior.
  • Add 'eoa' to the LoginMethod union type for dapp-client.
  • Change AuthCodeHandler to conditionally omit the OAuth scope parameter when signupKind is 'apple' while preserving existing behavior otherwise.
  • Update Apple auth unit test to assert that the scope parameter is not present for Apple auth URLs.
packages/wallet/dapp-client/src/types/index.ts
packages/wallet/wdk/src/sequence/handlers/authcode.ts
packages/wallet/wdk/test/authcode.test.ts
Release 3.0.0-beta.10 across packages, documenting and configuring patch releases for dapp-client, Apple auth fixes, and dependency bumps.
  • Add 3.0.0-beta.7 through 3.0.0-beta.10 sections to various package CHANGELOGs summarizing dapp-client updates, EOA login support, and Apple auth fixes.
  • Bump versions from 3.0.0-beta.6 to 3.0.0-beta.10 across service, utils, wallet, and dapp-client package.json files.
  • Introduce changeset definitions capturing patch bumps and notes for dapp-client updates, EOA login, and Apple auth fixes.
packages/wallet/wdk/CHANGELOG.md
packages/wallet/dapp-client/CHANGELOG.md
packages/wallet/core/CHANGELOG.md
packages/services/relayer/CHANGELOG.md
packages/services/api/CHANGELOG.md
packages/services/builder/CHANGELOG.md
packages/services/guard/CHANGELOG.md
packages/services/identity-instrument/CHANGELOG.md
packages/services/indexer/CHANGELOG.md
packages/services/marketplace/CHANGELOG.md
packages/services/metadata/CHANGELOG.md
packages/services/userdata/CHANGELOG.md
packages/utils/abi/CHANGELOG.md
packages/wallet/primitives/CHANGELOG.md
packages/services/api/package.json
packages/services/builder/package.json
packages/services/guard/package.json
packages/services/identity-instrument/package.json
packages/services/indexer/package.json
packages/services/marketplace/package.json
packages/services/metadata/package.json
packages/services/relayer/package.json
packages/services/userdata/package.json
packages/utils/abi/package.json
packages/wallet/core/package.json
packages/wallet/dapp-client/package.json
packages/wallet/primitives/package.json
packages/wallet/wdk/package.json
.changeset/crisp-zoos-retire.md
.changeset/new-turkeys-double.md
.changeset/nice-tips-slide.md
.changeset/tiny-files-chew.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Originally posted by @sourcery-ai[bot] in #237 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions