forked from mtusi2026/mtusi2026lab2
lab2
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
|
||||
class ISessionRepo {
|
||||
public:
|
||||
virtual ~ISessionRepo() = default;
|
||||
|
||||
struct Created {
|
||||
std::string token;
|
||||
std::int64_t expires_at; // unix-время в секундах UTC
|
||||
};
|
||||
|
||||
virtual Created create(const std::string& user_id) = 0;
|
||||
|
||||
virtual std::optional<std::string> lookup(const std::string& token) = 0;
|
||||
|
||||
virtual bool revoke(const std::string& token) = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user