Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 1 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 2 | Provides user management functionality. As communication to this service is |
| 3 | done through authenticated & authorized session, there won't be any |
| 4 | validation for both. |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 5 | |
| 6 | methods: |
| 7 | - name: CreateUser |
| 8 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 9 | Creates a new user. If the user already exists, then it will throw an |
| 10 | error. |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 11 | parameters: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 12 | - name: UserName |
| 13 | type: string |
| 14 | description: > |
| 15 | User name which has to be created. |
| 16 | - name: GroupNames |
| 17 | type: array[string] |
| 18 | description: > |
| 19 | List of groups to which the user has to be added. |
| 20 | - name: Privilege |
| 21 | type: string |
| 22 | description: > |
| 23 | Privilege of the user to be added. |
| 24 | - name: Enabled |
| 25 | type: boolean |
| 26 | description: > |
| 27 | User enabled / disabled. |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 28 | errors: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 29 | - xyz.openbmc_project.Common.Error.InternalFailure |
| 30 | - xyz.openbmc_project.Common.Error.InsufficientPermission |
| 31 | - xyz.openbmc_project.Common.Error.InvalidArgument |
| 32 | - xyz.openbmc_project.User.Common.Error.UserNameExists |
| 33 | - xyz.openbmc_project.User.Common.Error.UserNameGroupFail |
| 34 | - xyz.openbmc_project.User.Common.Error.UserNamePrivFail |
| 35 | - xyz.openbmc_project.User.Common.Error.NoResource |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 36 | |
| 37 | - name: RenameUser |
| 38 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 39 | Rename's existing user to new one. All other properties of the user |
| 40 | will remain same. |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 41 | parameters: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 42 | - name: UserName |
| 43 | type: string |
| 44 | description: > |
| 45 | User name which has to be updated. |
| 46 | - name: NewUserName |
| 47 | type: string |
| 48 | description: > |
| 49 | New User name to which user has to be updated. |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 50 | errors: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 51 | - xyz.openbmc_project.Common.Error.InternalFailure |
| 52 | - xyz.openbmc_project.Common.Error.InsufficientPermission |
| 53 | - xyz.openbmc_project.Common.Error.InvalidArgument |
| 54 | - xyz.openbmc_project.User.Common.Error.UserNameDoesNotExist |
| 55 | - xyz.openbmc_project.User.Common.Error.UserNameExists |
| 56 | - xyz.openbmc_project.User.Common.Error.UserNameGroupFail |
| 57 | - xyz.openbmc_project.User.Common.Error.UserNamePrivFail |
| 58 | - xyz.openbmc_project.User.Common.Error.NoResource |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 59 | |
raviteja-b | ac5b656 | 2019-03-01 01:33:42 -0600 | [diff] [blame] | 60 | - name: GetUserInfo |
| 61 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 62 | Get user properites. If its local user, method returns |
raviteja-b | ac5b656 | 2019-03-01 01:33:42 -0600 | [diff] [blame] | 63 | -user privilege |
| 64 | -user groups |
| 65 | -user enabled state |
| 66 | -user locked state |
Joseph Reynolds | e375cad | 2020-04-10 17:22:06 -0500 | [diff] [blame] | 67 | -user password expired state |
raviteja-b | ac5b656 | 2019-03-01 01:33:42 -0600 | [diff] [blame] | 68 | -remote user flag |
| 69 | If its ldap user, method returns |
| 70 | -user privilege |
| 71 | -remote user flag |
| 72 | parameters: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 73 | - name: UserName |
| 74 | type: string |
| 75 | description: > |
| 76 | User name whose properties have to be returned. |
raviteja-b | ac5b656 | 2019-03-01 01:33:42 -0600 | [diff] [blame] | 77 | returns: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 78 | - name: UserInfo |
| 79 | type: dict[string,variant[string,array[string],boolean]] |
| 80 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 81 | Dictionary of user properties. List of key name and data type of |
| 82 | properties below. UserPrivilege -> privilege of the user(string) |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 83 | UserGroups -> list of groups user belongs to(array[string]) |
| 84 | UserEnabled -> user enabled state(boolean) |
| 85 | UserLockedForFailedAttempt -> user locked state(boolean) |
| 86 | UserPasswordExpired -> user password expired(boolean) |
| 87 | RemoteUser -> remote or local user(boolean) |
raviteja-b | ac5b656 | 2019-03-01 01:33:42 -0600 | [diff] [blame] | 88 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 89 | For detailed documentation of user properties refer |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 90 | Attributes.interface.yaml examples: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 91 | 1.UserInfo["RemoteUser"] returns true for ldap user |
| 92 | and false for local user. |
| 93 | 2.UserInfo["UserGroups"] gets list of groups of user. |
raviteja-b | ac5b656 | 2019-03-01 01:33:42 -0600 | [diff] [blame] | 94 | errors: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 95 | - xyz.openbmc_project.Common.Error.InternalFailure |
| 96 | - xyz.openbmc_project.Common.Error.InsufficientPermission |
| 97 | - xyz.openbmc_project.Common.Error.InvalidArgument |
| 98 | - xyz.openbmc_project.User.Common.Error.UserNameDoesNotExist |
raviteja-b | ac5b656 | 2019-03-01 01:33:42 -0600 | [diff] [blame] | 99 | |
Nan Zhou | 1a891d3 | 2022-10-24 23:51:41 +0000 | [diff] [blame] | 100 | - name: CreateGroup |
| 101 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 102 | Creates a new groups. If the group already exists, or the group name |
| 103 | is not allowed to be created, it throws an error. |
Nan Zhou | 1a891d3 | 2022-10-24 23:51:41 +0000 | [diff] [blame] | 104 | parameters: |
| 105 | - name: GroupName |
| 106 | type: string |
| 107 | description: > |
| 108 | The group to be added to the system. |
| 109 | errors: |
| 110 | - xyz.openbmc_project.Common.Error.InternalFailure |
| 111 | - xyz.openbmc_project.Common.Error.InvalidArgument |
| 112 | - xyz.openbmc_project.User.Common.Error.GroupNameExists |
| 113 | |
| 114 | - name: DeleteGroup |
| 115 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame] | 116 | Deletes an existing groups. If the group doesn't exists, or the group |
| 117 | name is not allowed to be deleted, it throws an error. |
Nan Zhou | 1a891d3 | 2022-10-24 23:51:41 +0000 | [diff] [blame] | 118 | parameters: |
| 119 | - name: GroupName |
| 120 | type: string |
| 121 | description: > |
| 122 | The group to be deleted from the system. |
| 123 | errors: |
| 124 | - xyz.openbmc_project.Common.Error.InternalFailure |
| 125 | - xyz.openbmc_project.Common.Error.InvalidArgument |
| 126 | - xyz.openbmc_project.User.Common.Error.GroupNameDoesNotExist |
| 127 | |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 128 | properties: |
| 129 | - name: AllPrivileges |
| 130 | type: array[string] |
Richard Marian Thomaiyar | 7aa705a | 2019-08-31 10:51:25 +0530 | [diff] [blame] | 131 | flags: |
| 132 | - const |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 133 | description: > |
| 134 | Lists all available user privileges in the system. |
| 135 | |
| 136 | - name: AllGroups |
| 137 | type: array[string] |
Richard Marian Thomaiyar | 7aa705a | 2019-08-31 10:51:25 +0530 | [diff] [blame] | 138 | flags: |
| 139 | - const |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 140 | description: > |
| 141 | Lists all available groups in the system. |
| 142 | |
| 143 | signals: |
| 144 | - name: UserRenamed |
| 145 | description: > |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 146 | Signal indicating user's name is updated. |
Richard Marian Thomaiyar | 05375b1 | 2018-05-24 10:33:27 +0530 | [diff] [blame] | 147 | properties: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 148 | - name: UserName |
| 149 | type: string |
| 150 | description: Name of the user which got renamed. |
| 151 | - name: NewUserName |
| 152 | type: string |
| 153 | description: New name of the user. |