1package store23import (4 "context"56 "github.com/charmbracelet/soft-serve/pkg/db"7 "github.com/charmbracelet/soft-serve/pkg/db/models"8 "golang.org/x/crypto/ssh"9)1011// UserStore is an interface for managing users.12type UserStore interface {13 GetUserByID(ctx context.Context, h db.Handler, id int64) (models.User, error)14 FindUserByUsername(ctx context.Context, h db.Handler, username string) (models.User, error)15 FindUserByPublicKey(ctx context.Context, h db.Handler, pk ssh.PublicKey) (models.User, error)16 FindUserByAccessToken(ctx context.Context, h db.Handler, token string) (models.User, error)17 GetAllUsers(ctx context.Context, h db.Handler) ([]models.User, error)18 CreateUser(ctx context.Context, h db.Handler, username string, isAdmin bool, pks []ssh.PublicKey) error19 DeleteUserByUsername(ctx context.Context, h db.Handler, username string) error20 SetUsernameByUsername(ctx context.Context, h db.Handler, username string, newUsername string) error21 SetAdminByUsername(ctx context.Context, h db.Handler, username string, isAdmin bool) error22 AddPublicKeyByUsername(ctx context.Context, h db.Handler, username string, pk ssh.PublicKey) error23 RemovePublicKeyByUsername(ctx context.Context, h db.Handler, username string, pk ssh.PublicKey) error24 ListPublicKeysByUserID(ctx context.Context, h db.Handler, id int64) ([]ssh.PublicKey, error)25 ListPublicKeysByUsername(ctx context.Context, h db.Handler, username string) ([]ssh.PublicKey, error)26 SetUserPassword(ctx context.Context, h db.Handler, userID int64, password string) error27 SetUserPasswordByUsername(ctx context.Context, h db.Handler, username string, password string) error28}