aboutsummaryrefslogtreecommitdiff
path: root/auth/auth.go
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth.go')
-rw-r--r--auth/auth.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/auth/auth.go b/auth/auth.go
index 17b6ad3..b8ce571 100644
--- a/auth/auth.go
+++ b/auth/auth.go
@@ -2,12 +2,26 @@ package auth
import (
//nilfm.cc/git/goldbug/cookie
+ "time"
)
+type User struct {
+ Name string
+ Pass string
+ Session string
+ LoginTime time.Time
+ LastSeen time.Time
+
+ Data map[string]interface{}
+}
+
type UserStore interface {
- InitiateSession(user string, sessionId string) error
- ValidateUser(user string, password string, sessionId string) (bool, error)
+ InitiateSession(user string, password string) (string, error)
+ ValidateUser(user string, sessionId string) (bool, error)
EndSession(user string) error
+ AddUser(user string, password string) error
+ DeleteUser(user string) error
+ ChangePassword(user string, oldPassword string, newPassword string) error
}
func Login(user string, password string, userStore UserStore) (string, error) {