Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __VEREIGN_SERVICE_IDENITY_SERVICE_HH
#define __VEREIGN_SERVICE_IDENITY_SERVICE_HH
#include <vereign/identity/provider.hh>
#include <vereign/client_library/common_types.pb.h>
#include <vereign/client_library/identity_types.pb.h>
#include <vereign/client_library/types.gen.pb.h>
#include <vereign/restapi/post_result.hh>
#include <vereign/service/gen/identity_service.hh>
#include <future>
namespace vereign {
namespace restapi {
class ClientSession;
}
namespace service {
template <class Request, class Response>
using Result = restapi::PostResult<Request, Response>;
class IdentityService : public gen::IdentityService {
public:
IdentityService(
identity::Provider& identity_provider,
restapi::ClientSession& client_session
);
IdentityService(const IdentityService&) = delete;
auto operator=(const IdentityService&) -> IdentityService& = delete;
void LoginWithExistingPubKey(
const client_library::LoginWithExistingPubKeyForm* req,
client_library::EmptyResponse* resp
);
void LoginWithNewDevice(
const client_library::LoginFormNewDevice* req,
client_library::LoginFormNewDeviceResponse* resp
);
void LoginWithPreviouslyAddedDevice(
const client_library::LoginFormPreviousAddedDevice* req,
client_library::EmptyResponse* resp
);
private:
identity::Provider& identity_provider_;
restapi::ClientSession& client_session_;
};
} // namespace service
} // namespace vereign
#endif // __VEREIGN_SERVICE_IDENITY_SERVICE_HH