summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-08-11VirtualMedia fixes for Redfish Service ValidatorPrzemyslaw Czarnowski3-32/+12
Removes all warnings and errors for VirtualMedia - rework for OemVirtualMedia - minor adjustments for jsons Tested: Redfish Service Validator ran with no errors and/or warnings Change-Id: Ic027166153a807a8bd3a6c04f042969f16e0dc6a Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2020-08-08Redfish: Support for DownloadLog ActionAsmitha Karunanithi2-5/+37
Supports offloading a dump to the client Tested-By: * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Managers/bmc/LogServices/ Dump/attachment/<dump-id> * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/LogServices/ Dump/attachment/<dump-id> Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I99bbb50bc171408273744f89220a46bfe64ba4c4
2020-08-07Deallocate memory during failed caseAppaRao Puli1-0/+1
Free memory during failed case inside pamFunctionConversation() function. Tested: - Pam authentication works as normal. Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: I81c06a3d674b0806c96e5847cda6f208795bd02c
2020-08-07Manager: Support for switching running imageGunnar Mills1-1/+136
ActiveSoftwareImage was added to Manager in v1_6_0. It is a Readwrite property. This supports only switching the BMC running image. This assumes the BMC updater is xyz.openbmc_project.Software.BMC.Updater. This assumes the switch is Immediate and calls a BMC reboot after setting the priority to 0. Patch set 1 had a new Redfish.Settings for the Manager at /redfish/v1/Managers/bmc/Settings and a new setting, ActiveSoftwareImageApplyTime. This was removed due to complexity. A future commit could add support to allow this Setting to be exposed and PATCHed. From https://redfish.dmtf.org/schemas/v1/Manager.v1_9_0.json "ActiveSoftwareImage": { ... "description": "The link to the software inventory resource that represents the active firmware image for this manager.", "longDescription": "This property shall contain a link to a resource of type SoftwareInventory that represents the active firmware image for this manager.", "readonly": false, "versionAdded": "v1_6_0" Tested: Validator passes curl -k -X PATCH -d \ '{ "Links": { "ActiveSoftwareImage": { "@odata.id":"/redfish/v1/UpdateService/FirmwareInventory/82d3ec86"}}}' \ https://$bmc/redfish/v1/Managers/bmc { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_0_0.Message", "Message": "Successfully Completed Request", Change-Id: Id9d29af5332f9e76ec172e1e4351980a6772477c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-08-06DIMM: Add support for more propertiesJames Feist1-9/+391
This pulls more information from the dimm interface, and the persistent memory interface. Tested: Ran validator, verified interfaces were there Change-Id: I1083c78d6ab758fb94e4f145c7c5aff3a43b1683 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-08-06DIMM: Add support for RegionsJames Feist1-8/+99
Regions come from the new partition interface. Tested: Validator passed. Saw new properties. Change-Id: Ifbfddc69187ab1612d759d12165f0c3fdfda5dca Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-08-06Fix: EventService stops sending eventsAppaRao Puli1-4/+8
When redfish log file(/var/log/redfish) is recreated by rsyslog daemon, EventService stops sending events to subscribers. The rsyslog service take redfish log files to back up as per design. EventService has inotify on redfish log file modifications. It needs to be removed from inotify watcher list and added with new File descriptor. Corrected code to handle remove & add of new descriptor. Also corrected code to properly handle last event timestamp. Tested: - Ran stress test on redfish log file to create multiple backup files and events sends to clients properly, in all switching scenarios. Change-Id: Ic0378edfc2cae86d1f69f6df4c429d07c2744bdf Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-08-06Fix: MetricReportDefinitions filter not workingAppaRao Puli2-8/+28
The metric reports are not sending when user configures the MetricReportDefinitions filter. This is of odata json object type. Corrected code to properly handle odata type object and store it as string array to make filters faster. Tested: - Created metric report EventService subscription type with MetricReportDefinitions and events properly sent to Event listener. Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> Change-Id: If96564219da7d38a2ee5e415b89824ba25cd686d
2020-08-05Handling Broadcast message serviceAsmitha Karunanithi2-4/+52
This commit implements the broadcast of the messages from one connected client to other connected clients via BMC. When the management console creates a subscription on the BMC, they will be provided with the broadcast message service. Tested by: (Used https://github.com/DMTF/Redfish-Event-Listener) 1. Create a subscription POST -D headers.txt https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination":"https://<host:port>","Protocol":"Redfish"}' 2. Send the message POST https://${bmc}/ibm/v1/HMC/BroadcastService -d '{"Message":"<msg>"}' 3. Verify the event is generated and posted to the subscriber: bodydata: {"Message":"<The message from HMC to be forwarded>", "Name":"Broadcast Event","OriginOfCondition": "/ibm/v1/HMC/BroadcastService", "Timestamp":"2020-07-15T12:03:30+00:00"} Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: Ib36b4f25505cf66251adc5aeda282312996c25af
2020-08-05EventService : Send event for ConfigFile updationAsmitha Karunanithi1-6/+24
The commit implements the sending of push style events to the IBM's management client when a configFile is updated. Tested-By: 1. Create a subscription by passing "ResourceTypes" as ["IBMConfigFile"] POST -D headers.txt https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination" : "https://<host:port>,"ResourceTypes":["IBMConfigFile"],"Protocol":"Redfish"}' 2. Update an existing ConfigFile PUT https://${bmc}/ibm/v1/Host/ConfigFiles/<filename> --data-binary "@<local_path>" 3. Verify the event is generated and posted to the subscriber as the following example: bodydata: { "@odata.type":"#Event.v1_4_0.Event", "Events":[ { "EventId":1, "EventTimestamp":"2020-06-26T08:40:04+00:00", "EventType":"ResourceChanged", "MemberId":0, "Message" :"One or more resource properties have changed.", "MessageArgs":null, "MessageId":"ResourceEvent.1.0.3.ResourceChanged", "OriginOfCondition":"/ibm/v1/Host/ConfigFiles/<filename>", "MessageSeverity":"OK" } ], "Id":1, "Name":"Event Log" } 4. Verified the event is sent to the subscriber when the resourceType list is empty. 5. Verified the client subscribes for other resource - not ConfigFile ; then the event is not sent to the subscriber. Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I785c2a5a6e4e721cf722e94693db3a832f69fa50
2020-08-04Remove QueryStringJames Feist7-441/+45
QueryString is an error-prone library that was leftover from crow. Replace it with boost::url, a header only library based and written by the one of the authors of boost beast. Tested: Verified logging paging still worked as expected Change-Id: I47c225089aa7d0f7d2299142f91806294f879381 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-08-04Minor changes in the code to use the appropriate errorsAsmitha Karunanithi1-15/+8
This commit contains changes that replaces the error messages in the response's body with the appropriate one. This change was made based on the comment in the following commit: https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/32033/35/ redfish-core/lib/log_services.hpp#501 Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I56a63f1cde27776b86d588695ce9505bf38d7f38
2020-08-04Removing getTimestampStr methodAsmitha Karunanithi1-28/+6
The method 'getTimestampStr' is not used elsewhere in the code, hence it is removed and replaced by 'crow::utility::getDateTime' method. Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I094fe8ca741bf36755a722e72fadd14ed8df7287
2020-08-04EventService : Send event for the ConfigFile creationSunitha Harish2-3/+77
This implements the sendEvent when the IBM management console creates the ConfigFile at BMC using the PUT operation on the url /ibm/v1/Host/ConfigFiles Tested by: (Used https://github.com/DMTF/Redfish-Event-Listener) 1. Create a subscription by passing "ResourceTypes" as ["IBMConfigFile"] POST -D headers.txt https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination" : "https://<host:port>,"ResourceTypes":["IBMConfigFile"],"Protocol":"Redfish"}' 2. Create a ConfigFile PUT https://${bmc}/ibm/v1/Host/ConfigFiles/<filename> --data-binary "@<local_path>" 3. Verify the event is generated and posted to the subscriber as below example bodydata: { "@odata.type":"#Event.v1_4_0.Event", "Events":[ { "EventId":1, "EventTimestamp":"2020-06-26T08:40:04+00:00", "EventType":"ResourceAdded", "MemberId":0, "Message":"The resource has been created successfully.", "MessageArgs":null, "MessageId":"ResourceEvent.1.0.3.ResourceCreated", "OriginOfCondition":"/ibm/v1/Host/ConfigFiles/<filename>", "MessageSeverity":"OK" } ], "Id":1, "Name":"Event Log" } 4. Verified the event is sent to the subscriber when the resourceType list is empty. 5. Verified the client subscribes for other resource - not ConfigFile ; then the event is not sent to the subscriber. Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Ic9b195266fe2df67a3160197d03d9ac155ef0cd1
2020-08-04Redfish: PATCH command for Hypervisor DHCP networkSunitha Harish1-40/+144
This commit adds support to set the DHCP configuration on the Hypervisor's Ethernet Interface Tested By: Configure the DHCPEnabled parameter and check the value is set. 1. curl -k -H "X-Auth-Token: $bmc_token" -X PATCH -d '{"DHCPv4": {"DHCPEnabled": true}}' https://${bmc}/redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 2. curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Ie1ac5659ef6af0f29cd91bda96574424a86fd095
2020-08-03Add message registry entry for successful fw update stagingChalapathi Venkataramashetty1-1/+11
Add an event log in redfish when fw completed writing to staging area during firmware update. Tested: Update BMC firmware POST: https://<BMC_IP>/redfish/v1/UpdateService/ with <BMC_Update_Capsule> binary file After BMC reboots with successful update check for Event log in Redfish Command: GET: https://<BMC_IP>/redfish/v1/Systems/system/LogServices/ EventLog/Entries Response: { "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/ Entries/1595803968", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2020-07-26T22:52:48+00:00", "EntryType": "Event", "Id": "1595803968", "Message": "BMC firmware update to version 00.74 staged successfully.", "MessageArgs": [ "BMC", "00.74" ], "MessageId": "OpenBMC.0.1.FirmwareUpdateStaged", "Name": "System Event Log Entry", "Severity": "OK" }, Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> Change-Id: I62aad007c7fc8d311a351d1c5ec4e84d6b4a77ad
2020-08-03Swap strcpy for strncpyEd Tanous1-1/+1
strncpy has range checks, which reduce the possibility of overrunning the buffer in the case of a bug. Tested: clang-tidy cert check now passes. Needs functional testing. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I2fab19ca40f97cc0574146883ee19b573285a59c
2020-08-03Remove using constructor for filesystemEd Tanous1-13/+12
We use std::filesystem now, so use that directly instead of having the using at the top of the file. Tested: Code compiles. No functional change. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iab977f08a2a61dcc9f2c82c705e5bcc55304e81a
2020-08-03Redfish: GET command for Hypervisor DHCP networkSunitha Harish2-35/+90
This commit adds support to GET the DHCP configuration details on the Hypervisor's Ethernet Interface Tested by: Set the DHCPEnabled property on /xyz/openbmc_project/network/hypervisor/eth0 Run the redfish GET command below to check the value set. GET https://${bmc}/redfish/v1/Systems/hypervisor/EthernetInterfaces/eth0 Successfully ran the Redfish Validator Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Iacfc2b975fc6e4b759082419aa8f0b9c193d7787
2020-08-01Add ability to build via dockerAdam Stankiewicz4-0/+49
Change-Id: I241d260209090dc4a01a96449657b270649d6643 Signed-off-by: Adam Stankiewicz <sheerun@sher.pl>
2020-07-31Revert "Add out of bounds check in base64Decode"James Feist1-28/+6
This reverts commit afd77a536ce84c934f56eae4f69d831fbd238d9a. Reason for revert: Broke basic auth Change-Id: I6510a3f8e1df95daba68b8124e2825c05e923b15 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-07-31Fix for missing "Functional" property in dbus for GV cardsAlpana Kumari1-18/+13
Handle the case if "Functional" and/or "Present" properties are not sent by the host Test: Tested on a witherspoon which has all 6 GV cards attached. alpana07> curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/Processors/gv100card0 { "@odata.context": "/redfish/v1/$metadata#Processor.Processor", "@odata.id": "/redfish/v1/Systems/system/Processors/gv100card0", "@odata.type": "#Processor.v1_3_1.Processor", "Id": "gv100card0", "Name": "Processor", "ProcessorType": "Accelerator", "Status": { "Health": "OK", "State": "Enabled" } } "State" --> Enabled, interprets "Present" --> true "Health"--> OK, interprets either "Functional" not present OR present&true. Change-Id: If967623d1c85f837195c88c2b3704f326d371c13 Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
2020-07-31EventService: Add the parameter ResourceTypes to subscriptionSunitha Harish3-5/+37
This commit supports sending the ResourceTypes list while subscribing to the events. The "Task" resource is added as a supported type to receive the task life cycle events. For IBM's management console along with the Task resource, the support is provided to subscribe to the "IBMConfigFile" ResourceType to receive events while creating/updating the ConfigFiles. Tested by: 1. GET https://${bmc}/redfish/v1/EventService 2. Create subscription : POST https://${bmc}/redfish/v1/EventService/Subscriptions -d '{"Destination" : <>, "Protocol":"Redfish", "ResourceTypes": ["Task"]}' 3. GET https://${bmc}/redfish/v1/EventService/Subscriptions/<id> 3. Redfish validator was run successfully Signed-off-by: Sunitha Harish <sunharis@in.ibm.com> Change-Id: Ibaf3f4f5f005a1beedf0a1cd049ae11d93a3af36
2020-07-31Add out of bounds check in base64DecodeZhikui Ren1-6/+28
Use size_t type and check for out of bounds when index into static const decodingData. Tested: Build with change and BMC web run as before. Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> Change-Id: Ib891d36f79f80b579423b40da493ae6749db5a54
2020-07-30EventService: Add ResourceEvent registriesSunitha Harish4-1/+371
This commit adds new files for DMTF resource registry and corresponding json message definitions. Tested by: 1. GET https://${bmc}/redfish/v1/Registries 2. GET https://${bmc}/redfish/v1/Registries/ResourceEvent 3. GET https://${bmc}/redfish/v1/Registries/ResourceEvent/ResourceEvent 4. Redfish Validator passed ( giving out messages as == Severity: The given property is deprecated by revision: This property has been deprecated in favor of MessageSeverity, which ties the values to the enumerations defined for the Health property within Status.) Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Iacbedaeca85c0dcfc955bcf9b10973c0d47c98e0
2020-07-29Fix MTLS AuthJames Feist2-36/+46
MTLS Auth was not in the authenticate header, making it authenticate too late now (in handle) as we now authenticate before reading the headers. Move it to the authenticate header. Tested: MTLS in Chrome and via scripting allowed GETs on resources Change-Id: Ia765efd5c588b497de010605b474f6bb886a9dd1 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-07-28Redfish: Support for ClearLog ActionAsmitha Karunanithi2-28/+61
Clears the BMC dump entry collection Tested-By: * curl -k -H "X-Auth-Token: $bmc_token" -X POST https://${bmc}/redfish/v1/Managers/bmc/LogServices/ Dump/Actions/LogService.ClearLog * curl -k -H "X-Auth-Token: $bmc_token" -X POST https://${bmc}/redfish/v1/Systems/system/LogServices/ Dump/Actions/LogService.ClearLog Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: Iffe9b62d52bc28ccbeae3efdb34d30b2b750ab2c
2020-07-28Redfish: Creation of a BMC dumpAsmitha Karunanithi2-1/+189
This commit supports creation of a BMC dump entry. After initiation of the dump creation, a task is created that listens to "InterfaceAdded" signal over "/xyz/openbmc_project/dump" path. Once the task is completed, it returns the created BMC dump entry ID, as a part of the task's message args as well as in the task's http header. Tested-By: * curl -k -H "X-Auth-Token: $bmc_token" -X POST https://${bmc}/redfish/v1/Managers/bmc/LogServices/ Dump/Actions/Oem/OemLogService.CollectDiagnosticData -d '{"DiagnosticDataType" : "Managers", "OEMDiagnosticDataType": ""}' * curl -k -H "X-Auth-Token: $bmc_token" -X POST https://${bmc}/redfish/v1/Systems/system/LogServices/ Dump/Actions/Oem/OemLogService.CollectDiagnosticData -d '{"DiagnosticDataType" : "OEM", "OEMDiagnosticDataType": "System"}' <Returns a Task> * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/TaskService/Tasks/<task-id> <Returns Dump ID on completion> Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: Ide44b6abda797d738851123f06696558bab05ce0
2020-07-28Redfish: BMC dump logEntry service implementationAsmitha Karunanithi3-231/+475
This commit supports adding a BMC dump entry under /redfish/ v1/Managers/bmc/LogServices/Dump * Removed the option for enabling each dump separately. Instead introduced one common option to enable dump. * Defined few methods that are common for both BMC and System dumps. * Compilation flag DBMCWEB_ENABLE_REDFISH_DUMP_LOG must be enabled. Tested-By: * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/ redfish/v1/Managers/bmc/LogServices/ * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/ redfish/v1/Managers/bmc/LogServices/Dump * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/ redfish/v1/Managers/bmc/LogServices/Dump/Entries * curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/ redfish/v1/Managers/bmc/LogServices/Dump/Entries/<dump-id> * curl -k -H "X-Auth-Token: $bmc_token" -X DELETE https://${bmc}/ redfish/v1/Managers/bmc/LogServices/Dump/Entries/<dump-id> Redfish Validator passed. Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: Iac9daa8242154e249fad66609b837cf7d2b16091
2020-07-28Redfish: Minor changes in the Oem schemas for dumpAsmitha Karunanithi4-6/+60
In this commit, CollectDiagnisticData action in OemLogService schema is updated with two parameters. It also includes dereferencing the unused namespace in metadata xml file. Tested-By: Redfish Validator - Passed Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Change-Id: I093ddaef9fa786767b2853e235571a4664ee759c
2020-07-24Firmware: Add ActiveSoftwareImage for the running imageGunnar Mills4-31/+71
ActiveSoftwareImage was added to Bios in v1_1_0 and Manager in v1_6_0. What Redfish calls active is the functional or running image in OpenBMC. Reused getActiveFwVersion which means less D-Bus calls when calling from Manager. From https://redfish.dmtf.org/schemas/v1/Manager.v1_9_0.json "ActiveSoftwareImage": { ... "description": "The link to the software inventory resource that represents the active firmware image for this manager.", "longDescription": "This property shall contain a link to a resource of type SoftwareInventory that represents the active firmware image for this manager.", "readonly": false, "versionAdded": "v1_6_0" PATCH support will come later. Tested: Validator passes Manager: ... "FirmwareVersion": "2.9.0-dev-515-g92efac612-dirty", ... "Links": { "ActiveSoftwareImage": { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/82d3ec86" }, "ManagerForChassis": [ { "@odata.id": "/redfish/v1/Chassis/chassis" } ], ... System: "BiosVersion": "IBM-witherspoon-OP9-v2.3-rc2-3.28", Bios: "ActiveSoftwareImage": { "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9f75c5ad" } }, Change-Id: Ia3583b4cb513bf36942a9dcbc4588615275bb2ad Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-24Add back reset body limitGunnar Mills1-0/+2
This fixes a problem we are seeing in CI. Was removed in 3909dc82a003893812f598434d6c4558107afa28. Change-Id: If50b5fcf4e6106bf82be5c410fabe8211c9dec72 Tested: Code update via CI works. Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-23EventService: Add nullptr check to avoid crashAppaRao Puli1-2/+8
Subscribing for events using SSE subscription type is crashing the bmcweb. Add nullptr check around the connection object which is created for 'Push Style Events', to avoid the crash in case of SSE. Tested: - SSE subscription works fine and crash goes way. - 'Push style event' works fine. Change-Id: I8ad5b63ca5a82d7ffe41054eee5f4ab6dcb9d72f Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-23Add 'reason' message to websocket close methodWludzik, Jozef2-130/+129
Now websocket client receives a proper reason from a server. Removed filling asyncResp from onopen() method from nbdproxy.h because it was redundant. Websocket does not response to client using asyncResp. Removed close from NbdProxyServer destructor because it is always called in onclose() method. Tested: - Mounted and unmounted virtual media using proxy mode few times as administrator with success. - Mounted virtual media using proxy mode as operator and receives proper reason on client side. - Verify if errors are received properly on client side when mounting operation fails. Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com> Change-Id: If3b1cc9782de71a0975416872bc2fe8e3824148a
2020-07-23Add SerialNumber and Model for cpu node in redfishZhikui Ren1-3/+55
If CPUInfo interface is available, populate SerialNumber and Model for processor/cpu. Tested: Verfied /redfish/v1/Systems/system/Processors/cpu0 { "@odata.id": "/redfish/v1/Systems/system/Processors/cpu0", "@odata.type": "#Processor.v1_7_0.Processor", "Id": "cpu0", "MaxSpeedMHz": 4000, "Model": "QQQQ", "Name": "Central Processor", "ProcessorType": "CPU", "SerialNumber": "6122cca2e8a2d5c", ... Redfish Validator passed together with this patch https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/31294/ Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> Change-Id: I0e14d414e06c40062239a0673d2c55e706cc1b30
2020-07-22Add read in progress check to timerJames Feist1-3/+13
Add it back so that slow connections can upload images. Tested: Firmware update still works. Change-Id: Ib674252b68297ad473de038069962e9c3202b486 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-07-21Add ResetActionInfo for ResetTypeAppaRao Puli4-5/+150
OCP mandate the ResetActionInfo for convey the parameter requirements and allowable values on parameters for actions. So add ResetActionInfo uri for below URI's. /redfish/v1/Systems/system/ResetActionInfo /redfish/v1/Managers/bmc/ResetActionInfo /redfish/v1/Chassis/<id>/ResetActionInfo Tested: - All action uri's show correct @Redfish.ActionInfo "Actions": { "#ComputerSystem.Reset": { "@Redfish.ActionInfo": "/redfish/v1/Systems/system/ResetActionInfo", "target": "/redfish/v1/Systems/system/Actions/ComputerSystem.Reset" } } - All /ResetActionInfo uri's show correct allowable values. { "@odata.id": "/redfish/v1/Systems/system/ResetActionInfo", "@odata.type": "#ActionInfo.v1_1_2.ActionInfo", "Id": "ResetActionInfo", "Name": "Reset Action Info", "Parameters": { "AllowableValues": [ "On", "ForceOff", "ForceOn", "ForceRestart", "GracefulRestart", "GracefulShutdown", "PowerCycle", "Nmi" ], "DataType": "String", "Name": "ResetType", "Required": true } } - Ran redfish validator and its successful. Change-Id: I656163dde300d97fe1923f1d58fa6d104c702d27 Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
2020-07-20CancelDeadlineTimer after doWriteJames Feist1-0/+2
After doWrite we are no longer in a context where the user can keep the connection open. Cancel the timer. Tested: On a slow connection, still get responses Change-Id: I75a5bb32ccaaae173bb37fe9717b3e63e85c7131 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-07-17Make default PUT handling return 403 for unpriviledged userAdrian Ambrożewicz1-0/+25
Default implementation for GET, POST, PATCH and DELETE returns 403 if user does not have right to perform action on a resource. Access right was verified even if method was not implemented (which is good). PUT was lacking this behavior, and returned 405 (method not allowed) for unpriviledged user if it was not supported by resource. This change makes PUT method behaving the same way as the other in this scenario, making behavior of all basic REST methods consistent. Testing: - verified that calling PUT for unpriviledged user on resource, that doesn't implement it, returns 403 instead of 405 Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com> Change-Id: I91ffb88755093b2d5d19f073407df6ede026d720
2020-07-16Deprecate the "" operator, and isEqPEd Tanous11-122/+107
While a cool example of how to do string matching in constexpr space, the set of verbs available to HTTP has been fixed for a very long time. This was ported over to beast a while back, but we kept the API for.... mediocre reasons of backward compatibility. Remove that, and delete the now unused code. Tested: Built and loaded on a Witherspoon. Validator passes. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iaf048e196f9b6e71983189877203bf80390df286 Signed-off-by: James Feist <james.feist@linux.intel.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-16Rework Authorization flowJames Feist11-316/+394
Currently we parse the whole message before authenticating, allowing an attacker the ability to upload a large image, or keep a connection open for the max amount of time easier than it should be. This moves the authentication to the earliest point possible, and restricts unauthenticated users timeouts and max upload sizes. It also makes it so that unauthenticated users cannot keep the connection alive forever by refusing to close the connection. Tested: - login/logout - firmware update - large POST when unauthenticated - timeouts when unauthenticated - slowhttptest Change-Id: Ifa02d8db04eac1821e8950eb85e71634a9e6d265 Signed-off-by: James Feist <james.feist@linux.intel.com>
2020-07-13Move registries to v1_4_0.MessageRegistryGunnar Mills6-44/+520
This implements the MessageSeverity property which tools and users should use instead of the deprecated Severity property. Since the registries use common infrastructure, easiest if just bumped together and now allows grabbing the latest when implementing a new registry, e.g. ResourceEvent. Implement this new required property, MessageSeverity, in the openbmc registry. Follow Redfish registries in having both MessageSeverity and Severity. Modified parse_registries.py to look at latest Base and TaskEvent registries and ran parse_registries.py. Tested: Built and validator passes. See new registries: curl -k https://$bmc/redfish/v1/Registries/Base { "@odata.id": "/redfish/v1/Registries/Base", "@odata.type": "#MessageRegistryFile.v1_1_0.MessageRegistryFile", "Description": "DMTF Base Message Registry File Location", "Id": "Base", "Languages": [ "en" ], "Languages@odata.count": 1, "Location": [ { "Language": "en", "PublicationUri": "https://redfish.dmtf.org/registries/Base.1.8.1.json", "Uri": "/redfish/v1/Registries/Base/Base" } ], ... curl -k https://$bmc/redfish/v1/Registries/Base/Base { "@Redfish.Copyright": "Copyright 2014-2020 DMTF. All rights reserved.", "@odata.type": "#MessageRegistry.v1_4_0.MessageRegistry", "Description": "This registry defines the base messages for Redfish", "Id": "Base.1.8.1", "Language": "en", "Messages": { "AccessDenied": { "Description": "Indicates that while attempting to access, connect to or transfer to/from another resource, the service denied access.", "Message": "While attempting to establish a connection to %1, the service denied access.", "MessageSeverity": "Critical", "NumberOfArgs": 1, "ParamTypes": [ "string" ], "Resolution": "Attempt to ensure that the URI is correct and that the service has the appropriate credentials.", " ... Change-Id: I6495af0e02036ea527036d942d6b6b5f55178bb2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-10Server Name: Rename iBMC to bmcwebGunnar Mills1-1/+1
Before: iBMC server is running, local endpoint [::]:443 Tested: None. Change-Id: I69eae1b34ac2070e7fcbea2d15e21c9a00112c6f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-10parse_registries.py: Move to clang-format-10Gunnar Mills1-1/+1
Moving to clang-format-10 causes no changes to the registry files. Tested: Ran parse_registries.py Change-Id: Iac80c5ca784a08eecc206ed302b33b2d96caa7f6 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-10Codespell spelling fixesGunnar Mills12-41/+41
These spelling errors were found using https://github.com/codespell-project/codespell Tested: Built and ran against validator. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Change-Id: I214fe102550295578cfdf0fc58305897d261ce55
2020-07-10Codespell redfish-core spelling fixesGunnar Mills12-19/+19
These spelling errors were found using https://github.com/codespell-project/codespell Tested: Top commit (along with this) was built and ran against validator. Change-Id: Ic9dce27b1de8567eedf7753164ef564d3aedf8ca Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-10Spelling: 's/Coefficent/Coefficient/gGunnar Mills2-32/+32
Tested: Top commit (along with this) was built and ran against validator. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Change-Id: Ie5af15941250b795215cee87e757e56cce26c46e
2020-07-10Spelling: 's/Occured/Occurred/g'Gunnar Mills2-11/+13
Change-Id: Iafbd209fe2cb4503df995536587d8a80bd887a74 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2020-07-10Spelling: 's/Traslates/Translates/g'Gunnar Mills1-3/+3
Tested: Top commit (along with this) was built and ran against validator. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Change-Id: I1ae238769e7907b44cce8eae0ab5fe4d6faf88f6
2020-07-10Spelling: 's/Resposne/Response/g'Gunnar Mills1-3/+3
Tested: Top commit (along with this) was built and ran against validator. Change-Id: I294783208b5016732fde56467ed5629dd5352a3d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>