aboutsummaryrefslogtreecommitdiff
path: root/auth_mtsqlite3.go
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-11-16 23:17:27 +0100
committerHimbeer <himbeer@disroot.org>2024-11-17 16:32:50 +0100
commitd0d39d2f9f3abb68eec146376b3233c8bc7c1cfa (patch)
tree70be515811406cdc3ba1ab8b56d3c6eccb2f0d59 /auth_mtsqlite3.go
parente7d92562fcf05e4f9b7f6ba29b7cda529aab49bc (diff)
Allow plugins to implement authentication backends
Design decisions: * Config option specifies which of the registered backends is used * Name conflicts (including with builtins) make the backend registration fail * Builtin backends are not moved to plugins to avoid breaking existing setups confusion in general * Builtin backends are exposed to plugins (and have been for some time); Important information and internal methods are hidden to prevent interference from malicious plugins See doc/auth_backends.md and the related interface and function documentation for details. Closes #127.
Diffstat (limited to 'auth_mtsqlite3.go')
-rw-r--r--auth_mtsqlite3.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/auth_mtsqlite3.go b/auth_mtsqlite3.go
index 64bce1a..fb340c5 100644
--- a/auth_mtsqlite3.go
+++ b/auth_mtsqlite3.go
@@ -69,7 +69,7 @@ func (a *AuthMTSQLite3) Passwd(name string) (salt, verifier []byte, err error) {
return
}
- salt, verifier, err = decodeVerifierAndSalt(encodedPasswd)
+ salt, verifier, err = DecodeVerifierAndSalt(encodedPasswd)
a.updateTimestamp(name)
return
@@ -78,7 +78,7 @@ func (a *AuthMTSQLite3) Passwd(name string) (salt, verifier []byte, err error) {
// SetPasswd creates a password entry if necessary
// and sets the password of a user.
func (a *AuthMTSQLite3) SetPasswd(name string, salt, verifier []byte) error {
- encodedPasswd := encodeVerifierAndSalt(salt, verifier)
+ encodedPasswd := EncodeVerifierAndSalt(salt, verifier)
_, err := a.db.Exec("REPLACE INTO auth (name, password, last_login) VALUES (?, ?, unixepoch());", name, encodedPasswd)
return err