This repository has been archived on 2023-12-27. You can view files and clone it, but cannot push or open issues or pull requests.
autosnooze/vendor/github.com/emersion/go-sasl/external.go

27 lines
709 B
Go
Raw Permalink Normal View History

2022-12-16 19:44:11 -08:00
package sasl
// The EXTERNAL mechanism name.
const External = "EXTERNAL"
type externalClient struct {
Identity string
}
func (a *externalClient) Start() (mech string, ir []byte, err error) {
mech = External
ir = []byte(a.Identity)
return
}
func (a *externalClient) Next(challenge []byte) (response []byte, err error) {
return nil, ErrUnexpectedServerChallenge
}
// An implementation of the EXTERNAL authentication mechanism, as described in
// RFC 4422. Authorization identity may be left blank to indicate that the
// client is requesting to act as the identity associated with the
// authentication credentials.
func NewExternalClient(identity string) Client {
return &externalClient{identity}
}