35 lines
No EOL
991 B
C++
35 lines
No EOL
991 B
C++
// AuthImpersonationClient.hpp
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <stdexcept>
|
|
#include <cstdlib>
|
|
#include <map>
|
|
#include <cpprest/asyncrt_utils.h>
|
|
#include "AuthClient/ApiClient.h"
|
|
#include "AuthClient/ApiConfiguration.h"
|
|
#include "AuthClient/api/AuthApi.h"
|
|
#include "AuthClient/model/GetImpersonationToken_request.h"
|
|
#include "AuthClient/model/GetImpersonationToken_200_response.h"
|
|
|
|
|
|
namespace nyanimed {
|
|
|
|
class AuthImpersonationClient {
|
|
public:
|
|
AuthImpersonationClient();
|
|
|
|
// Потокобезопасный вызов — не модифицирует состояние
|
|
pplx::task<std::shared_ptr<nyanimed::meow::auth::model::GetImpersonationToken_200_response>>
|
|
getImpersonationToken(int64_t userId) const;
|
|
|
|
private:
|
|
std::string m_baseUrl;
|
|
std::string m_authToken;
|
|
std::shared_ptr<nyanimed::meow::auth::api::ApiClient> m_apiClient;
|
|
std::shared_ptr<nyanimed::meow::auth::api::AuthApi> m_authApi;
|
|
};
|
|
|
|
} // namespace nyanimed
|