~sircmpwn/tokidoki

832c91bebac88871b208e01b48defd87f4729574 — Conrad Hoffmann 2 months ago adb2a8b
Update pam to v2.0.0
3 files changed, 10 insertions(+), 4 deletions(-)

M auth/pam.go
M go.mod
M go.sum
M auth/pam.go => auth/pam.go +7 -1
@@ 6,7 6,7 @@ import (
	"fmt"
	"net/http"

	"github.com/msteinert/pam"
	"github.com/msteinert/pam/v2"
	"github.com/rs/zerolog/log"
)



@@ 48,6 48,12 @@ func pamAuth(next http.Handler, w http.ResponseWriter, r *http.Request) {
		http.Error(w, "Temporary authentication error, try again later", http.StatusServiceUnavailable)
		return
	}
	defer func() {
		err := t.End()
		if err != nil {
			log.Warn().Err(err).Msg("failed to end PAM transaction")
		}
	}()

	if err := t.Authenticate(0); err != nil {
		log.Debug().Str("user", user).Err(err).Msg("auth error")

M go.mod => go.mod +1 -1
@@ 9,7 9,7 @@ require (
	github.com/emersion/go-vcard v0.0.0-20230815062825-8fda7d206ec9
	github.com/emersion/go-webdav v0.5.1-0.20240419143909-21f251fa1de2
	github.com/go-chi/chi/v5 v5.0.10
	github.com/msteinert/pam v1.2.0
	github.com/msteinert/pam/v2 v2.0.0
	github.com/rs/zerolog v1.31.0
	golang.org/x/crypto v0.18.0
)

M go.sum => go.sum +2 -2
@@ 22,8 22,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/msteinert/pam v1.2.0 h1:mYfjlvN2KYs2Pb9G6nb/1f/nPfAttT/Jee5Sq9r3bGE=
github.com/msteinert/pam v1.2.0/go.mod h1:d2n0DCUK8rGecChV3JzvmsDjOY4R7AYbsNxAT+ftQl0=
github.com/msteinert/pam/v2 v2.0.0 h1:jnObb8MT6jvMbmrUQO5J/puTUjxy7Av+55zVJRJsCyE=
github.com/msteinert/pam/v2 v2.0.0/go.mod h1:KT28NNIcDFf3PcBmNI2mIGO4zZJ+9RSs/At2PB3IDVc=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=