~aleteoryx/muditaos

ref: afe316f82510f10aa88ecaba4c3173291613dccb muditaos/module-services/service-desktop/endpoints/security/SecurityEndpointHelper.hpp -rw-r--r-- 1.0 KiB
afe316f8 — Marcin Smoczyński Merge branch 'stable' - release v0.74.1 4 years ago
                                                                                
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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <endpoints/Context.hpp>

#include <Service/Common.hpp>
#include <Service/Service.hpp>
#include <endpoints/BaseHelper.hpp>

namespace sys
{
    class Service;
} // namespace sys

namespace parserFSM
{
    class SecurityEndpointHelper : public BaseHelper
    {
      public:
        explicit SecurityEndpointHelper(sys::Service *p) : BaseHelper(p)
        {}

        static constexpr auto PasscodeLength = 4;

      private:
        auto preventBlockingDevice() -> bool;
        auto processPut(Context &context) -> ProcessResult final;
        auto processGet(Context &context) -> ProcessResult final;

        auto processStatus(Context &context) -> http::Code;
        auto processConfiguration(Context &context) -> http::Code;

        auto passCodeArrayToVecOfInts(const json11::Json::array &passCode) -> std::vector<unsigned int>;
    };
} // namespace parserFSM