ORE Studio 0.0.4
Loading...
Searching...
No Matches
session_converter.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_SESSION_CONVERTER_HPP
21#define ORES_IAM_SERVICE_SESSION_CONVERTER_HPP
22
23#include <memory>
24#include "ores.comms/service/session_data.hpp"
25#include "ores.iam/domain/session.hpp"
26
27namespace ores::iam::service {
28
42class session_converter final {
43public:
49 static std::shared_ptr<comms::service::session_data>
51
57 static domain::session
59
67};
68
69}
70
71#endif
Service layer for the IAM module.
Definition account_service.hpp:34
Session data owned by ores.comms for protocol-level session tracking.
Definition session_data.hpp:63
Represents a user session in the system.
Definition session.hpp:78
Converts between comms::service::session_data and iam::domain::session.
Definition session_converter.hpp:42
static std::shared_ptr< comms::service::session_data > to_session_data(const domain::session &s)
Convert from iam domain session to comms session_data.
Definition session_converter.cpp:62
static domain::session from_session_data(const comms::service::session_data &d)
Convert from comms session_data to iam domain session.
Definition session_converter.cpp:81
static void update_from_session_data(domain::session &s, const comms::service::session_data &d)
Update a domain session from session_data.
Definition session_converter.cpp:99