mirror of
https://github.com/D-Modem/login.git
synced 2026-11-28 20:38:06 -08:00
The program is dmodem-login (like dmodemd and dmodem-ari), the Go module github.com/D-Modem/login, the site d-modem.github.io/login. Its files, units, sockets, PAM service, pppd plugin, environment (DMODEM_LOGIN_*) and nftables tables follow. An old installation keeps working: - make install puts a modemmenu link to dmodem-login, and a modemmenu.so link to the plugin, which also takes its old modemmenu-socket option - the default configuration, users file, state_dir and PAM service fall back to modemmenu's when only those are there (config.Legacy) docs/rename.md (Simplified Technical English) lists the new names and what an old installation must change (the -serve socket, the units, the /etc/modemmenu files, the old nftables tables). CI's bbs job moves a bbs that still imports github.com/D-Modem/menu to the new path. The pppd plugin builds clean with -Wall -Wextra on GCC and Clang. COMMERCIAL-LICENSE.md and CONTRIBUTING.md (legal text) are not changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTD8BSptdpaUWGcs65
30 lines
1.0 KiB
Go
30 lines
1.0 KiB
Go
// Copyright (C) 2026 D-Modem Authors
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
// Package authd is dmodem-login's auth socket ([authd] in dmodem-login.conf),
|
|
// for the programs that ask it: dmodem-login's backends (its users file,
|
|
// LDAP, SQL, the system's accounts by PAM) answer whether a password is a
|
|
// user's, so that a BBS's other logins (telnet, SSH, the web) take the
|
|
// same one as the dial-up line. One request a connection, a JSON line
|
|
// each way:
|
|
//
|
|
// {"user": "alice", "password": "..."}
|
|
// {"ok": true, "auth": "ldap"} or {"ok": false, "error": "denied"}
|
|
package authd
|
|
|
|
// Request is what a client sends.
|
|
type Request struct {
|
|
User string `json:"user"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
// Reply is dmodem-login's answer.
|
|
type Reply struct {
|
|
OK bool `json:"ok"`
|
|
Auth string `json:"auth,omitempty"` // the backend that took it
|
|
Error string `json:"error,omitempty"` // denied, refused, bad request
|
|
}
|
|
|
|
// MaxRequest is the longest request line dmodem-login reads.
|
|
const MaxRequest = 4096
|