~samwhited/xmpp

xmpp/jid d---------
all: generate disco features

Signed-off-by: Sam Whited <sam@samwhited.com>
all: update build tags for Go 1.17

See: https://golang.org/issues/41184

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: update fuzz tests to use new beta tests

These are known to be broken right now, but I believe it's an issue with
the Go branch and not with our tests. It will be investigated
eventually.

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: test that "WithDomain" performs normalization

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: normalize domainparts

Normalize domainparts using the IDNA2008 "display" profile. This may or
may not match the rules of RFC 5895 exactly, but as long as all incoming
JIDs are run through this processing it shouldn't matter if two servers
have slightly different sets of rules.

Fixes #123

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: move trailing . trimming out of split

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: lowercase error strings

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: remove redundancy in Escape/Unescape docs

Minor tweak to remove some redundant wording in the Escape/Unescape
transformer documentation.

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: add fuzz testing

No issues found, but commit the fuzz testing tool anyways in case we
want to run it again later.

Signed-off-by: Sam Whited <sam@samwhited.com>
jid: move all errors to the top of the file

Not only will this make them easier to reuse later, it makes it possible
to extract them into other packages tests by deliberately parsing a bad
JID, this way they can be compared for equality or using errors.Is.
jid: add more tests
jid: minor code cleanup of With* methods
jid: add more validation on WithLocal/WithResource
internal/jid: use new internal error message

[ci skip]
jid: add WithDomain method

Fixes #35

goos: linux
goarch: amd64
pkg: mellium.im/xmpp/jid
BenchmarkWithDomain-8   	20000000	        94.7 ns/op	      16 B/op	       1 allocs/op
PASS
ok  	mellium.im/xmpp/jid	2.008s
jid: add WithLocal method

Also add one new test for WithResource

See #35

goos: linux
goarch: amd64
pkg: mellium.im/xmpp/jid
BenchmarkWithLocal-8   	 5000000	       215 ns/op	      40 B/op	       2 allocs/op
PASS
ok  	mellium.im/xmpp/jid	1.353s
xmpp: fix missing error handling
jid: give JIDs copy semantics
jid: add unsafe JID parsing API
jid: update Transformer docs
Next