ORE Studio 0.0.4
Loading...
Searching...
No Matches
account_setup_service.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_IAM_SERVICE_ACCOUNT_SETUP_SERVICE_HPP
21#define ORES_IAM_SERVICE_ACCOUNT_SETUP_SERVICE_HPP
22
23#include <string>
24#include <memory>
25#include "ores.iam/domain/account.hpp"
26#include "ores.iam/service/account_service.hpp"
27#include "ores.iam/service/authorization_service.hpp"
28#include "ores.logging/make_logger.hpp"
29
30namespace ores::iam::service {
31
43private:
44 inline static std::string_view logger_name =
45 "ores.iam.service.account_setup_service";
46
47 [[nodiscard]] static auto& lg() {
48 using namespace ores::logging;
49 static auto instance = make_logger(logger_name);
50 return instance;
51 }
52
53public:
61 std::shared_ptr<authorization_service> auth_svc);
62
79 domain::account create_account(const std::string& username,
80 const std::string& email, const std::string& password,
81 const std::string& recorded_by,
82 const std::string& change_commentary = "Account created");
83
100 domain::account create_account_with_role(const std::string& username,
101 const std::string& email, const std::string& password,
102 const std::string& recorded_by, const std::string& role_name,
103 const std::string& change_commentary = "Account created");
104
105private:
106 account_service& account_svc_;
107 std::shared_ptr<authorization_service> auth_svc_;
108};
109
110}
111
112#endif
Service layer for the IAM module.
Definition account_service.hpp:34
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Represents an account for an entity in the system.
Definition account.hpp:32
Service for managing user accounts including creation, listing, and deletion.
Definition account_service.hpp:39
Centralized service for complete account initialization.
Definition account_setup_service.hpp:42
domain::account create_account_with_role(const std::string &username, const std::string &email, const std::string &password, const std::string &recorded_by, const std::string &role_name, const std::string &change_commentary="Account created")
Creates a new account with a specific role.
Definition account_setup_service.cpp:43
domain::account create_account(const std::string &username, const std::string &email, const std::string &password, const std::string &recorded_by, const std::string &change_commentary="Account created")
Creates a new account with the default Viewer role.
Definition account_setup_service.cpp:34