xmpp: mellium.im/xmpp/ibr2 Index | Files

package ibr2

import "mellium.im/xmpp/ibr2"

Package ibr2 implements the Extensible In-Band Registration ProtoXEP.

BE ADVISED: This API is incomplete and is subject to change. Core functionality of this package is missing, and the entire package may be removed at any time.


Package Files

challenge.go form.go ibr2.go oob.go


const (
    NS = "urn:xmpp:register:0"

Namespaces used by IBR.

func Recovery Uses

func Recovery(challenges ...Challenge) xmpp.StreamFeature

Recovery returns a new xmpp.StreamFeature that can be used to recover an account for which authentication credentials have been lost.

func Register Uses

func Register(challenges ...Challenge) xmpp.StreamFeature

Register returns a new xmpp.StreamFeature that can be used to register a new account with the server.

type Challenge Uses

type Challenge struct {
    // Type is the type of the challenge as it appears in the server advertised
    // challenges list.
    Type string

    // Send is used by the server to send the challenge to the client.
    Send func(context.Context, xmlstream.TokenWriter) error

    // Respond is used by the client to send a response or reply to the challenge.
    Respond func(context.Context, xmlstream.TokenWriter) error

    // Receive is used by the client to receive and decode the server's challenge
    // and by the server to receive and decode the clients response.
    Receive func(ctx context.Context, server bool, r xml.TokenReader, start *xml.StartElement) error

Challenge is an IBR challenge.

func Form Uses

func Form(f func(data *form.Data) (*form.Data, error)) Challenge

Form is a challenge that presents or receives a data form as specified in XEP-0004. If Form is used by a client, f is called and passed the form sent by the server. The returned form should be a response to the sent form. If Form is used by a server, f is called once with a nil form and should return a form to be sent to the client; it is then called again with the clients response at which point a nil form can be returned to terminate the exchange, or a second form to be sent to the client can be returned.

func OOB Uses

func OOB(data *oob.Data, f func(*oob.Data) error) Challenge

OOB is a challenge that must be completed out of band using a URI provided by XEP-0066: Out of Band Data. If you are a client, f will be called and passed the parsed OOB data. If f returns an error, the client considers the negotiation a failure. For servers, the provided data is encoded and sent as part of the challenge.

Package ibr2 imports 9 packages (graph). Updated 2018-10-05. Refresh now. Tools for package owners.