Added ldap and pam authentication

This commit is contained in:
Martino Ferrari
2026-06-23 17:59:40 +02:00
parent ac24011487
commit 11120bedca
36 changed files with 1935 additions and 66 deletions
+21
View File
@@ -0,0 +1,21 @@
//go:build !pam
// Package pamauth authenticates a username/password pair against the host's PAM
// stack. This is the stub compiled into the default fully-static
// (CGO_ENABLED=0) build, which has no PAM/libpam linkage: Authenticate always
// reports PAM is unavailable. Build with `make backend-pam` (CGO_ENABLED=1
// -tags pam) to get the real implementation in pam.go.
package pamauth
import "errors"
// Available reports whether this build includes PAM support. False here.
const Available = false
// ErrUnavailable is returned by Authenticate because this build lacks PAM.
var ErrUnavailable = errors.New("pamauth: PAM support not compiled in (rebuild with: make backend-pam)")
// Authenticate always fails in the non-PAM build.
func Authenticate(service, username, password string) error {
return ErrUnavailable
}