aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/tvmauth/client/examples/service_using_tvmtool_client/service.h
blob: 8ff948334e080dd4b015aa5116f9ca7c4a0c17ea (plain) (blame)
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
#pragma once

#include <library/cpp/http/io/stream.h>

#include <util/generic/ptr.h>

#include <unordered_set>

namespace NTvmAuth {
    class TTvmClient;
}

namespace NExample {
    struct TConfig {
        using TAllowedTvmIds = std::unordered_set<ui32>;

        TAllowedTvmIds AllowedTvmIds;
    };

    class TSomeService {
    public:
        TSomeService(const TConfig& cfg);
        ~TSomeService();

        void HandleRequest(THttpInput& in, THttpOutput& out);

    private:
        TString GetDataFromBackendC(const TString& userTicket);

    private:
        // WARNING: См. Здесь
        TConfig Config_;
        THolder<NTvmAuth::TTvmClient> Tvm_;
    };
}