Newer
Older
#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(
restapi::ClientSession& client_session,
identity::Provider& identity_provider
);
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:
restapi::ClientSession& client_session_;
identity::Provider& identity_provider_;
};
} // namespace service
} // namespace vereign
#endif // __VEREIGN_SERVICE_IDENITY_SERVICE_HH