439 Commits

Author SHA1 Message Date
Steven Allen
37eceece4d
Merge pull request #111 from godcong/master
fix https://github.com/multiformats/go-multiaddr/issues/108
2019-09-18 16:45:23 -07:00
godcong
bbcf5cbbc5 move dns protocol definitions (3974bf3f84/dns.go (L11)) 2019-09-18 14:19:59 +08:00
godcong
0550a5ba36 move ws protocol definitions (ec8d1818a2/websocket.go (L23)) 2019-09-18 14:07:40 +08:00
godcong
c80d054253 move protocol definitions (https://github.com/libp2p/go-libp2p-circuit/blob/master/transport.go#L13-L24) 2019-09-18 13:53:31 +08:00
Steven Allen
60a59169e3
Merge pull request #59 from multiformats/fix/remove-gx
fix: remove gx support
2019-08-12 08:49:48 -07:00
Steven Allen
bd7c2ab520 fix: remove gx support 2019-08-12 08:47:55 -07:00
Steven Allen
082ac9ffc3
Merge pull request #58 from skillful-alex/fix-issue-57--Build-broken-after-36
resolve #57 "Build broken after #36"
2019-08-12 08:45:39 -07:00
skillful-alex
4d82298a97 remove unused var _ Conn = (*maConn)(nil) 2019-08-11 14:34:10 +03:00
Steven Allen
694239868b
Merge pull request #36 from multiformats/feat/udp
Make PacketConn more idiomatic and direct
2019-08-09 17:18:50 -07:00
Steven Allen
5b1de2f51f
Merge pull request #105 from multiformats/feat/no-empty-multiadd
forbid empty multiaddrs
2019-05-20 14:28:00 -07:00
Steven Allen
020c4d1741 test: empty multiaddr 2019-05-20 12:28:10 -07:00
Steven Allen
e3951368fb forbid empty multiaddrs
fixes #104
2019-05-20 12:23:28 -07:00
Steven Allen
fddba8703e
Merge pull request #103 from multiformats/feat/parse-error
improve parse error
2019-05-17 11:11:32 -07:00
Steven Allen
86a587ec70 improve parse error
This includes the bad multiaddr in the error and should improve UX (see
https://github.com/ipfs/go-ipfs/issues/4190).
2019-05-17 11:11:17 -07:00
Lars Gierth
e1825f7b50
Merge pull request #99 from multiformats/feat/bin
Add conformance testing
2019-04-19 06:00:26 +02:00
Lars Gierth
2df5aa6906 ci: remove gx from build matrix 2019-04-19 05:57:14 +02:00
Lars Gierth
e791f319f0 Add conformance testing
This patch adds a go-multiaddr CLI to aid in testing this
implementation of multiaddr. It takes a multiaddr in string or
packed form as input, and prints detailed information about the
multiaddr. This tool can be useful beyond testing, of course.

Another addition is a Makefile target for running the new
multiaddr conformance test suite. This test suite lives at
https://github.com/multiformats/multiaddr and is fetched to be
run against our new go-multiaddr CLI. This target is to be run in CI

Neither the test suite nor the CLI are complete yet.

Currently the output looks like this:

```
> go run ./multiaddr /ip4/192.0.2.42/tcp/443 | jq .
{
  "string": "/ip4/192.0.2.42/tcp/443",
  "stringSize": "23",
  "packed": "0x04c000022a0601bb",
  "packedSize": "8",
  "components": [
    {
      "string": "/ip4/192.0.2.42",
      "stringSize": "15",
      "packed": "0x04c000022a",
      "packedSize": "5",
      "value": "192.0.2.42",
      "rawValue": "0xc000022a",
      "valueSize": "4",
      "protocol": "ip4",
      "codec": "4",
      "uvarint": "0x04",
      "lengthPrefix": ""
    },
    {
      "string": "/tcp/443",
      "stringSize": "8",
      "packed": "0x0601bb",
      "packedSize": "3",
      "value": "443",
      "rawValue": "0x01bb",
      "valueSize": "2",
      "protocol": "tcp",
      "codec": "6",
      "uvarint": "0x06",
      "lengthPrefix": ""
    }
  ]
}
```

And the Makefile target:

```
> make conformance
go get -d -v .
go build -o tmp/multiaddr/test/go-multiaddr ./multiaddr
cd tmp/multiaddr/test && MULTIADDR_BIN="./go-multiaddr" go test -v
=== RUN   TestGodog
MULTIADDR_BIN="./go-multiaddr"
Feature: Multiaddr

  Scenario: Banana                              # multiaddr.feature:3
    Given the multiaddr /ip4/192.0.2.42/tcp/443 # main_test.go:81 -> github.com/multiformats/multiaddr/test_test.theMultiaddr
    Then the packed form is 0x04c000022a0601bb  # main_test.go:98 -> github.com/multiformats/multiaddr/test_test.thePackedFormIs
    And the packed size is 8 bytes              # main_test.go:105 -> github.com/multiformats/multiaddr/test_test.thePackedSizeIs
    And the components are:                     # main_test.go:126 -> github.com/multiformats/multiaddr/test_test.theComponentsAre
      | string          | stringSize | packed       | packedSize | value      | valueSize | protocol | codec | uvarint | lengthPrefix | rawValue   |
      | /ip4/192.0.2.42 | 15         | 0x04c000022a | 5          | 192.0.2.42 | 4         | ip4      | 4     | 0x04    |              | 0xc000022a |
      | /tcp/443        | 8          | 0x0601bb     | 3          | 443        | 2         | tcp      | 6     | 0x06    |              | 0x01bb     |

  Scenario: Banana #2                               # multiaddr.feature:12
    Given the multiaddr 0x04c000022a0601bb          # main_test.go:81 -> github.com/multiformats/multiaddr/test_test.theMultiaddr
    Then the string form is /ip4/192.0.2.42/tcp/443 # main_test.go:112 -> github.com/multiformats/multiaddr/test_test.theStringFormIs
    And the string size is 23 bytes                 # main_test.go:119 -> github.com/multiformats/multiaddr/test_test.theStringSizeIs
    And the components are:                         # main_test.go:126 -> github.com/multiformats/multiaddr/test_test.theComponentsAre
      | string          | stringSize | packed       | packedSize | value      | valueSize | protocol | codec | uvarint | lengthPrefix | rawValue   |
      | /ip4/192.0.2.42 | 15         | 0x04c000022a | 5          | 192.0.2.42 | 4         | ip4      | 4     | 0x04    |              | 0xc000022a |
      | /tcp/443        | 8          | 0x0601bb     | 3          | 443        | 2         | tcp      | 6     | 0x06    |              | 0x01bb     |

2 scenarios (2 passed)
8 steps (8 passed)
3.187755ms
--- PASS: TestGodog (0.00s)
PASS
ok  	github.com/multiformats/multiaddr/test	0.012s
```
2019-04-19 05:15:55 +02:00
Steven Allen
0460aad0fe
Merge pull request #101 from RTradeLtd/base33
I2P Base32 and Base32 for Encrypted Leasesets multiaddr, tiny garlic64 fix
2019-04-06 08:51:44 -07:00
idk
84811f919b don't use a function to guarantee correct padding 2019-04-05 23:41:37 -04:00
idk
477514c812 Add comments to garlic64 addresses and use the validator 2019-04-05 21:40:25 -04:00
idk
ebd6de6a8b fix the padding 2019-04-05 21:26:31 -04:00
idk
42839924e7 Improve the validator 2019-04-05 21:09:48 -04:00
idk
ae5c4f834c fix how the padding is computed 2019-04-05 21:06:30 -04:00
idk
946a6f66c0 add comments and don't repeat myself as much 2019-04-05 20:52:08 -04:00
idk
672c39fb9b add comments and don't repeat myself as much 2019-04-05 20:51:42 -04:00
idk
71e227b59a correct the protocol codes for garlic addresses 2019-04-05 15:15:05 -04:00
idk
d75a9913ac add a test for base32's longer than 56 chars 2019-03-29 17:45:22 -04:00
idk
4d3452bc2a tolerate .b32.i2p if present 2019-03-29 16:36:23 -04:00
idk
fcee0ca9ec remove thing from debugging 2019-03-29 14:54:08 -04:00
idk
d288e979d6 variable-length garlic32 addresses 2019-03-29 14:52:24 -04:00
idk
dfe5099292 Fixed up validators and encoders 2019-03-29 09:40:52 -04:00
idk
056263f8b9 Start attempting to support base32 for Encrypted Leaseset Version 2, aka base33. Not likely to work yet. 2019-03-28 23:00:48 -04:00
Jakub Sztandera
ce21123d51
Merge pull request #98 from multiformats/fix/todo
trivial: remove stale TODO
2019-02-27 14:10:35 +01:00
Jakub Sztandera
bd61b0499a
Merge pull request #53 from multiformats/feat/gomod
Add go mod
2019-02-27 13:29:21 +01:00
Raúl Kripalani
794e406662
remove stale TODO. 2019-02-27 12:10:50 +00:00
Hector Sanjuan
02c82810b0
Merge pull request #54 from multiformats/gx/update-qtg73x
gx publish 1.7.2
2019-02-26 20:18:56 +00:00
Hector Sanjuan
d8ff19bf5f gx publish 1.7.2 2019-02-26 19:54:40 +00:00
Hector Sanjuan
994311756b
Merge pull request #95 from multiformats/marshalers
Let Multiaddr implement marshalers: binary, text, json
2019-02-26 19:48:16 +00:00
Hector Sanjuan
21e652556d gx publish 1.4.1 2019-02-26 19:41:46 +00:00
Jakub Sztandera
32d315c3a1 Add go mod 2019-02-26 19:37:06 +01:00
Jakub Sztandera
06f7d80ada
Merge pull request #96 from multiformats/feat/better-travis
Update travis config
2019-02-26 19:07:01 +01:00
Jakub Sztandera
b5f1479548 Update travis config 2019-02-26 18:50:55 +01:00
Hector Sanjuan
0aa80854ab Let Multiaddr implement marshalers: binary, text, json 2019-02-25 22:48:24 +00:00
Jakub Sztandera
c8d587e921
Merge pull request #52 from multiformats/fix/captain
README: remove out of date captain
2019-02-25 14:43:06 +01:00
Jakub Sztandera
0297994296
Merge pull request #94 from multiformats/feat/gomod
Add go.mod support
2019-02-25 13:00:24 +01:00
Jakub Sztandera
f5b8871dd9 Add go.mod support 2019-02-25 11:53:48 +01:00
Jakub Sztandera
19d7396df1
Merge pull request #89 from multiformats/fix/captain
README: remove out of date captain
2019-02-20 15:20:57 +01:00
Steven Allen
152990b98b
Merge pull request #93 from backkem/p2p-webrtc-direct
Add p2p-webrtc-direct protocol
2018-12-27 14:37:46 -08:00
backkem
6b421eaeda Add p2p-webrtc-direct protocol 2018-12-20 12:10:18 +01:00
Steven Allen
312b9db355
Merge pull request #87 from RTradeLtd/master
onionv3 and i2p base64 addresses
2018-12-18 17:13:04 -08:00