Raritan PX2/PX3 JSON-RPC API

User.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6 #include "Role.idl"
7 #include "SnmpV3.idl"
8
9 /**
10 * %User Management
11 */
12 module usermgmt {
13
14 /** SNMPv3 settings */
15 structure SnmpV3Settings {
16 boolean enabled; ///< SNMPv3 enabled
17 um.SnmpV3.SecurityLevel secLevel; ///< Security level
18 um.SnmpV3.AuthProtocol authProtocol; ///< Authentication protocol
19 boolean usePasswordAsAuthPassphrase;
20 ///< Use account password for SNMPv3 authentication
21 boolean haveAuthPassphrase; ///< Authentication passphrase present
22 string authPassphrase; ///< Authentication passphrase; cannot be read back
23 um.SnmpV3.PrivProtocol privProtocol; ///< Privacy protocol
24 boolean useAuthPassphraseAsPrivPassphrase;
25 ///< Use authentication passphrase as privacy passphrase
26 boolean havePrivPassphrase; ///< Privacy passphrase present
27 string privPassphrase; ///< Privacy passphrase; cannot be read back
28 };
29
30 /** Auxiliary user information */
31 structure AuxInfo {
32 string fullname; ///< Full name
33 string telephone; ///< Telephone number
34 string eMail; ///< Email address
35 };
36
37 /** Preferred display unit for temperature sensors */
38 enumeration TemperatureEnum {
39 DEG_C, ///< Degrees Celsius
40 DEG_F ///< Degrees Fahrenheit
41 };
42
43 /** Preferred display unit for length measurements, e.g. device altitude */
44 enumeration LengthEnum {
45 METER, ///< Meters
46 FEET ///< Feet
47 };
48
49 /** Preferred display unit for (air) pressure sensors */
50 enumeration PressureEnum {
51 PASCAL, ///< Pascal
52 PSI ///< pound-force per square inch
53 };
54
55 /** %User preferences */
56 structure Preferences {
57 TemperatureEnum temperatureUnit; ///< Display unit for temperature sensors
58 LengthEnum lengthUnit; ///< Display unit for length measurements
59 PressureEnum pressureUnit; ///< Display unit for pressure sensors
60 };
61
62 /** %User information */
63 structure UserInfo {
64 boolean enabled; ///< \c true if the account is enabled
65 boolean locked; ///< \c true if the account cannot be deleted
66 boolean blocked; ///< \c true if the account is blocked due to failed logins
67 boolean needPasswordChange; ///< \c true to force a password change on the next login
68 AuxInfo auxInfo; ///< Auxiliary user information
69 SnmpV3Settings snmpV3Settings; ///< SNMPv3 settings
70 string sshPublicKey; ///< Public key for SSH access
71 Preferences preferences; ///< %User preferences
72 vector<int> roleIds; ///< List of role ids for this account
73 };
74
75 /**
76 * %User Capabilities
77 * Describe if certain operations can be performed for user.
78 * May require according privileges.
79 */
80 structure UserCapabilities {
81 boolean canSetPassword; ///< User password is modifyable
82 boolean canSetPreferences; ///< User preferences are modifyable
83 };
84
85 /** %User interface */
86 interface User_1_0_2 {
87
88 constant int ERR_PASSWORD_UNCHANGED = 1; ///< The new password must differ from the old password
89 constant int ERR_PASSWORD_EMPTY = 2; ///< The password must not be empty
90 constant int ERR_PASSWORD_TOO_SHORT = 3; ///< The password is too short
91 constant int ERR_PASSWORD_TOO_LONG = 4; ///< The password is too long
92 constant int ERR_PASSWORD_CTRL_CHARS = 5; ///< The password must not contain control characters
93 constant int ERR_PASSWORD_NEED_LOWER = 6; ///< The password must contain at least one lower-case character
94 constant int ERR_PASSWORD_NEED_UPPER = 7; ///< The password must contain at least one upper-case character
95 constant int ERR_PASSWORD_NEED_NUMERIC = 8; ///< The password must contain at least one numeric character
96 constant int ERR_PASSWORD_NEED_SPECIAL = 9; ///< The password must contain at least one special character
97 constant int ERR_PASSWORD_IN_HISTORY = 10; ///< The password is already in the password history
98 constant int ERR_PASSWORD_TOO_SHORT_FOR_SNMP = 11; ///< The password is too short to be used as SNMPv3 passphrase
99 constant int ERR_INVALID_ARGUMENT = 12; ///< Invalid arguments
100 constant int ERR_WRONG_PASSWORD = 13; ///< The passed-in password was wrong
101 constant int ERR_SSH_PUBKEY_DATA_TOO_LARGE = 14; ///< The ssh public key data is too large.
102 constant int ERR_SSH_PUBKEY_INVALID = 15; ///< The ssh public key is invalid.
103 constant int ERR_SSH_PUBKEY_NOT_SUPPORTED = 16; ///< The ssh public key is not supported.
104 constant int ERR_SSH_RSA_PUBKEY_TOO_SHORT = 17; ///< The ssh RSA public key is too short.
105
106 /**
107 * Get user information.
108 *
109 * @return %User information
110 */
111 UserInfo getInfo();
112
113 /**
114 * Set the account password.
115 *
116 * @param password The new password
117 *
118 * @return 0 OK
119 * @return 1 The new password has to differ from old password.
120 * @return 2 The password must not be empty.
121 * @return 3 The password is too short.
122 * @return 4 The password is too long.
123 * @return 5 The password must not contain control characters.
124 * @return 6 The password has to contain at least one lower case
125 * character.
126 * @return 7 The password has to contain at least one upper case
127 * character.
128 * @return 8 The password has to contain at least one numeric
129 * character.
130 * @return 9 The password has to contain at least one printable
131 * special character.
132 * @return 10 The password already is in history.
133 * @return 11 SNMPv3 USM is activated for the user and the
134 * password shall be used as auth passphrase. For this
135 * case, the password is too short (must be at least 8
136 * characters).
137 */
138 int setAccountPassword(in string password);
139
140 /**
141 * Update user information.
142 *
143 * @param password The new password; empty to leave unchanged
144 * @param info The new user information
145 *
146 * @return 0 OK
147 * @return 1 The new password has to differ from old password.
148 * @return 3 The password is too short.
149 * @return 4 The password is too long.
150 * @return 5 The password must not contain control characters.
151 * @return 6 The password has to contain at least one lower case
152 * character.
153 * @return 7 The password has to contain at least one upper case
154 * character.
155 * @return 8 The password has to contain at least one numeric
156 * character.
157 * @return 9 The password has to contain at least one printable
158 * special character.
159 * @return 10 The password already is in history.
160 * @return 11 SNMPv3 USM is activated for the user and the
161 * password shall be used as auth passphrase. For this
162 * case, the password is too short (must be at least 8
163 * characters).
164 * @return 12 An argument is invalid or out of range
165 * @return 13 The password passed in as SNMPv3 authentication pass
166 * phrase was wrong.
167 * @return 14 The ssh public key data is too large.
168 * @return 15 The ssh public key is invalid.
169 * @return 16 The ssh public key is not supported.
170 * @return 17 The ssh RSA public key is too short.
171 */
172 int updateAccountFull(in string password, in UserInfo info);
173
174 /**
175 * Get information and a list of granted privileges for a user.
176 *
177 * @param info %User information
178 * @param privileges List of granted privileges
179 */
180 void getInfoAndPrivileges(out UserInfo info,
181 out vector<Role.Privilege> privileges);
182
183 /**
184 * Sets the user preferences.
185 *
186 * @param prefs User Preferences
187 *
188 * @return 0 OK
189 * @return ERR_INVALID_ARGUMENT An argument is invalid or out of range
190 */
191 int setPreferences(in Preferences prefs);
192
193 /**
194 * Gets the user capabilities.
195 *
196 * @return capabilities
197 */
198 UserCapabilities getCapabilities();
199 };
200
201 }
usermgmt::SnmpV3Settings::usePasswordAsAuthPassphrase
boolean usePasswordAsAuthPassphrase
Use account password for SNMPv3 authentication.
Definition: User.idl:19
usermgmt::UserCapabilities::canSetPreferences
boolean canSetPreferences
User preferences are modifyable.
Definition: User.idl:82
usermgmt::PASCAL
Pascal.
Definition: User.idl:51
usermgmt::FEET
Feet.
Definition: User.idl:46
usermgmt::UserCapabilities
User Capabilities Describe if certain operations can be performed for user.
Definition: User.idl:80
usermgmt::UserInfo::roleIds
vector< int > roleIds
List of role ids for this account.
Definition: User.idl:72
usermgmt::SnmpV3Settings::privPassphrase
string privPassphrase
Privacy passphrase; cannot be read back.
Definition: User.idl:27
usermgmt::PSI
pound-force per square inch
Definition: User.idl:52
usermgmt::METER
Meters.
Definition: User.idl:45
usermgmt::UserInfo::sshPublicKey
string sshPublicKey
Public key for SSH access.
Definition: User.idl:70
usermgmt::SnmpV3Settings::havePrivPassphrase
boolean havePrivPassphrase
Privacy passphrase present.
Definition: User.idl:26
usermgmt::UserInfo::locked
boolean locked
true if the account cannot be deleted
Definition: User.idl:65
usermgmt::DEG_C
Degrees Celsius.
Definition: User.idl:39
usermgmt::UserInfo::preferences
Preferences preferences
User preferences
Definition: User.idl:71
usermgmt::DEG_F
Degrees Fahrenheit.
Definition: User.idl:40
um::SnmpV3::PrivProtocol
PrivProtocol
SNMP v3 privacy protocol.
Definition: SnmpV3.idl:26
usermgmt::SnmpV3Settings::authPassphrase
string authPassphrase
Authentication passphrase; cannot be read back.
Definition: User.idl:22
usermgmt::Preferences::lengthUnit
LengthEnum lengthUnit
Display unit for length measurements.
Definition: User.idl:58
usermgmt::SnmpV3Settings::haveAuthPassphrase
boolean haveAuthPassphrase
Authentication passphrase present.
Definition: User.idl:21
usermgmt::TemperatureEnum
TemperatureEnum
Preferred display unit for temperature sensors.
Definition: User.idl:38
usermgmt::UserInfo
User information
Definition: User.idl:63
usermgmt::Preferences
User preferences
Definition: User.idl:56
usermgmt::UserInfo::blocked
boolean blocked
true if the account is blocked due to failed logins
Definition: User.idl:66
usermgmt::SnmpV3Settings::privProtocol
um::SnmpV3 PrivProtocol privProtocol
Privacy protocol.
Definition: User.idl:23
usermgmt::User_1_0_2
User interface
Definition: User.idl:86
usermgmt::Preferences::temperatureUnit
TemperatureEnum temperatureUnit
Display unit for temperature sensors.
Definition: User.idl:57
usermgmt::SnmpV3Settings
SNMPv3 settings.
Definition: User.idl:15
usermgmt::AuxInfo::telephone
string telephone
Telephone number.
Definition: User.idl:33
usermgmt::UserInfo::needPasswordChange
boolean needPasswordChange
true to force a password change on the next login
Definition: User.idl:67
um::SnmpV3
SNMPv3 interface.
Definition: SnmpV3.idl:10
usermgmt::SnmpV3Settings::authProtocol
um::SnmpV3 AuthProtocol authProtocol
Authentication protocol.
Definition: User.idl:18
usermgmt::PressureEnum
PressureEnum
Preferred display unit for (air) pressure sensors.
Definition: User.idl:50
usermgmt::SnmpV3Settings::enabled
boolean enabled
SNMPv3 enabled.
Definition: User.idl:16
usermgmt::UserInfo::snmpV3Settings
SnmpV3Settings snmpV3Settings
SNMPv3 settings.
Definition: User.idl:69
usermgmt::SnmpV3Settings::secLevel
um::SnmpV3 SecurityLevel secLevel
Security level.
Definition: User.idl:17
usermgmt
User Management
Definition: Role.idl:12
usermgmt::UserInfo::auxInfo
AuxInfo auxInfo
Auxiliary user information.
Definition: User.idl:68
usermgmt::AuxInfo::eMail
string eMail
Email address.
Definition: User.idl:34
usermgmt::AuxInfo::fullname
string fullname
Full name.
Definition: User.idl:32
usermgmt::SnmpV3Settings::useAuthPassphraseAsPrivPassphrase
boolean useAuthPassphraseAsPrivPassphrase
Use authentication passphrase as privacy passphrase.
Definition: User.idl:24
usermgmt::Preferences::pressureUnit
PressureEnum pressureUnit
Display unit for pressure sensors.
Definition: User.idl:59
um::SnmpV3::AuthProtocol
AuthProtocol
SNMP v3 authentication protocol.
Definition: SnmpV3.idl:20
um::SnmpV3::SecurityLevel
SecurityLevel
SNMP v3 security level.
Definition: SnmpV3.idl:13
usermgmt::LengthEnum
LengthEnum
Preferred display unit for length measurements, e.g.
Definition: User.idl:44
um
User Management.
Definition: SnmpV3.idl:7
usermgmt::AuxInfo
Auxiliary user information.
Definition: User.idl:31
usermgmt::UserInfo::enabled
boolean enabled
true if the account is enabled
Definition: User.idl:64
usermgmt::UserCapabilities::canSetPassword
boolean canSetPassword
User password is modifyable.
Definition: User.idl:81