Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly manage RFC 3986 authority domain check #2351

Merged
merged 6 commits into from
Jun 4, 2024
Merged

Conversation

agsola
Copy link
Contributor

@agsola agsola commented May 31, 2024

PR overview

Using the current regex expression only second level domains are accepted. However, that is not the way it is specified on RFC 3986.

With the current implementation for instance all domains using country code second-level domains (ccSLD) like domain.co.uk are not accepted (as they are third-level domains).

The fix allows multi-level domains.

Detailed summary

Changed domainRegex regex var to allow multiple level domains.


PR-Codex overview

This PR focuses on fixing the createSiweMessage domain check to comply with RFC 3986.

Detailed summary

  • Updated domainRegex to be RFC 3986 compliant
  • Added tests for createSiweMessage with valid domain inputs

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

## PR overview
Using the current regex expression only second level domains are accepted. However, that is not the way it is specified on RFC 3986.

With the current implementation for instance all country code second-level domains (ccSLD) like domain.co.uk are not accepted.

The fix allows multi-level domains.

### Detailed summary
Changed `domainRegex` regex to allow multiple level domains.
Copy link

vercel bot commented May 31, 2024

@agsola is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

changeset-bot bot commented May 31, 2024

🦋 Changeset detected

Latest commit: 17fa3b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tmm
Copy link
Member

tmm commented May 31, 2024

Please add a changeset with bun changeset

@agsola
Copy link
Contributor Author

agsola commented Jun 1, 2024

Please add a changeset with bun changeset

I've not used changesets before.
Is that enough? (a2b800b)

.changeset/rfc3986-authority-domain.md Outdated Show resolved Hide resolved
src/utils/siwe/createSiweMessage.ts Show resolved Hide resolved
Co-authored-by: awkweb <tom@meagher.co>
@tmm tmm merged commit 48e6d50 into wevm:main Jun 4, 2024
7 of 25 checks passed
@github-actions github-actions bot mentioned this pull request Jun 4, 2024
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.

None yet

3 participants