Skip to content

fix: properly manage RFC 3986 authority domain check - #2351

Merged
tmm merged 6 commits into
wevm:mainfrom
agsola:patch-2
Jun 4, 2024
Merged

tmm merged 6 commits into
wevm:mainfrom
agsola:patch-2

Conversation

@agsola

@agsola agsola commented May 31, 2024 •

Copy link
Copy Markdown
Contributor

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.
@vercel

vercel Bot commented May 31, 2024

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented May 31, 2024 •

Copy link
Copy Markdown

🦋 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

tmm commented May 31, 2024

Copy link
Copy Markdown
Member

Please add a changeset with bun changeset

@agsola

agsola commented Jun 1, 2024

Copy link
Copy Markdown
Contributor Author

Please add a changeset with bun changeset

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

Comment thread src/utils/siwe/createSiweMessage.ts Resolved
Comment thread .changeset/rfc3986-authority-domain.md Resolved
Comment thread src/utils/siwe/createSiweMessage.ts Resolved
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.

3 participants