From 7ce73c5490023ffdffb6b5c619b87fd18b39ab88 Mon Sep 17 00:00:00 2001 From: shwoop Date: Mon, 15 Sep 2025 16:38:51 +0200 Subject: [PATCH] fix --- signer/core/signed_data_test.go | 14 +- signer/core/siwevalidation.go | 36 +++- signer/core/testdata/siwe/valid_messages.json | 163 ++++++++++++++---- 3 files changed, 167 insertions(+), 46 deletions(-) diff --git a/signer/core/signed_data_test.go b/signer/core/signed_data_test.go index 9176714d6f..777bdcad4c 100644 --- a/signer/core/signed_data_test.go +++ b/signer/core/signed_data_test.go @@ -1102,10 +1102,16 @@ func TestSignInWithEtheriumValidMessages(t *testing.T) { t.Parallel() jsonFile, err := os.ReadFile(filepath.Join("testdata", "siwe", "valid_messages.json")) require.NoError(t, err) - tests := make(map[string]string) + var tests map[string]struct { + Msg string `json:"msg"` + RequestContext struct { + Transport string `json:"transport"` + Source string `json:"source"` + } `json:"request_context"` + } require.NoError(t, json.Unmarshal(jsonFile, &tests)) - for testName, msg := range tests { + for testName, testData := range tests { t.Run(testName, func(t *testing.T) { api, control := setup(t, true) createAccount(control, api, t) @@ -1115,8 +1121,8 @@ func TestSignInWithEtheriumValidMessages(t *testing.T) { require.NoError(t, err) a := common.NewMixedcaseAddress(list[0]) - ctx := rpc.ContextWithMockPeerInfo(context.Background(), "https", "service.org") - message := strings.ReplaceAll(msg, "{{Account}}", a.Address().Hex()) + ctx := rpc.ContextWithMockPeerInfo(context.Background(), cmp.Or(testData.RequestContext.Transport, "https"), cmp.Or(testData.RequestContext.Source, "service.org")) + message := strings.ReplaceAll(testData.Msg, "{{Account}}", a.Address().Hex()) control.approveCh <- "Y" control.inputCh <- "a_long_password" diff --git a/signer/core/siwevalidation.go b/signer/core/siwevalidation.go index 2e78f554fe..f188d79694 100644 --- a/signer/core/siwevalidation.go +++ b/signer/core/siwevalidation.go @@ -25,9 +25,6 @@ import ( "github.com/ethereum/go-ethereum/common" ) -// Message size -var messageSize = `(?:\d+)` - // Regular expression to match SIWE messages // Scheme (optional) var scheme = `(?:([a-zA-Z][a-zA-Z0-9+\-.]*)://)?` @@ -42,7 +39,8 @@ var wantsMsg = ` wants you to sign in with your Ethereum account:\n` var address = `(0x[a-fA-F0-9]{40})\n` // Optional statement (any line not containing "\n\n") -var statement = `(?:[^\n]+\n)?` +// var statement = `(?:[^\n]+\n)?` +var statement = `(?:.*\n)?` // URI var uri = `URI: (?:.+)\n` @@ -72,7 +70,7 @@ var requestID = `(?:\nRequest ID: (?:[^\n]+))?` var resources = `(?:\nResources:(?:\n- .+)+)?` // SIWE Message Regex -var siweMessageRegex = regexp.MustCompile(`(?m)^` + messageSize + scheme + domain + wantsMsg + +var siweMessageRegex = regexp.MustCompile(`(?m)^` + scheme + domain + wantsMsg + address + `\n` + statement + `\n` + uri + version + chainID + nonce + issuedAt + expiration + notBefore + requestID + resources + `$`) @@ -89,7 +87,7 @@ func validateSIWE(req *SignDataRequest) error { continue } - patterns := siweMessageRegex.FindStringSubmatch(s) + patterns := siweMessageRegex.FindStringSubmatch(s[bytesUntilStartOfMessage(s):]) if patterns == nil { return ErrMalformedSIWEMessage } @@ -127,3 +125,29 @@ func validateAddress(request *SignDataRequest, address string) error { } return nil } + +// bytestUntilStartOfMessage calculates the prefix attached to the message being signed +// The first element of our message is the default "signed with etherium" prefix +// The second element of our message is the size of the message that will follow (in bytes) +// The third element is the "domain" that would like you to sign in, which can be an IP address. +// Differentiating a number potentially followed by another number is not pretty in regex. +// To resolve this, we calculate the number of characters required to represent the message and return +// that (and the size of the etherium prefix) so they can be trimmed from the start of our message when matching. +func bytesUntilStartOfMessage(s string) int { + const etheriumSignagureHeaderLength = 26 + l := len(s) - etheriumSignagureHeaderLength + if l < 1 { + return 0 + } + + var n int + for l > 0 { + l /= 10 + n++ + } + if n < l { + n -= 1 + } + + return etheriumSignagureHeaderLength + n +} diff --git a/signer/core/testdata/siwe/valid_messages.json b/signer/core/testdata/siwe/valid_messages.json index 9a199348b5..34581af638 100644 --- a/signer/core/testdata/siwe/valid_messages.json +++ b/signer/core/testdata/siwe/valid_messages.json @@ -1,37 +1,128 @@ { - "resources present": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri:", - "resources empty": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:", - "resources missing": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "request-id present": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nRequest ID: request123", - "request-id empty": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nRequest ID: ", - "request-id missing": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "statement present": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nhave statement\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "statement empty": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "statement missing": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "Resources: [uri:, uri://@]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri:\n- uri://@", - "Resources: [uri://@:, uri://]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://@:\n- uri://", - "Resources: [uri://:, uri:?]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://:\n- uri:?", - "Resources: [uri:#, uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri:#\n- uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body", - "Resources IPv4: [uri://10.10.10.10, uri://010.0.00.000]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://10.10.10.10\n- uri://010.0.00.000", - "Resources IP-literal: [uri://[2001:db8::7], uri://[::ffff:129.144.52.38]]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://[2001:db8::7]\n- uri://[::ffff:129.144.52.38]", - "Resources IP-literal: [uri://10.10.10.10.example.com/en/process, uri://[2606:2800:220:1:248:1893:25c8:1946]/test]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://10.10.10.10.example.com/en/process\n- uri://[2606:2800:220:1:248:1893:25c8:1946]/test", - "Resources IP-literal: [uri://[2001:db8::1]:80, uri://[2001:db8::1:ffff]:5128]": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://[2001:db8::1]:80\n- uri://[2001:db8::1:ffff]:5128", - "couple of optional fields": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- ipfs://Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu\n- https://example.com/my-web2-claim.json", - "no optional field": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "timestamp without microseconds": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24Z", - "timezone not utc": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24-02:00", - "domain is RFC 3986 authority with IP": "127.0.0.1 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "domain is RFC 3986 authority with userinfo": "test@127.0.0.1 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "domain is RFC 3986 authority with port": "127.0.0.1:8080 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "domain is localhost authority with port": "localhost:8080 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "domain is RFC 3986 authority with userinfo and port": "test@127.0.0.1:8080 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "no statement": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "domain ipv6": "[::cafe] wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "uri ipv6": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://[::cafe]\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "uri ipv4": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://127.0.0.1\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "uri with port": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://127.0.0.1:4361\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "uri ipv4 query params and fragment": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://127.0.0.1/?query=one#begin\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "chainId not 1": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 4\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", - "recovery byte starting at 0": "service.org wants you to sign in with your Ethereum account:\n0xc95EB884FE852e241D409234bfC7045CB9E31BD7\n\nSign in with Ethereum to Tally\n\nURI: https://service.org\nVersion: 1\nChain ID: 1\nNonce: 15050747\nIssued At: 2022-06-30T14:08:51.382Z", - "domain contains optional scheme": "https://service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ExampleOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891756\nIssued At: 2021-09-30T16:25:24Z" -} + "resources present": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri:" + }, + "resources empty": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:" + }, + "resources missing": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "request-id present": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nRequest ID: request123" + }, + "request-id empty": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nRequest ID: " + }, + "request-id missing": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "statement present": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nhave statement\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "statement empty": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "statement missing": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "Resources: [uri:, uri://@]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri:\n- uri://@" + }, + "Resources: [uri://@:, uri://]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://@:\n- uri://" + }, + "Resources: [uri://:, uri:?]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://:\n- uri:?" + }, + "Resources: [uri:#, uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri:#\n- uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body" + }, + "Resources IPv4: [uri://10.10.10.10, uri://010.0.00.000]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://10.10.10.10\n- uri://010.0.00.000" + }, + "Resources IP-literal: [uri://[2001:db8::7], uri://[::ffff:129.144.52.38]]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://[2001:db8::7]\n- uri://[::ffff:129.144.52.38]" + }, + "Resources IP-literal: [uri://10.10.10.10.example.com/en/process, uri://[2606:2800:220:1:248:1893:25c8:1946]/test]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://10.10.10.10.example.com/en/process\n- uri://[2606:2800:220:1:248:1893:25c8:1946]/test" + }, + "Resources IP-literal: [uri://[2001:db8::1]:80, uri://[2001:db8::1:ffff]:5128]": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: uri:\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- uri://[2001:db8::1]:80\n- uri://[2001:db8::1:ffff]:5128" + }, + "couple of optional fields": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z\nResources:\n- ipfs://Qme7ss3ARVgxv6rXqVPiikMJ8u2NLgmgszg13pYrDKEoiu\n- https://example.com/my-web2-claim.json" + }, + "no optional field": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "timestamp without microseconds": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24Z" + }, + "timezone not utc": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24-02:00" + }, + "domain is RFC 3986 authority with IP": { + "msg": "127.0.0.1 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", + "request_context": { + "transport": "https", + "source": "127.0.0.1" + } + }, + "domain is RFC 3986 authority with userinfo": { + "msg": "test@127.0.0.1 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", + "request_context": { + "transport": "https", + "source": "test@127.0.0.1" + } + }, + "domain is RFC 3986 authority with port": { + "msg": "127.0.0.1:8080 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", + "request_context": { + "transport": "https", + "source": "127.0.0.1:8080" + } + }, + "domain is localhost authority with port": { + "msg": "localhost:8080 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", + "request_context": { + "transport": "https", + "source": "localhost:8080" + } + }, + "domain is RFC 3986 authority with userinfo and port": { + "msg": "test@127.0.0.1:8080 wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ServiceOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", + "request_context":{ + "transport": "https", + "source": "test@127.0.0.1:8080" + } + }, + "no statement": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "domain ipv6": { + "msg": "[::cafe] wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z", + "request_context": { + "transport": "https", + "source": "[::cafe]" + } + }, + "uri ipv6": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://[::cafe]\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "uri ipv4": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://127.0.0.1\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "uri with port": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://127.0.0.1:4361\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "uri ipv4 query params and fragment": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://127.0.0.1/?query=one#begin\nVersion: 1\nChain ID: 1\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "chainId not 1": { + "msg": "service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 4\nNonce: 32891757\nIssued At: 2021-09-30T16:25:24.000Z" + }, + "domain contains optional scheme": { + "msg": "https://service.org wants you to sign in with your Ethereum account:\n{{Account}}\n\nI accept the ExampleOrg Terms of Service: https://service.org/tos\n\nURI: https://service.org/login\nVersion: 1\nChain ID: 1\nNonce: 32891756\nIssued At: 2021-09-30T16:25:24Z" + } +} \ No newline at end of file