20#ifndef ORES_IAM_REPOSITORY_SESSION_ENTITY_HPP
21#define ORES_IAM_REPOSITORY_SESSION_ENTITY_HPP
26#include "sqlgen/Timestamp.hpp"
27#include "sqlgen/PrimaryKey.hpp"
38 constexpr static const char* schema =
"public";
39 constexpr static const char* tablename =
"ores_iam_sessions_tbl";
44 sqlgen::PrimaryKey<std::string>
id;
61 sqlgen::PrimaryKey<sqlgen::Timestamp<
"%Y-%m-%d %H:%M:%S">>
start_time;
113std::ostream& operator<<(std::ostream& s,
const session_entity& v);
119 constexpr static const char* schema =
"public";
120 constexpr static const char* tablename =
"ores_iam_session_stats_tbl";
123 std::string account_id;
124 std::int64_t session_count = 0;
125 double avg_duration_seconds = 0.0;
126 std::int64_t total_bytes_sent = 0;
127 std::int64_t total_bytes_received = 0;
136 constexpr static const char* schema =
"public";
137 constexpr static const char* tablename =
"ores_iam_session_samples_tbl";
152 sqlgen::PrimaryKey<sqlgen::Timestamp<
"%Y-%m-%d %H:%M:%S">>
sample_time;
179 constexpr static const char* schema =
"public";
180 constexpr static const char* tablename =
"ores_iam_auth_events_tbl";
185 sqlgen::PrimaryKey<std::string>
id;
190 sqlgen::PrimaryKey<sqlgen::Timestamp<
"%Y-%m-%d %H:%M:%S">>
event_time;
Database persistence layer for IAM domain types.
Definition account_entity.hpp:28
Represents a session record in the database.
Definition session_entity.hpp:37
std::string client_identifier
Client application identifier from handshake.
Definition session_entity.hpp:80
std::string client_ip
Client IP address (IPv4 or IPv6).
Definition session_entity.hpp:75
sqlgen::PrimaryKey< std::string > id
Session UUID - part of composite primary key.
Definition session_entity.hpp:44
sqlgen::PrimaryKey< sqlgen::Timestamp<"%Y-%m-%d %H:%M:%S"> > start_time
Session start timestamp - part of composite primary key.
Definition session_entity.hpp:61
std::int64_t bytes_sent
Total bytes sent to client.
Definition session_entity.hpp:95
std::string account_id
Foreign key to accounts table.
Definition session_entity.hpp:54
std::int64_t bytes_received
Total bytes received from client.
Definition session_entity.hpp:100
int client_version_major
Client protocol version major number.
Definition session_entity.hpp:85
std::string protocol
Protocol used for this session (binary or http).
Definition session_entity.hpp:110
std::string country_code
ISO 3166-1 alpha-2 country code.
Definition session_entity.hpp:105
int client_version_minor
Client protocol version minor number.
Definition session_entity.hpp:90
std::string end_time
Session end timestamp. Empty string if session is active.
Definition session_entity.hpp:70
std::string tenant_id
Tenant identifier for multi-tenancy isolation.
Definition session_entity.hpp:49
Entity for session statistics from continuous aggregates.
Definition session_entity.hpp:118
Entity for a single time-series sample in the session samples hypertable.
Definition session_entity.hpp:135
std::int64_t bytes_sent
Cumulative bytes sent at sample time.
Definition session_entity.hpp:157
sqlgen::PrimaryKey< sqlgen::Timestamp<"%Y-%m-%d %H:%M:%S"> > sample_time
Sample timestamp — part of composite primary key and partition column.
Definition session_entity.hpp:152
std::int64_t latency_ms
Round-trip time reported by the client in this ping, in milliseconds.
Definition session_entity.hpp:167
sqlgen::PrimaryKey< std::string > session_id
Session UUID — part of composite primary key.
Definition session_entity.hpp:142
std::int64_t bytes_received
Cumulative bytes received at sample time.
Definition session_entity.hpp:162
std::string tenant_id
Tenant identifier for multi-tenancy isolation (RLS).
Definition session_entity.hpp:147
Entity for a single authentication event in the auth events hypertable.
Definition session_entity.hpp:178
std::string session_id
Session UUID. Empty string if no session was established.
Definition session_entity.hpp:218
sqlgen::PrimaryKey< sqlgen::Timestamp<"%Y-%m-%d %H:%M:%S"> > event_time
Event timestamp — part of composite primary key and partition column.
Definition session_entity.hpp:190
sqlgen::PrimaryKey< std::string > id
UUID for this event — part of composite primary key.
Definition session_entity.hpp:185
std::string error_detail
Error detail for failure events. Empty string for success events.
Definition session_entity.hpp:228
std::string party_id
Party UUID. Empty string if no party was selected.
Definition session_entity.hpp:223
std::string event_type
Event type: login_success, login_failure, logout, token_refresh, max_session_exceeded,...
Definition session_entity.hpp:207
std::string username
Username associated with the event. May be empty for events without a resolved account.
Definition session_entity.hpp:213
std::string account_id
Account identifier. Empty string if unknown.
Definition session_entity.hpp:201
std::string tenant_id
Tenant identifier. Empty string if unknown (e.g. failed login before tenant resolution).
Definition session_entity.hpp:196