20#ifndef ORES_IAM_MESSAGING_SESSION_HANDLER_HPP
21#define ORES_IAM_MESSAGING_SESSION_HANDLER_HPP
23#include "ores.logging/make_logger.hpp"
24#include "ores.nats/domain/message.hpp"
25#include "ores.nats/service/client.hpp"
26#include "ores.database/domain/context.hpp"
27#include "ores.security/jwt/jwt_authenticator.hpp"
28#include "ores.service/messaging/handler_helpers.hpp"
29#include "ores.iam.api/messaging/session_protocol.hpp"
30#include "ores.iam.api/messaging/session_samples_protocol.hpp"
32namespace ores::iam::messaging {
36inline auto& session_handler_lg() {
37 static auto instance = ores::logging::make_logger(
38 "ores.iam.messaging.session_handler");
44using ores::service::messaging::reply;
45using ores::service::messaging::decode;
47class session_handler {
52 : nats_(nats), ctx_(
std::move(ctx)), signer_(
std::move(signer)) {}
56 BOOST_LOG_SEV(session_handler_lg(), debug)
58 BOOST_LOG_SEV(session_handler_lg(), debug)
60 reply(nats_, msg, list_sessions_response{});
65 BOOST_LOG_SEV(session_handler_lg(), debug)
67 BOOST_LOG_SEV(session_handler_lg(), debug)
69 reply(nats_, msg, get_active_sessions_response{});
74 BOOST_LOG_SEV(session_handler_lg(), debug)
76 BOOST_LOG_SEV(session_handler_lg(), debug)
78 reply(nats_, msg, get_session_samples_response{});
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Context for the operations on a postgres database.
Definition context.hpp:47
A received NATS message.
Definition message.hpp:40
std::string subject
The subject the message was published to.
Definition message.hpp:44
NATS client: connection, pub/sub, request/reply, and JetStream.
Definition client.hpp:73
JWT authentication primitive.
Definition jwt_authenticator.hpp:45