Files
mtusi2026lab7/backend/internal/domain/port/auth.go
T
rey eb1b5c7b84
Skeleton contracts / contracts (pull_request) Canceled after 0s
Prepare verified laboratory 7 implementation and evidence
2026-11-17 17:32:06 +03:00

22 lines
582 B
Go

package port
import (
"context"
"github.com/google/uuid"
"time"
)
type Passwords interface {
Hash(string) (string, error)
Verify(string, string) bool
NeedsRehash(string) bool
}
type Sessions interface {
AllowLogin(context.Context, string) (bool, error)
RehashPassword(context.Context, uuid.UUID, string, string) (bool, error)
Credentials(context.Context, string) (uuid.UUID, string, error)
CreateSession(context.Context, string, uuid.UUID, time.Time) error
AuthenticateSession(context.Context, string) (uuid.UUID, error)
RevokeSession(context.Context, string) error
}