Перенеси реализацию мессенджера из ЛР 6
Источник — проверенное рабочее дерево ЛР 6 поверх 18878d6, включая изменения после повторного ревью. SHA-256 списка исходных файлов: e45a3d85b41feff1da78dce3f20fd1f4af1c5ee629e6ed703218bc8e21ad58fe.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Repository interface {
|
||||
// Create stores the session until its absolute ExpiresAt.
|
||||
Create(ctx context.Context, s Session) error
|
||||
// UserID returns the owner of a live session, or ErrUnauthenticated when
|
||||
// the token is unknown, expired or revoked: the store cannot tell these
|
||||
// apart, and the client must not either.
|
||||
UserID(ctx context.Context, tokenHash string) (uuid.UUID, error)
|
||||
// Delete revokes the session; deleting a missing one is not an error.
|
||||
Delete(ctx context.Context, tokenHash string) error
|
||||
}
|
||||
Reference in New Issue
Block a user