// SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest #ifndef AUTH_HPP #define AUTH_HPP // // AUTO GENERATED - MARKED REGIONS WILL BE KEPT // template version 2 // #include "ld-ev.hpp" // headers for provided interface implementations #include #include // headers for required interface implementations #include #include #include #include // ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 // insert your custom include headers here #include #include #include #include #include using namespace types::evse_manager; using namespace types::authorization; struct PermanentFaultRaised { int32_t connector_id; }; struct PermanentFaultCleared { int32_t connector_id; }; using AuthEvent = std::variant; struct EvseEvent { int32_t evse_index; AuthEvent data; EvseEvent(int32_t evse_index_, AuthEvent data_) : evse_index(evse_index_), data(std::move(data_)) { } }; struct EventQueueState { bool started{false}; std::queue event_queue; }; // ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1 namespace module { struct Conf { std::string selection_algorithm; int connection_timeout; std::string master_pass_group_id; bool prioritize_authorization_over_stopping_transaction; bool ignore_connector_faults; bool plug_in_timeout_enabled; }; class Auth : public Everest::ModuleBase { public: Auth() = delete; Auth(const ModuleInfo& info, std::unique_ptr p_main, std::unique_ptr p_reservation, std::vector> r_token_provider, std::vector> r_token_validator, std::vector> r_evse_manager, std::vector> r_kvs, Conf& config) : ModuleBase(info), p_main(std::move(p_main)), p_reservation(std::move(p_reservation)), r_token_provider(std::move(r_token_provider)), r_token_validator(std::move(r_token_validator)), r_evse_manager(std::move(r_evse_manager)), r_kvs(std::move(r_kvs)), config(config){}; const std::unique_ptr p_main; const std::unique_ptr p_reservation; const std::vector> r_token_provider; const std::vector> r_token_validator; const std::vector> r_evse_manager; const std::vector> r_kvs; const Conf& config; // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 // insert your public definitions here std::unique_ptr auth_handler; /** * @brief Set the connection timeout for the auth handler * * @param connection_timeout timeout in seconds */ void set_connection_timeout(int& connection_timeout); /** * @brief Set the master pass group id for the auth handler * * @param master_pass_group_id master pass group id */ void set_master_pass_group_id(const std::string& master_pass_group_id); WithdrawAuthorizationResult handle_withdraw_authorization(const WithdrawAuthorizationRequest& request); // ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1 protected: // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 // insert your protected definitions here // ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1 private: friend class LdEverest; void init(); void ready(); // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 // insert your private definitions here everest::lib::util::monitor event_state; // ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1 }; // ev@087e516b-124c-48df-94fb-109508c7cda9:v1 // insert other definitions here // ev@087e516b-124c-48df-94fb-109508c7cda9:v1 } // namespace module #endif // AUTH_HPP