~samwhited/xmpp

xmpp/ping d---------
all: add strict namespace checking to mux

Previously anything that had a local name that looked like a stanza
("message", "iq", or "presence") would be treated as such, opening us up
to potential vulnerabilities in servers that allow a
{jabber:server}message on a jabber:client stream but don't treat it as a
stanza, for example.
Being more strict about checking namespaces helps to avoid this issue,
but does require a breaking change to the mux API.

Signed-off-by: Sam Whited <sam@samwhited.com>
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>
ping: use new encoding test helper

Signed-off-by: Sam Whited <sam@samwhited.com>
all: use new UnmarshalIQ methods

See #117

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: test against Mcabber

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: use sendxmpp.Ping in integration test

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: test receiving ping from sendxmpp

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: improve round trip test using ClientServer

Previously the test directly ran the get function and the handler
against a buffer. For a simple ping this is fine, but even for this it
requires a lot of boilerplate.  Using the new(ish) xmpptest.ClientServer
lets us excersize the code in a way that's closer to using an actual
server.

Updates #84

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: remove unnecessary return variable names

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: re-enable Ejabberd integration tests

Issue #68 appears to have been fixed by the recent refactor to the
internal/integration packages. This commit re-enables ejabberd tests on
the ping package which is the last step in marking the issue as
resolved.

Fixes #68

Signed-off-by: Sam Whited <sam@samwhited.com>
internal/integration: make options more flexible

This pulls some of the defaults out into options and only sets them if
the user does not apply these options. It also allows us to get the JID
directly from the command so that we don't have to create and parse a
JID, set a password, and make a user for every single test.

Signed-off-by: Sam Whited <sam@samwhited.com>
internal/integration: add s2s connection support

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: add handler type check in tests

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: temporarily remove Ejabberd integration test

See https://mellium.im/issue/68

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: add integration tests

Signed-off-by: Sam Whited <sam@samwhited.com>
all: move stanza wrapping to methods

Previously to wrap a payload in a stanza you would use the functions
WrapIQ, WrapMessage, and WrapPresence. Each of these took their
respective stanza types and a payload.
These have been moved to Wrap methods on the various stanza types that
take a payload to make them easier to use in handlers where you already
have the stanza.
The down side is that these methods now exist on types that embed a
stanza, which may be confusing since the payload will be ignored and
only the stanza will be used.

Signed-off-by: Sam Whited <sam@samwhited.com>
all: be strict about namespace validation

When decoding stanzas, be more strict about verifying the namespace.
Previously stanzas would have an empty namespace, but the session should
always setup the default namespace correctly now.

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: add ability to easily send and handle pings

Signed-off-by: Sam Whited <sam@samwhited.com>
ping: add struct based ping type
Next