opencomputeproject / HWMgmt-DeviceMgr-DeviceManager

Device Manager collects device data and notifications from each device, and make the data available on a predetermined output bus for consumers.
Apache License 2.0
23 stars 12 forks source link

Searching for given user in ListDeviceAccounts task does not work #11

Closed ehaligow closed 2 years ago

ehaligow commented 2 years ago

Method getUserStatus() (line: 75 in src/accountsService.go) searches Account by comparing the Account’s UserName (e.g. root), with Account Id received from Url. The method should compare UserName field in each Account, not links. Here is the AccountCollection:

{
  "@odata.context": "/redfish/v1/$metadata#ManagerAccountCollection.ManagerAccountCollection",
  "@odata.id": "/redfish/v1/AccountService/Accounts",
  "@odata.type": "#ManagerAccountCollection.ManagerAccountCollection",
  "Name": "Accounts Collection",
  "Description": "Accounts Collection",
  "Members@odata.count": 2,
  "Members": [
    {
      "@odata.id": "/redfish/v1/AccountService/Accounts/1"
    },
    {
      "@odata.id": "/redfish/v1/AccountService/Accounts/2"
    }
  ],
  "Oem": {}
}

The mentioned method searches in this collection the following URL:”/redfish/v1/AccountService/Accounts/root” for root user where “/redfish/v1/AccountService /Accounts/2” is assigned to root.