summaryrefslogtreecommitdiff
path: root/include/image_upload.hpp
diff options
context:
space:
mode:
authorP Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>2021-12-16 04:47:51 +0300
committerP Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>2021-12-24 13:58:23 +0300
commitb477fd4408bc0602cc86147121f03791d3f4824a (patch)
treec67956a1eea672824d6676ec6df5feba883f0c4d /include/image_upload.hpp
parentd1a648140e3cadd0ea6b0014c4d61ec880742000 (diff)
downloadbmcweb-b477fd4408bc0602cc86147121f03791d3f4824a.tar.xz
Enable encoding/decoding object paths of User Name
Any string used to form a Dbus object path needs to be encoded. This commit enables encoding the User Name before it is used as Object path and decodes the object path to get the user readable text. The encoding is essemtial while getting details of a user, deleting user and modifying properties of user as we need the object path for these actions. Decoding and getting the User name using object_path.filename() is essential to display the user name in human readable format. Tested: - Successfully created new user using POST to /redfish/v1/AccountService/Accounts with body { "UserName": "_test_6566", "Password": "openbmc123", "RoleId": "NoAccess", "Enabled": true } and it created a Dbus Object: /xyz/openbmc_project/user/_5ftest_5f6566 - GET on displayed all user names in correct human redable format. Example: The user name for /xyz/openbmc_project/user/_5ftest_5f6566 was displayed as "_test_6566" - Successfully fetched user Detais by GET to /redfish/v1/AccountService/Accounts/<UserName> - Successfully modified user details by PATCH to /redfish/v1/AccountService/Accounts/<UserName> Example body: { Enabled: false } - Successfully removed user by DELETE to /redfish/v1/AccountService/Accounts/<UserName> removed the user with given name Example: Deleting _test_6566 actually removed /xyz/openbmc_project/user/_5ftest_5f6566 object path successfully. Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Change-Id: I6e7559f7543ee504e2f8c137911f42887eb4cf16
Diffstat (limited to 'include/image_upload.hpp')
0 files changed, 0 insertions, 0 deletions