forked from mtusi2026/mtusi2026lab2
19 lines
431 B
Go
19 lines
431 B
Go
package port
|
|
|
|
import (
|
|
"context"
|
|
"github.com/google/uuid"
|
|
"time"
|
|
)
|
|
|
|
type Passwords interface {
|
|
Hash(string) (string, error)
|
|
Verify(string, string) bool
|
|
}
|
|
type Sessions interface {
|
|
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
|
|
}
|