3.0.0-beta.10#237
Conversation
* Fix apple auth scope * Fix Apple auth scope test
…ession config helper
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
|
Reviewer's GuideAdds 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 scopesequenceDiagram
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
Class diagram for explicit session configuration utilities in dapp-clientclassDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Summary of ChangesHello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request marks a significant version update for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
createExplicitSessionConfig, consider validating that the computedsessionLifetimeSecondsis > 0 (or otherwise sane) so you don't silently create already-expired sessions whenexpiresInis missing or all zeros. - The
sessionLifetimeSecondsmath uses JSnumbers before casting toBigInt; if callers could pass largedays/hours/minutesvalues you may want to clamp or switch to purelyBigIntarithmetic to avoid precision/overflow edge cases.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `createExplicitSessionConfig`, consider validating that the computed `sessionLifetimeSeconds` is > 0 (or otherwise sane) so you don't silently create already-expired sessions when `expiresIn` is missing or all zeros.
- The `sessionLifetimeSeconds` math uses JS `number`s before casting to `BigInt`; if callers could pass large `days`/`hours`/`minutes` values you may want to clamp or switch to purely `BigInt` arithmetic to avoid precision/overflow edge cases.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request introduces version 3.0.0-beta.10, which includes new features for dapp-client such as helpers for explicit session configuration, EOA login support, and an adjustment to the Apple authentication flow. The majority of the changes are version bumps across multiple packages and corresponding changelog updates, which appear to be in order.
I've identified a logical issue in the new createExplicitSessionConfig helper function. The permission validation is performed prematurely, which could block valid use cases like creating a session solely for native token spending. I've provided a code suggestion to rectify this. The other changes, including the Apple auth fix and its test, seem correct.
4be403c
into
Dargon789:2.3.7-(#131)-(#132)
Summary by Sourcery
Introduce new dapp-client helpers for explicit session configuration, extend login and type exports, and roll forward all wallet and services packages to 3.0.0-beta.10 with Apple auth adjustments.
New Features:
Bug Fixes:
Enhancements:
Build: