Skip to content

Conversation

@ihsraham
Copy link
Collaborator

@ihsraham ihsraham commented Feb 6, 2025

  • Removed whitelistUrl import from @web3auth/auth
  • Implemented whitelistUrl function inline in the example
  • Updated dependencies: added @toruslabs/eccrypto, @toruslabs/metadata-helpers, and base64url
  • Changed base64url import to use base64urlLib explicitly
  • Wrapped the example in an async IIFE for better execution handling
  • Adjusted formatting and wording for clarity in documentation

This update ensures that developers can manually whitelist origins without relying on deprecated functions from @web3auth/auth.

Motivation and Context

The whitelistUrl function was originally part of the @toruslabs/openlogin package but was removed when the package was restructured and renamed to @web3auth/auth. As a result, developers no longer had a built-in way to generate origin whitelisting signatures. This update provides an inline implementation of whitelistUrl, ensuring that developers can still perform secure manual whitelisting without relying on outdated package versions.

Jira Link: DEVREL-1154

Description

  • Replaced the deprecated whitelistUrl function with an inline implementation in the documentation example.
  • Added required dependencies (@toruslabs/eccrypto, @toruslabs/metadata-helpers, and base64url).
  • Changed the base64url import to use base64urlLib, aligning with existing utilities.
  • Wrapped the example inside an async Immediately Invoked Function Expression (IIFE) for proper execution.
  • Updated the explanatory text for clarity, improving readability for developers implementing manual whitelisting.

How has this been tested?

  • Verified the inline whitelistUrl function generates valid signatures matching the expected format.
  • Confirmed the integration of @toruslabs/eccrypto and @toruslabs/metadata-helpers for cryptographic operations.
  • Tested the example by initializing AuthAdapter and ensuring correct behavior in a secure execution environment.
  • Checked that the new implementation aligns with the Web3Auth authentication flow and doesn't introduce security risks.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

…whitelisting example

- Removed `whitelistUrl` import from `@web3auth/auth`
- Implemented `whitelistUrl` function inline in the example
- Updated dependencies: added `@toruslabs/eccrypto`, `@toruslabs/metadata-helpers`, and `base64url`
- Changed `base64url` import to use `base64urlLib` explicitly
- Wrapped the example in an `async` IIFE for better execution handling
- Adjusted formatting and wording for clarity in documentation

This update ensures that developers can manually whitelist origins without relying on deprecated functions from `@web3auth/auth`.
@vercel
Copy link

vercel bot commented Feb 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 11:08pm

@ihsraham ihsraham merged commit df1ceb4 into master Feb 6, 2025
5 checks passed
@ihsraham ihsraham deleted the add-whitelistUrl branch February 6, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants