aboutsummaryrefslogtreecommitdiff
path: root/auth.go
diff options
context:
space:
mode:
Diffstat (limited to 'auth.go')
-rw-r--r--auth.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/auth.go b/auth.go
new file mode 100644
index 0000000..2f7b0c4
--- /dev/null
+++ b/auth.go
@@ -0,0 +1,21 @@
+package main
+
+import "time"
+
+var authIface authBackend
+
+type user struct {
+ name string
+ salt []byte
+ verifier []byte
+ timestamp time.Time
+}
+
+type authBackend interface {
+ Exists(name string) bool
+ Passwd(name string) (salt, verifier []byte, err error)
+ SetPasswd(name string, salt, verifier []byte) error
+ Timestamp(name string) (time.Time, error)
+ Import(data []user)
+ Export() ([]user, error)
+}