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 */
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 */
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 manager interface
void closeSession(in int sessionId, in CloseReason reason)
Close a session identified by its token.
vector< HistoryEntry > getSessionHistory()
Get previous session data for the current user.
void closeCurrentSession(in CloseReason reason)
Close the current session.
vector< Session > getSessions()
Retrieve all open sessions.
Session getCurrentSession()
Retrieve current session information.
int newSession(out Session session, out string token)
Open a new session.
void touchCurrentSession(in boolean userActivity)
Reset the current session's idle timer.
CloseReason
Session close reasons
@ CLOSE_REASON_BROWSER_CLOSED
Browser window was closed.
@ CLOSE_REASON_TIMEOUT
Session timed out.
@ CLOSE_REASON_LOGOUT
Regular logout.
Session Management
Session history entry
time creationTime
Session creation timestamp (UNIX timestamp, UTC)
string remoteIp
Session IP address.
string clientType
Session client type.
Session information
string username
Name of user owning the session.
int userIdle
User idle time in seconds.
string clientType
Client type.
int timeout
Session timeout in seconds.
time creationTime
Session creation timestamp (seconds since system boot)
string remoteIp
Session IP address.
int sessionId
ID of the session.
int idle
Session idle time in seconds.