Legrand / Raritan Xerus™ JSON-RPC API for Remote Access Devices like KX4-101, KX3G2

Loading...
Searching...
No Matches
UserManager.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6#include <User.idl>
7#include <UserEvent.idl>
8
9/**
10 * %User Management
11 */
12module usermgmt {
13
14 /** %Account information */
15 structure Account {
16 string name; ///< %Account name
17 UserInfo info; ///< %User information
18 };
19
20 /* event definitions */
21 /**
22 * Base type of all account event
23 */
24 valueobject AccountEvent extends event.UserEvent {
25 string username; ///< name of user which was affected
26 };
27
28 /**
29 * This event is emitted after a new account with the
30 * provided username was added
31 */
32 valueobject AccountAdded extends AccountEvent {};
33
34 /**
35 * This event is emitted after an account has been renamed
36 */
37 valueobject AccountRenamed extends AccountEvent {
38 string newUsername; ///< new user name
39 };
40
41 /**
42 * This event is emitted after the account with
43 * the provided username has been removed
44 */
45 valueobject AccountRemoved extends AccountEvent {};
46
47 /**
48 * This event is emitted after the password for
49 * an account was changed
50 */
51 valueobject PasswordChanged extends AccountEvent {};
52
53 /**
54 * This event is emitted if the settings of an account
55 * as defined in usermgmt.UserInfo have changed
56 */
57 valueobject AccountChanged extends AccountEvent {};
58
59
60 /** %User manager interface */
61 interface UserManager {
62
63 constant int ERR_USER_DOESNT_EXIST = 1; ///< A user with the given name does not exist
64 constant int ERR_USER_NOT_DELETABLE = 2; ///< The user is not deletable
65
66 constant int ERR_USER_ALREADY_EXISTS = 1; ///< A user with the given name already exists
67 constant int ERR_MAX_USERS_REACHED = 2; ///< Maximum number of users reached
68 constant int ERR_PASSWORD_TOO_SHORT_FOR_SNMP = 3; ///< The password is too short to be used as SNMPv3 passphrase
69 constant int ERR_INVALID_VALUE = 4; ///< Invalid arguments
70 constant int ERR_PASSWORD_EMPTY = 5; ///< The password must not be empty
71 constant int ERR_PASSWORD_TOO_SHORT = 6; ///< The password is too short
72 constant int ERR_PASSWORD_TOO_LONG = 7; ///< The password is too long
73 constant int ERR_PASSWORD_CTRL_CHARS = 8; ///< The password must not contain control characters
74 constant int ERR_PASSWORD_NEED_LOWER = 9; ///< The password must contain at least one lower-case character
75 constant int ERR_PASSWORD_NEED_UPPER = 10; ///< The password must contain at least one upper-case character
76 constant int ERR_PASSWORD_NEED_NUMERIC = 11; ///< The password must contain at least one numeric character
77 constant int ERR_PASSWORD_NEED_SPECIAL = 12; ///< The password must contain at least one special character
78 constant int ERR_SSH_PUBKEY_DATA_TOO_LARGE = 14; ///< The ssh public key data is too large.
79 constant int ERR_SSH_PUBKEY_INVALID = 15; ///< The ssh public key is invalid.
80 constant int ERR_SSH_PUBKEY_NOT_SUPPORTED = 16; ///< The ssh public key is not supported.
81 constant int ERR_SSH_RSA_PUBKEY_TOO_SHORT = 17; ///< The ssh RSA public key is too short.
82 constant int ERR_USERNAME_INVALID = 18; ///< The user name contains one or more invalid character(s).
83 constant int ERR_NEW_USER_ALREADY_EXISTS = 19; ///< A user with the new (renamed) user name already exists
84
85 /**
86 * Get a list of account names available on the system.
87 *
88 * @return List of account names
89 */
90 vector<string> getAccountNames();
91
92 /**
93 * Create a new account.
94 *
95 * @param username New user name
96 * @param password New password
97 *
98 * @return 0 if OK
99 * @return 1 if a user with the given name already exists
100 * @return 2 if the maximum number of users is reached
101 * @return 3 SNMPv3 USM is activated for the user and the
102 * password shall be used as auth passphrase. For this
103 * case, the password is too short (must be at least 8
104 * characters).
105 * @return 5 The password must not be empty.
106 * @return 6 The password is too short.
107 * @return 7 The password is too long.
108 * @return 8 The password must not contain control characters.
109 * @return 9 The password has to contain at least one lower case
110 * character.
111 * @return 10 The password has to contain at least one upper case
112 * character.
113 * @return 11 The password has to contain at least one numeric
114 * character.
115 * @return 12 The password has to contain at least one printable
116 * special character.
117 * @return 18 if the user name is invalid.
118 */
119 int createAccount(in string username, in string password);
120
121 /**
122 * Rename an account.
123 *
124 * @param username Current name of user
125 * @param newUsername New name of the user
126 *
127 * @return 0 if OK
128 * @return 1 if a user with the given name does not exist
129 * @return 19 if a user with the new name already exists
130 */
131 int renameAccount(in string username, in string newUsername);
132
133 /**
134 * Deletes an account.
135 *
136 * @param username Name of user to delete
137 *
138 * @return 0 if OK
139 * @return 1 if a user with the given name does not exist
140 * @return 2 if the user cannot be deleted
141 */
142 int deleteAccount(in string username);
143
144 /**
145 * Unblocks an account.
146 *
147 * @param username Name of user to unblock
148 *
149 * @return 0 if OK
150 * @return 1 if a user with the given name does not exist
151 */
152 int unblockAccount(in string username);
153
154 /**
155 * Get information about all available user accounts.
156 *
157 * @return List of accounts
158 */
159 vector<Account> getAllAccounts();
160
161 /**
162 * Create a new account with defined settings.
163 *
164 * @param username New user name
165 * @param password New password
166 * @param info New user information
167 *
168 * @return 0 if OK
169 * @return 1 if a user with the given name already exists
170 * @return 2 if the maximum number of users is reached
171 * @return 3 SNMPv3 USM is activated for the user and the
172 * password shall be used as auth passphrase. For this
173 * case, the password is too short (must be at least 8
174 * characters).
175 * @return 4 if any value in the user info is invalid.
176 * @return 5 The password must not be empty.
177 * @return 6 The password is too short.
178 * @return 7 The password is too long.
179 * @return 8 The password must not contain control characters.
180 * @return 9 The password has to contain at least one lower case
181 * character.
182 * @return 10 The password has to contain at least one upper case
183 * character.
184 * @return 11 The password has to contain at least one numeric
185 * character.
186 * @return 12 The password has to contain at least one printable
187 * special character.
188 * @return 14 The ssh public key data is too large.
189 * @return 15 The ssh public key is invalid.
190 * @return 16 The ssh public key is not supported.
191 * @return 17 The ssh RSA public key is too short.
192 * @return 18 if the user name is invalid.
193 */
194 int createAccountFull(in string username, in string password, in UserInfo info);
195
196 /**
197 * Get a list of accounts that have a given role.
198 *
199 * @param roleName Role name
200 *
201 * @return List of accounts
202 */
203 vector<Account> getAccountsByRole(in string roleName);
204
205 /**
206 * Get default user preferences.
207 *
208 * @return Default user preferences.
209 */
210 Preferences getDefaultPreferences();
211
212 /**
213 * Set default user preferences.
214 *
215 * @param prefs Default user preferences.
216 *
217 * @return 0 if OK
218 */
219 int setDefaultPreferences(in Preferences prefs);
220 };
221
222}
usermgmt::UserManager
User manager interface
Definition UserManager.idl:61
usermgmt::UserManager::ERR_NEW_USER_ALREADY_EXISTS
constant int ERR_NEW_USER_ALREADY_EXISTS
A user with the new (renamed) user name already exists.
Definition UserManager.idl:83
usermgmt::UserManager::createAccount
int createAccount(in string username, in string password)
Create a new account.
usermgmt::UserManager::getAccountsByRole
vector< Account > getAccountsByRole(in string roleName)
Get a list of accounts that have a given role.
usermgmt::UserManager::ERR_PASSWORD_TOO_SHORT
constant int ERR_PASSWORD_TOO_SHORT
The password is too short.
Definition UserManager.idl:71
usermgmt::UserManager::ERR_USER_NOT_DELETABLE
constant int ERR_USER_NOT_DELETABLE
The user is not deletable.
Definition UserManager.idl:64
usermgmt::UserManager::ERR_SSH_RSA_PUBKEY_TOO_SHORT
constant int ERR_SSH_RSA_PUBKEY_TOO_SHORT
The ssh RSA public key is too short.
Definition UserManager.idl:81
usermgmt::UserManager::ERR_USERNAME_INVALID
constant int ERR_USERNAME_INVALID
The user name contains one or more invalid character(s).
Definition UserManager.idl:82
usermgmt::UserManager::getAllAccounts
vector< Account > getAllAccounts()
Get information about all available user accounts.
usermgmt::UserManager::ERR_SSH_PUBKEY_DATA_TOO_LARGE
constant int ERR_SSH_PUBKEY_DATA_TOO_LARGE
The ssh public key data is too large.
Definition UserManager.idl:78
usermgmt::UserManager::setDefaultPreferences
int setDefaultPreferences(in Preferences prefs)
Set default user preferences.
usermgmt::UserManager::ERR_PASSWORD_TOO_LONG
constant int ERR_PASSWORD_TOO_LONG
The password is too long.
Definition UserManager.idl:72
usermgmt::UserManager::ERR_PASSWORD_CTRL_CHARS
constant int ERR_PASSWORD_CTRL_CHARS
The password must not contain control characters.
Definition UserManager.idl:73
usermgmt::UserManager::renameAccount
int renameAccount(in string username, in string newUsername)
Rename an account.
usermgmt::UserManager::ERR_USER_ALREADY_EXISTS
constant int ERR_USER_ALREADY_EXISTS
A user with the given name already exists.
Definition UserManager.idl:66
usermgmt::UserManager::ERR_MAX_USERS_REACHED
constant int ERR_MAX_USERS_REACHED
Maximum number of users reached.
Definition UserManager.idl:67
usermgmt::UserManager::createAccountFull
int createAccountFull(in string username, in string password, in UserInfo info)
Create a new account with defined settings.
usermgmt::UserManager::getAccountNames
vector< string > getAccountNames()
Get a list of account names available on the system.
usermgmt::UserManager::ERR_PASSWORD_NEED_LOWER
constant int ERR_PASSWORD_NEED_LOWER
The password must contain at least one lower-case character.
Definition UserManager.idl:74
usermgmt::UserManager::getDefaultPreferences
Preferences getDefaultPreferences()
Get default user preferences.
usermgmt::UserManager::ERR_INVALID_VALUE
constant int ERR_INVALID_VALUE
Invalid arguments.
Definition UserManager.idl:69
usermgmt::UserManager::ERR_PASSWORD_NEED_NUMERIC
constant int ERR_PASSWORD_NEED_NUMERIC
The password must contain at least one numeric character.
Definition UserManager.idl:76
usermgmt::UserManager::ERR_PASSWORD_NEED_SPECIAL
constant int ERR_PASSWORD_NEED_SPECIAL
The password must contain at least one special character.
Definition UserManager.idl:77
usermgmt::UserManager::ERR_PASSWORD_NEED_UPPER
constant int ERR_PASSWORD_NEED_UPPER
The password must contain at least one upper-case character.
Definition UserManager.idl:75
usermgmt::UserManager::ERR_USER_DOESNT_EXIST
constant int ERR_USER_DOESNT_EXIST
A user with the given name does not exist.
Definition UserManager.idl:63
usermgmt::UserManager::ERR_PASSWORD_TOO_SHORT_FOR_SNMP
constant int ERR_PASSWORD_TOO_SHORT_FOR_SNMP
The password is too short to be used as SNMPv3 passphrase.
Definition UserManager.idl:68
usermgmt::UserManager::ERR_SSH_PUBKEY_NOT_SUPPORTED
constant int ERR_SSH_PUBKEY_NOT_SUPPORTED
The ssh public key is not supported.
Definition UserManager.idl:80
usermgmt::UserManager::ERR_PASSWORD_EMPTY
constant int ERR_PASSWORD_EMPTY
The password must not be empty.
Definition UserManager.idl:70
usermgmt::UserManager::unblockAccount
int unblockAccount(in string username)
Unblocks an account.
usermgmt::UserManager::deleteAccount
int deleteAccount(in string username)
Deletes an account.
usermgmt::UserManager::ERR_SSH_PUBKEY_INVALID
constant int ERR_SSH_PUBKEY_INVALID
The ssh public key is invalid.
Definition UserManager.idl:79
usermgmt
User Management
Definition Role.idl:12
usermgmt::AccountAdded
This event is emitted after a new account with the provided username was added.
Definition UserManager.idl:32
usermgmt::AccountChanged
This event is emitted if the settings of an account as defined in usermgmt::UserInfo have changed.
Definition UserManager.idl:57
usermgmt::AccountEvent
Base type of all account event.
Definition UserManager.idl:24
usermgmt::AccountEvent::username
string username
name of user which was affected
Definition UserManager.idl:25
usermgmt::AccountRemoved
This event is emitted after the account with the provided username has been removed.
Definition UserManager.idl:45
usermgmt::AccountRenamed
This event is emitted after an account has been renamed.
Definition UserManager.idl:37
usermgmt::AccountRenamed::newUsername
string newUsername
new user name
Definition UserManager.idl:38
usermgmt::Account
Account information
Definition UserManager.idl:15
usermgmt::Account::name
string name
Account name
Definition UserManager.idl:16
usermgmt::Account::info
UserInfo info
User information
Definition UserManager.idl:17
usermgmt::PasswordChanged
This event is emitted after the password for an account was changed.
Definition UserManager.idl:51
usermgmt::Preferences
User preferences
Definition User.idl:80
usermgmt::UserInfo
User information
Definition User.idl:87