saslerr

package
v0.21.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package saslerr provides error conditions for the XMPP profile of SASL as defined by RFC 6120 §6.5.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition added in v0.21.4

type Condition uint16

Condition represents a SASL error condition that can be encapsulated by a <failure/> element.

const (
	// None is a special condition that is used only if a defined condition was
	// not present. Its use violates the spec.
	ConditionNone                 Condition = iota // none
	ConditionAborted                               // aborted
	ConditionAccountDisabled                       // account-disabled
	ConditionCredentialsExpired                    // credentials-expired
	ConditionEncryptionRequired                    // encryption-required
	ConditionIncorrectEncoding                     // incorrect-encoding
	ConditionInvalidAuthzID                        // invalid-authzid
	ConditionInvalidMechanism                      // invalid-mechanism
	ConditionMalformedRequest                      // malformed-request
	ConditionMechanismTooWeak                      // mechanism-too-weak
	ConditionNotAuthorized                         // not-authorized
	ConditionTemporaryAuthFailure                  // temporary-auth-failure
)

Standard SASL error conditions.

func (Condition) MarshalXML added in v0.21.4

func (c Condition) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML satisfies the xml.Marshaler interface for a Failure.

func (Condition) String added in v0.21.4

func (i Condition) String() string

func (Condition) TokenReader added in v0.21.4

func (c Condition) TokenReader() xml.TokenReader

TokenReader implements the xmlstream.Marshaler interface.

func (*Condition) UnmarshalXML added in v0.21.4

func (c *Condition) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML satisfies the xml.Unmarshaler interface.

func (Condition) WriteXML added in v0.21.4

func (c Condition) WriteXML(w xmlstream.TokenWriter) (int, error)

WriteXML implements the xmlstream.WriterTo interface.

type Error added in v0.21.4

type Error struct {
	Condition Condition
	Lang      string
	Text      string
}

Error represents a SASL error that is marshalable to XML.

func (Error) Error added in v0.21.4

func (f Error) Error() string

Error satisfies the error interface for a Failure. It returns the text string if set, or the condition otherwise.

func (Error) MarshalXML added in v0.21.4

func (f Error) MarshalXML(e *xml.Encoder, start xml.StartElement) error

MarshalXML satisfies the xml.Marshaler interface for a Failure.

func (Error) TokenReader added in v0.21.4

func (f Error) TokenReader() xml.TokenReader

TokenReader implements the xmlstream.Marshaler interface.

func (*Error) UnmarshalXML added in v0.21.4

func (f *Error) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML satisfies the xml.Unmarshaler interface for a Failure.

If multiple text elements are present in the XML, UnmarshalXML selects the text element with an xml:lang attribute that exactly matches the language tag. If no language tag in the XML matches the behavior is undefined and may change at a later date or depending on the server order of tags.

func (Error) WriteXML added in v0.21.4

func (f Error) WriteXML(w xmlstream.TokenWriter) (int, error)

WriteXML implements the xmlstream.WriterTo interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL