|
ORE Studio 0.0.4
|
Centralized authentication session management service. More...
#include <auth_session_service.hpp>

Public Member Functions | |
| std::optional< session_info > | get_session (const std::string &remote_address) const |
| Get session for a remote address. | |
| bool | is_authenticated (const std::string &remote_address) const |
| Check if a remote address has an authenticated session. | |
| bool | is_admin (const std::string &remote_address) const |
| Check if a remote address has an admin session. | |
| void | store_session (const std::string &remote_address, session_info info) |
| Store session for a remote address. | |
| void | remove_session (const std::string &remote_address) |
| Remove session for a remote address. | |
| void | clear_all_sessions () |
| Remove all sessions (e.g., on server shutdown). | |
| std::expected< void, messaging::error_code > | authorize_request (messaging::message_type type, const std::string &remote_address) const |
| Check if a request is authorized based on message type and session. | |
Centralized authentication session management service.
Tracks authenticated sessions by remote address. This service is shared across all message handlers to provide consistent authorization checks.
Thread-safety: All public methods are thread-safe.
| std::optional< session_info > get_session | ( | const std::string & | remote_address | ) | const |
Get session for a remote address.
| remote_address | The client's remote address |

| bool is_authenticated | ( | const std::string & | remote_address | ) | const |
Check if a remote address has an authenticated session.
| remote_address | The client's remote address |
| bool is_admin | ( | const std::string & | remote_address | ) | const |
Check if a remote address has an admin session.
| remote_address | The client's remote address |
| void store_session | ( | const std::string & | remote_address, |
| session_info | info | ||
| ) |
Store session for a remote address.
| remote_address | The client's remote address |
| info | Session information to store |
| void remove_session | ( | const std::string & | remote_address | ) |
Remove session for a remote address.
| remote_address | The client's remote address |
| std::expected< void, messaging::error_code > authorize_request | ( | messaging::message_type | type, |
| const std::string & | remote_address | ||
| ) | const |
Check if a request is authorized based on message type and session.
Centralizes authorization logic for all message types:
| type | The message type being requested |
| remote_address | The client's remote address |