forked from mtusi2026/mtusi2026lab7
feat: secure service connections and login
This commit is contained in:
@@ -4,14 +4,15 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"gitea.privcloud.tech/dizi/mtusi2026lab6/internal/messenger/attachment"
|
||||
"gitea.privcloud.tech/dizi/mtusi2026lab6/internal/model"
|
||||
"gitea.privcloud.tech/dizi/mtusi2026lab7/internal/messenger/attachment"
|
||||
"gitea.privcloud.tech/dizi/mtusi2026lab7/internal/model"
|
||||
)
|
||||
|
||||
type UserRepository interface {
|
||||
CreateUser(context.Context, string, string, string) (model.User, error)
|
||||
UserByID(context.Context, string) (model.User, error)
|
||||
UserByUsername(context.Context, string) (model.UserCredentials, error)
|
||||
UpdatePasswordHash(context.Context, string, string, string) (bool, error)
|
||||
}
|
||||
|
||||
type ChatRepository interface {
|
||||
@@ -45,5 +46,10 @@ type SessionStore interface {
|
||||
type PasswordService interface {
|
||||
Hash(string) (string, error)
|
||||
Verify(string, string) (bool, error)
|
||||
NeedsRehash(string) (bool, error)
|
||||
DummyHash() string
|
||||
}
|
||||
|
||||
type LoginLimiter interface {
|
||||
Allow(context.Context, string, string) (bool, time.Duration, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user