Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

Loading...
Searching...
No Matches
SessionManager.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6/**
7 * %Session Management
8 */
9module session {
10
11 /** %Session information */
12 structure Session {
13 int sessionId; ///< ID of the session
14 string username; ///< Name of user owning the session
15 string remoteIp; ///< Session IP address
16 string clientType; ///< Client type
17 time creationTime; ///< Session creation timestamp (seconds since system boot)
18 int timeout; ///< Session timeout in seconds
19 int idle; ///< Session idle time in seconds
20 int userIdle; ///< User idle time in seconds
21 };
22
23 /** %Session history entry */
24 structure HistoryEntry {
25 time creationTime; ///< Session creation timestamp (UNIX timestamp, UTC)
26 string remoteIp; ///< Session IP address
27 string clientType; ///< Session client type
28 };
29
30 /**
31 * %Session manager interface
32 *
33 * Session manager allows clients to announce a user session,
34 * i.e. consecutive activity that is related to each other,
35 * and make use of session services.
36 * Depending on transport protocoll an established session
37 * allows simplified authentication using the session token.
38 * For instance, for HTTP transport implementation sessiontoken
39 * can be written into HTTP Header while other authentication
40 * schemes may be omitted (for details, see transport mapping
41 * documentation).
42 * Each session has a defined timeout and an idle timer.
43 * A session is deleted once idle time is equal or greater
44 * than session timeout. Idle timer is implicitely touched
45 * by transport implementation whenever a call arrives that
46 * can be mapped to a particular session. In addition a client
47 * may decide to call touchCurrentSession with userActivity flag
48 * set to true. In this case userIdle attribute of session is reset
49 * to 0. This has purely informational character and will not cause
50 * any further action of session manager. It may be used to determine
51 * user activity under the assumptions that clients may do frequent
52 * background calls without actual user activity.
53 */
54 interface SessionManager {
55
56 constant int ERR_ACTIVE_SESSION_EXCLUSIVE_FOR_USER = 1; ///< Session creation denied due to single login limitation
57
58 /** %Session close reasons */
59 enumeration CloseReason {
60 CLOSE_REASON_LOGOUT, ///< Regular logout
61 CLOSE_REASON_TIMEOUT, ///< Session timed out
62 CLOSE_REASON_BROWSER_CLOSED, ///< Browser window was closed
63 CLOSE_REASON_FORCED_DISCONNECT ///< Session was forcibly closed
64 };
65
66 /**
67 * Open a new session.
68 *
69 * This function will create a new session for the authenticated user.
70 * Upon success it will return a session token which can be used to
71 * authenticate future requests.
72 *
73 * @param session %Session information
74 * @param token Returned token for the newly created session
75 *
76 * @return 0 if OK
77 * @return 1 if session creation was denied due to single login limitation
78 */
79 int newSession(out Session session, out string token);
80
81 /**
82 * Retrieve current session information.
83 *
84 * This call must be authenticated using a session token.
85 *
86 * @return %Session information
87 */
88 Session getCurrentSession();
89
90 /**
91 * Retrieve all open sessions.
92 *
93 * @return List of sessions
94 */
95 vector<Session> getSessions();
96
97 /**
98 * Close a session identified by its token.
99 *
100 * @param sessionId ID of the session that should be closed
101 * @param reason close reason
102 */
103 void closeSession(in int sessionId, in CloseReason reason);
104
105 /**
106 * Close the current session.
107 *
108 * This call must be authenticated using a session token.
109 *
110 * @param reason close reason
111 */
112 void closeCurrentSession(in CloseReason reason);
113
114 /**
115 * Reset the current session's idle timer.
116 *
117 * @param userActivity Indicates that the session is touched
118 * due to user activity.
119 *
120 * If userActivity is not set, this is internally a NOP since
121 * any RPC call will implicitly touch the session.
122 * This call must be authenticated using a session token.
123 */
124 void touchCurrentSession(in boolean userActivity);
125
126 /**
127 * Get previous session data for the current user
128 *
129 * @return History data, sorted from newer to older sessions
130 */
131 vector<HistoryEntry> getSessionHistory();
132 };
133
134}
session::SessionManager
Session manager interface
Definition SessionManager.idl:54
session::SessionManager::closeSession
void closeSession(in int sessionId, in CloseReason reason)
Close a session identified by its token.
session::SessionManager::getSessionHistory
vector< HistoryEntry > getSessionHistory()
Get previous session data for the current user.
session::SessionManager::closeCurrentSession
void closeCurrentSession(in CloseReason reason)
Close the current session.
session::SessionManager::getSessions
vector< Session > getSessions()
Retrieve all open sessions.
session::SessionManager::ERR_ACTIVE_SESSION_EXCLUSIVE_FOR_USER
constant int ERR_ACTIVE_SESSION_EXCLUSIVE_FOR_USER
Session creation denied due to single login limitation.
Definition SessionManager.idl:56
session::SessionManager::getCurrentSession
Session getCurrentSession()
Retrieve current session information.
session::SessionManager::newSession
int newSession(out Session session, out string token)
Open a new session.
session::SessionManager::touchCurrentSession
void touchCurrentSession(in boolean userActivity)
Reset the current session's idle timer.
session::SessionManager::CloseReason
CloseReason
Session close reasons
Definition SessionManager.idl:59
session::SessionManager::CLOSE_REASON_FORCED_DISCONNECT
@ CLOSE_REASON_FORCED_DISCONNECT
Session was forcibly closed.
Definition SessionManager.idl:63
session::SessionManager::CLOSE_REASON_BROWSER_CLOSED
@ CLOSE_REASON_BROWSER_CLOSED
Browser window was closed.
Definition SessionManager.idl:62
session::SessionManager::CLOSE_REASON_TIMEOUT
@ CLOSE_REASON_TIMEOUT
Session timed out.
Definition SessionManager.idl:61
session::SessionManager::CLOSE_REASON_LOGOUT
@ CLOSE_REASON_LOGOUT
Regular logout.
Definition SessionManager.idl:60
session
Session Management
Definition SessionManager.idl:9
session::HistoryEntry
Session history entry
Definition SessionManager.idl:24
session::HistoryEntry::creationTime
time creationTime
Session creation timestamp (UNIX timestamp, UTC)
Definition SessionManager.idl:25
session::HistoryEntry::remoteIp
string remoteIp
Session IP address.
Definition SessionManager.idl:26
session::HistoryEntry::clientType
string clientType
Session client type.
Definition SessionManager.idl:27
session::Session
Session information
Definition SessionManager.idl:12
session::Session::username
string username
Name of user owning the session.
Definition SessionManager.idl:14
session::Session::userIdle
int userIdle
User idle time in seconds.
Definition SessionManager.idl:20
session::Session::clientType
string clientType
Client type.
Definition SessionManager.idl:16
session::Session::timeout
int timeout
Session timeout in seconds.
Definition SessionManager.idl:18
session::Session::creationTime
time creationTime
Session creation timestamp (seconds since system boot)
Definition SessionManager.idl:17
session::Session::remoteIp
string remoteIp
Session IP address.
Definition SessionManager.idl:15
session::Session::sessionId
int sessionId
ID of the session.
Definition SessionManager.idl:13
session::Session::idle
int idle
Session idle time in seconds.
Definition SessionManager.idl:19