From 78ca9c757332c4cb5623711e06b260955e0d486c Mon Sep 17 00:00:00 2001 From: Adam Chalkley Date: Tue, 12 Nov 2024 06:15:40 -0600 Subject: [PATCH] Update `github.com/emersion/go-sasl` pseudo-version ```text github.com/emersion/go-sasl from v0.0.0-20231106173351-e73c9f7bad43 to v0.0.0-20241020182733-b788ff22d5a6 ``` Applied via: 1. `go get github.com/emersion/go-sasl@latest` 2. `go mod tidy` 3. `go mod vendor` --- go.mod | 2 +- go.sum | 4 +- vendor/github.com/emersion/go-sasl/README.md | 3 +- vendor/github.com/emersion/go-sasl/login.go | 51 -------------------- vendor/modules.txt | 2 +- 5 files changed, 5 insertions(+), 57 deletions(-) diff --git a/go.mod b/go.mod index 10abd102..a480fed9 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/atc0005/go-nagios v0.17.1 github.com/emersion/go-imap v1.2.1 - github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 + github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 github.com/google/go-cmp v0.6.0 github.com/rs/zerolog v1.33.0 github.com/sqs/go-xoauth2 v0.0.0-20120917012134-0911dad68e56 diff --git a/go.sum b/go.sum index 4a1c8a60..dc893194 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/emersion/go-imap v1.2.1 h1:+s9ZjMEjOB8NzZMVTM3cCenz2JrQIGGo5j1df19WjT github.com/emersion/go-imap v1.2.1/go.mod h1:Qlx1FSx2FTxjnjWpIlVNEuX+ylerZQNFE5NsmKFSejY= github.com/emersion/go-message v0.15.0/go.mod h1:wQUEfE+38+7EW8p8aZ96ptg6bAb1iwdgej19uXASlE4= github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ= -github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 h1:hH4PQfOndHDlpzYfLAAfl63E8Le6F2+EL/cdhlkyRJY= -github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ= +github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 h1:oP4q0fw+fOSWn3DfFi4EXdT+B+gTtzx8GC9xsc26Znk= +github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ= github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= diff --git a/vendor/github.com/emersion/go-sasl/README.md b/vendor/github.com/emersion/go-sasl/README.md index 6bd47ba8..f88d93e5 100644 --- a/vendor/github.com/emersion/go-sasl/README.md +++ b/vendor/github.com/emersion/go-sasl/README.md @@ -1,7 +1,6 @@ # go-sasl -[![godocs.io](https://godocs.io/github.com/emersion/go-sasl?status.svg)](https://godocs.io/github.com/emersion/go-sasl) -[![Build Status](https://travis-ci.org/emersion/go-sasl.svg?branch=master)](https://travis-ci.org/emersion/go-sasl) +[![Go Reference](https://pkg.go.dev/badge/github.com/emersion/go-sasl.svg)](https://pkg.go.dev/github.com/emersion/go-sasl) A [SASL](https://tools.ietf.org/html/rfc4422) library written in Go. diff --git a/vendor/github.com/emersion/go-sasl/login.go b/vendor/github.com/emersion/go-sasl/login.go index 3847ee14..b6c4c33d 100644 --- a/vendor/github.com/emersion/go-sasl/login.go +++ b/vendor/github.com/emersion/go-sasl/login.go @@ -36,54 +36,3 @@ func (a *loginClient) Next(challenge []byte) (response []byte, err error) { func NewLoginClient(username, password string) Client { return &loginClient{username, password} } - -// Authenticates users with an username and a password. -type LoginAuthenticator func(username, password string) error - -type loginState int - -const ( - loginNotStarted loginState = iota - loginWaitingUsername - loginWaitingPassword -) - -type loginServer struct { - state loginState - username, password string - authenticate LoginAuthenticator -} - -// A server implementation of the LOGIN authentication mechanism, as described -// in https://tools.ietf.org/html/draft-murchison-sasl-login-00. -// -// LOGIN is obsolete and should only be enabled for legacy clients that cannot -// be updated to use PLAIN. -func NewLoginServer(authenticator LoginAuthenticator) Server { - return &loginServer{authenticate: authenticator} -} - -func (a *loginServer) Next(response []byte) (challenge []byte, done bool, err error) { - switch a.state { - case loginNotStarted: - // Check for initial response field, as per RFC4422 section 3 - if response == nil { - challenge = []byte("Username:") - break - } - a.state++ - fallthrough - case loginWaitingUsername: - a.username = string(response) - challenge = []byte("Password:") - case loginWaitingPassword: - a.password = string(response) - err = a.authenticate(a.username, a.password) - done = true - default: - err = ErrUnexpectedClientResponse - } - - a.state++ - return -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 066c4639..8499da30 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,7 +8,7 @@ github.com/emersion/go-imap/client github.com/emersion/go-imap/commands github.com/emersion/go-imap/responses github.com/emersion/go-imap/utf7 -# github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 +# github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 ## explicit; go 1.12 github.com/emersion/go-sasl # github.com/google/go-cmp v0.6.0