History log of /openbmc/bmcweb/http/ (Results 201 – 225 of 457)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
513d1ffc18-Jul-2022 Carson Labrado <clabrado@google.com>

HTTP Client: Improve handling operation timeouts

Now that we are using timer.async_wait() with the async http
operations we need to account for the scenario where the timer fails
before the operatio

HTTP Client: Improve handling operation timeouts

Now that we are using timer.async_wait() with the async http
operations we need to account for the scenario where the timer fails
before the operation fails. When that occurs we need to abort the
operation once its callback gets called.

Currently we proceed as if the timer doesn't exist. This causes a
fault if one of the operations times out. This patch adds a check
to the start of each async operation so that we do not continue with
the normal message sending flow when an operation times out.

Tested:
In order to create a connection timeout I created a dummy interface
and set the IP of my satellite BMC to route to the interface:
ip link add dummy0 type dummy
ip link set dev dummy0 up
ip route add 120.60.30.15 dev dummy0

All packets sent to 120.60.30.15 will get dropped and thus connection
attempts will timeout. This does not cause bmcweb to crash.

To make the satellite reachable again I used
this command to delete the routing:
ip route del 120.60.31.15 dev dummy0

After doing so messages were once again able to be forwarded correctly
to the satellite.

Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: Ie8d022c2195838e383eefcd0e12ae8cfab76e3e1

show more ...

77665bda12-Oct-2022 Nan Zhou <nanzhoumails@gmail.com>

header cleanups

This commit fixed several places (but not all) where wrong include
directory is specified and prevent the clean up in the chidren changes.

Signed-off-by: Nan Zhou <nanzhoumails@gmai

header cleanups

This commit fixed several places (but not all) where wrong include
directory is specified and prevent the clean up in the chidren changes.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ibbba62e2c0cfe3583a65f1befa1b233bd3eebf19

show more ...

bb759e3a02-Aug-2022 Ed Tanous <edtanous@google.com>

Move ClientID parameter out of OEM

In 2022.2, Redfish added support for the Context parameter on the
Session Resource. This parameter has the same function that the
OemSession.ClientId field served

Move ClientID parameter out of OEM

In 2022.2, Redfish added support for the Context parameter on the
Session Resource. This parameter has the same function that the
OemSession.ClientId field served. This commit moves all the existing
ClientId code to produce Context as well.

Functionally, this has one important difference, in that Context in
Redfish is optionally provided by the user, which means we need to omit
it if not given by the user. The old implementation left it set to
empty string ("").

Because of this, a few minor interfaces need to change to use
std::optional. Existing uses of clientId are moved to using
value_or("") to keep the same behavior as before.

Tested:
curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\":
\"0penBmc\"}" https://192.168.7.2/redfish/v1/SessionService/Sessions

Returns a Session object with no Context key present

curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\":
\"0penBmc\", \"Context\": \"Foobar\"}"
https://192.168.7.2/redfish/v1/SessionService/Sessions

Returns a Session object with:
"Context": "Foobar"

Subsequent Gets of /redfish/v1/SessionService/Sessions/<sid>
return the same session objects, both with and without Context.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I4df358623f93f3e6cb659e99970ad909cefebc62

show more ...


/openbmc/bmcweb/DBUS_USAGE.md
http_connection.hpp
/openbmc/bmcweb/include/authentication.hpp
/openbmc/bmcweb/include/forward_unauthorized.hpp
/openbmc/bmcweb/include/http_utility.hpp
/openbmc/bmcweb/include/ibm/management_console_rest.hpp
/openbmc/bmcweb/include/login_routes.hpp
/openbmc/bmcweb/include/multipart_parser.hpp
/openbmc/bmcweb/include/persistent_data.hpp
/openbmc/bmcweb/include/sessions.hpp
/openbmc/bmcweb/redfish-core/include/redfish.hpp
/openbmc/bmcweb/redfish-core/include/redfish_aggregator.hpp
/openbmc/bmcweb/redfish-core/include/schemas.hpp
/openbmc/bmcweb/redfish-core/lib/account_service.hpp
/openbmc/bmcweb/redfish-core/lib/bios.hpp
/openbmc/bmcweb/redfish-core/lib/certificate_service.hpp
/openbmc/bmcweb/redfish-core/lib/ethernet.hpp
/openbmc/bmcweb/redfish-core/lib/log_services.hpp
/openbmc/bmcweb/redfish-core/lib/managers.hpp
/openbmc/bmcweb/redfish-core/lib/memory.hpp
/openbmc/bmcweb/redfish-core/lib/pcie.hpp
/openbmc/bmcweb/redfish-core/lib/processor.hpp
/openbmc/bmcweb/redfish-core/lib/redfish_sessions.hpp
/openbmc/bmcweb/redfish-core/lib/sensors.hpp
/openbmc/bmcweb/redfish-core/lib/storage.hpp
/openbmc/bmcweb/redfish-core/lib/systems.hpp
/openbmc/bmcweb/redfish-core/lib/update_service.hpp
/openbmc/bmcweb/scripts/parse_registries.py
/openbmc/bmcweb/scripts/update_schemas.py
/openbmc/bmcweb/static/redfish/v1/$metadata/index.xml
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/AccountService/AccountService.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ActionInfo/ActionInfo.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Assembly/Assembly.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/CableCollection/CableCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Certificate/Certificate.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/CertificateCollection/CertificateCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Chassis/Chassis.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ChassisCollection/ChassisCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ComputerSystem/ComputerSystem.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ComputerSystemCollection/ComputerSystemCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Drive/Drive.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/DriveCollection/DriveCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/EthernetInterface/EthernetInterface.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/EthernetInterfaceCollection/EthernetInterfaceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Event/Event.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/EventDestination/EventDestination.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/EventDestinationCollection/EventDestinationCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/EventService/EventService.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Fan/Fan.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/FanCollection/FanCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/JsonSchemaFileCollection/JsonSchemaFileCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/LogEntry/LogEntry.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/LogEntryCollection/LogEntryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/LogService/LogService.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/LogServiceCollection/LogServiceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Manager/Manager.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ManagerAccount/ManagerAccount.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ManagerAccountCollection/ManagerAccountCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ManagerCollection/ManagerCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ManagerDiagnosticData/ManagerDiagnosticData.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ManagerNetworkProtocol/ManagerNetworkProtocol.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Memory/Memory.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MemoryCollection/MemoryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MessageRegistryCollection/MessageRegistryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MessageRegistryFileCollection/MessageRegistryFileCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricDefinition/MetricDefinition.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricDefinitionCollection/MetricDefinitionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricReport/MetricReport.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricReportCollection/MetricReportCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricReportDefinition/MetricReportDefinition.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricReportDefinitionCollection/MetricReportDefinitionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/OperatingConfigCollection/OperatingConfigCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PCIeDevice/PCIeDevice.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PCIeDeviceCollection/PCIeDeviceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PCIeFunction/PCIeFunction.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PCIeFunctionCollection/PCIeFunctionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PowerSubsystem/PowerSubsystem.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PowerSupply/PowerSupply.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PowerSupplyCollection/PowerSupplyCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Processor/Processor.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ProcessorCollection/ProcessorCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Redundancy/Redundancy.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Resource/Resource.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/RoleCollection/RoleCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Sensor/Sensor.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/SensorCollection/SensorCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ServiceRoot/ServiceRoot.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Session/Session.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/SessionCollection/SessionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Settings/Settings.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/SoftwareInventory/SoftwareInventory.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/SoftwareInventoryCollection/SoftwareInventoryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Storage/Storage.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/StorageCollection/StorageCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/StorageController/StorageController.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/StorageControllerCollection/StorageControllerCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/Task/Task.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/TaskCollection/TaskCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/TriggersCollection/TriggersCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/UpdateService/UpdateService.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/VLanNetworkInterfaceCollection/VLanNetworkInterfaceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/VirtualMediaCollection/VirtualMediaCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/redfish-payload-annotations/redfish-payload-annotations.json
/openbmc/bmcweb/static/redfish/v1/schema/AccountService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ActionInfo_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Assembly_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/AttributeRegistry_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Bios_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/CableCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Cable_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/CertificateCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/CertificateLocations_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/CertificateService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Certificate_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ChassisCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Chassis_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ComputerSystemCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ComputerSystem_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/DriveCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Drive_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/EthernetInterfaceCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/EthernetInterface_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/EventDestinationCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/EventDestination_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/EventService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Event_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/FanCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Fan_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/IPAddresses_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/JsonSchemaFileCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/JsonSchemaFile_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/LogEntryCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/LogEntry_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/LogServiceCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/LogService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ManagerAccountCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ManagerAccount_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ManagerCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ManagerDiagnosticData_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ManagerNetworkProtocol_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Manager_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MemoryCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Memory_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MessageRegistryCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MessageRegistryFileCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MessageRegistryFile_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MessageRegistry_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Message_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MetricDefinitionCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MetricDefinition_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MetricReportCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MetricReportDefinitionCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MetricReportDefinition_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/MetricReport_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/OperatingConfigCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/OperatingConfig_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PCIeDeviceCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PCIeDevice_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PCIeFunctionCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PCIeFunction_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PCIeSlots_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PhysicalContext_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PowerSubsystem_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PowerSupplyCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/PowerSupply_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Power_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Privileges_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ProcessorCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Processor_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/RedfishError_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/RedfishExtensions_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Redundancy_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Resource_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/RoleCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Role_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/SensorCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Sensor_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ServiceRoot_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/SessionCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/SessionService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Session_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Settings_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/SoftwareInventoryCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/SoftwareInventory_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/StorageCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/StorageControllerCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/StorageController_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Storage_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/TaskCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/TaskService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Task_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/TelemetryService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/ThermalSubsystem_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Thermal_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/TriggersCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/Triggers_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/UpdateService_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/VLanNetworkInterfaceCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/VLanNetworkInterface_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/VirtualMediaCollection_v1.xml
/openbmc/bmcweb/static/redfish/v1/schema/VirtualMedia_v1.xml
/openbmc/bmcweb/test/include/http_utility_test.cpp
/openbmc/bmcweb/test/include/multipart_test.cpp
c33a039b10-Sep-2022 Nan Zhou <nanzhoumails@gmail.com>

treewide: reorganize unit tests

Like other C++ projects, unit tests normally are in a separate repo and
respect the folder structure of the file under test.

This commit deleted all "ut" folder and

treewide: reorganize unit tests

Like other C++ projects, unit tests normally are in a separate repo and
respect the folder structure of the file under test.

This commit deleted all "ut" folder and move tests to a "test" folder.
The test folder also has similar structure as the main folder.

This commit also made neccessary include changes to make codes compile.
Unused tests are untouched.

Tested: unit test passed.

Reference:
[1] https://github.com/grpc/grpc/tree/master/test
[2] https://github.com/boostorg/core/tree/414dfb466878af427d33b36e6ccf84d21c0e081b/test
[3] Many other OpenBMC repos: https://github.com/openbmc/entity-manager/tree/master/test
[4] https://stackoverflow.com/questions/2360734/whats-a-good-directory-structure-for-larger-c-projects-using-makefile

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I4521c7ef5fa03c47cca5c146d322bbb51365ee96

show more ...


/openbmc/bmcweb/meson.build
/openbmc/bmcweb/redfish-core/include/registries/base_message_registry.hpp
/openbmc/bmcweb/redfish-core/include/registries/openbmc_message_registry.hpp
/openbmc/bmcweb/redfish-core/include/registries/privilege_registry.hpp
/openbmc/bmcweb/redfish-core/include/registries/resource_event_message_registry.hpp
/openbmc/bmcweb/redfish-core/include/registries/task_event_message_registry.hpp
/openbmc/bmcweb/redfish-core/lib/log_services.hpp
/openbmc/bmcweb/scripts/parse_registries.py
/openbmc/bmcweb/test/http/crow_getroutes_test.cpp
/openbmc/bmcweb/test/http/router_test.cpp
/openbmc/bmcweb/test/http/utility_test.cpp
/openbmc/bmcweb/test/include/dbus_utility_test.cpp
/openbmc/bmcweb/test/include/google/google_service_root_test.cpp
/openbmc/bmcweb/test/include/http_utility_test.cpp
/openbmc/bmcweb/test/include/human_sort_test.cpp
/openbmc/bmcweb/test/include/ibm/configfile_test.cpp
/openbmc/bmcweb/test/include/ibm/lock_test.cpp
/openbmc/bmcweb/test/include/multipart_test.cpp
/openbmc/bmcweb/test/include/openbmc_dbus_rest_test.cpp
/openbmc/bmcweb/test/redfish-core/include/privileges_test.cpp
/openbmc/bmcweb/test/redfish-core/include/registries_test.cpp
/openbmc/bmcweb/test/redfish-core/include/utils/hex_utils_test.cpp
/openbmc/bmcweb/test/redfish-core/include/utils/ip_utils_test.cpp
/openbmc/bmcweb/test/redfish-core/include/utils/json_utils_test.cpp
/openbmc/bmcweb/test/redfish-core/include/utils/query_param_test.cpp
/openbmc/bmcweb/test/redfish-core/include/utils/stl_utils_test.cpp
/openbmc/bmcweb/test/redfish-core/include/utils/time_utils_test.cpp
/openbmc/bmcweb/test/redfish-core/lib/chassis_test.cpp
/openbmc/bmcweb/test/redfish-core/lib/log_services_dump_test.cpp
/openbmc/bmcweb/test/redfish-core/lib/service_root_test.cpp
/openbmc/bmcweb/test/redfish-core/lib/thermal_subsystem_test.cpp
3590bd1d12-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

query: propogate errors for expand

The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subquer

query: propogate errors for expand

The existing code doesn't propogate errors of subqueries correctly.
This commit corrects the behavior, so that the final response gets all
error message of subqueries and the "highest priority" HTTP code.

DMTF doesn't specify how expand queries handle error codes, since using
subqueries is an implementation choice that we made in this project.

What we did here follows existing behavior of this project, and follows
the error message section of the Redfish spec;
[1] https://redfish.dmtf.org/schemas/DSP0266_1.15.1.html#error-responses

As for now, this commit uses the worst HTTP code among all the error
code. See query_param.hpp, function |propogateErrorCode| for detailed
order of the errror codes.

Tested:
1. this is difficult to test, but I hijacked the code so it returns
errors in TaskServices, then I verified that "/redfish/v1?$expand=."
correctly returns 500 and the gets the error message set.
2. unit test so that when there are multiple errors, the final response
gets a generate error message.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I0c1ebdd9015f389801db9150d687027485f1203c

show more ...

06fe275013-Sep-2022 Ed Tanous <edtanous@google.com>

Make Accepts: */* default to JSON

There are apparently libraries that use an Accepts header of */*,
instead of simply omitting the Accepts header, or providing a more
correct value for that header.

Make Accepts: */* default to JSON

There are apparently libraries that use an Accepts header of */*,
instead of simply omitting the Accepts header, or providing a more
correct value for that header.

99351cd856038475cac146029e5db03767a1459c Improve content type

The above commit attempted to refine our handling of this header, and
changed the behavior for */* to default to HTML. While this is arguably
"correct" to the HTTP RFC, and the clients that do this are definitely
wrong in their implementation, we can try to shield them a little from
their incorrectness, and we can certainly avoid compatibility issues
with these clients, without effecting the clients that implement the
spec correctly.

This commit changes the priority order of Accepts header to JSON then
HTML, instead of the other way around.

Tested:
curl --insecure -H "Accept: */*" --user root:0penBmc \
https://192.168.7.2/redfish/v1

Now returns a json payload.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I7850a3afb0b5d635f8d632fb0a9f790e53fe4466

show more ...

99351cd807-Aug-2022 Ed Tanous <edtanous@google.com>

Improve content type

We have a number of specialized content-type functions for varying
levels of degree, and most of them rely on quite a few strings. This
commit changes them to consolidate on tw

Improve content type

We have a number of specialized content-type functions for varying
levels of degree, and most of them rely on quite a few strings. This
commit changes them to consolidate on two APIs.

isContentTypeSupported, which as the name implies, takes a single
content type, and returns a bool about whether or not that content type
is allowed.

getPreferedContentType, which takes an array of multiple options, and
fine the first one in the list that matches the clients expected string.

These two functions makes these functions more able to be reused in the
future, and don't require specialized entries for each possible type or
combination of types that we need to check for.

Tested: Unit tests passing. Pretty good coverage.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8b976d0cefec5f24e62fbbfae33d12cc803cb373

show more ...

3d36e3a519-Aug-2022 Ed Tanous <edtanous@google.com>

ConnectionInfo move to bind_front

There's a few last calls that are inline lambdas. As we've been moving
away from inline lambdas due to the problems with debug logging and
usability, this file is

ConnectionInfo move to bind_front

There's a few last calls that are inline lambdas. As we've been moving
away from inline lambdas due to the problems with debug logging and
usability, this file is the next cleanup.

Tested:

Ran Redfish-Event-Listener, and set an event into /var/log/redfish with
```
echo "2022-08-04T21:37:49.156798+00:00 OpenBMC.0.1.ServiceFailure,com.intel.DomainMapper.service" > /var/log/redfish
```

Simulating a crash. Saw the event get sent to Redfish-Event-Listener.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I61361eef03d1301dc126a28c695fdd74e504f891

show more ...


http_client.hpp
/openbmc/bmcweb/include/dbus_monitor.hpp
/openbmc/bmcweb/include/google/google_service_root.hpp
/openbmc/bmcweb/include/ibm/locks.hpp
/openbmc/bmcweb/include/ibm/management_console_rest.hpp
/openbmc/bmcweb/include/openbmc_dbus_rest.hpp
/openbmc/bmcweb/redfish-core/include/error_messages.hpp
/openbmc/bmcweb/redfish-core/include/event_service_manager.hpp
/openbmc/bmcweb/redfish-core/include/registries.hpp
/openbmc/bmcweb/redfish-core/include/utils/ip_utils.hpp
/openbmc/bmcweb/redfish-core/include/utils/json_utils.hpp
/openbmc/bmcweb/redfish-core/include/utils/query_param.hpp
/openbmc/bmcweb/redfish-core/include/utils/query_param_test.cpp
/openbmc/bmcweb/redfish-core/include/utils/sw_utils.hpp
/openbmc/bmcweb/redfish-core/lib/account_service.hpp
/openbmc/bmcweb/redfish-core/lib/cable.hpp
/openbmc/bmcweb/redfish-core/lib/certificate_service.hpp
/openbmc/bmcweb/redfish-core/lib/chassis.hpp
/openbmc/bmcweb/redfish-core/lib/ethernet.hpp
/openbmc/bmcweb/redfish-core/lib/event_service.hpp
/openbmc/bmcweb/redfish-core/lib/hypervisor_system.hpp
/openbmc/bmcweb/redfish-core/lib/log_services.hpp
/openbmc/bmcweb/redfish-core/lib/managers.hpp
/openbmc/bmcweb/redfish-core/lib/memory.hpp
/openbmc/bmcweb/redfish-core/lib/message_registries.hpp
/openbmc/bmcweb/redfish-core/lib/metric_report.hpp
/openbmc/bmcweb/redfish-core/lib/metric_report_definition.hpp
/openbmc/bmcweb/redfish-core/lib/pcie.hpp
/openbmc/bmcweb/redfish-core/lib/pcie_slots.hpp
/openbmc/bmcweb/redfish-core/lib/power.hpp
/openbmc/bmcweb/redfish-core/lib/redfish_v1.hpp
/openbmc/bmcweb/redfish-core/lib/sensors.hpp
/openbmc/bmcweb/redfish-core/lib/service_root.hpp
/openbmc/bmcweb/redfish-core/lib/storage.hpp
/openbmc/bmcweb/redfish-core/lib/systems.hpp
/openbmc/bmcweb/redfish-core/lib/task.hpp
/openbmc/bmcweb/redfish-core/lib/telemetry_service.hpp
/openbmc/bmcweb/redfish-core/lib/trigger.hpp
/openbmc/bmcweb/redfish-core/lib/update_service.hpp
/openbmc/bmcweb/redfish-core/lib/ut/service_root_test.cpp
/openbmc/bmcweb/redfish-core/lib/virtual_media.hpp
/openbmc/bmcweb/redfish-core/src/error_messages.cpp
759cf10531-Jul-2022 Ed Tanous <edtanous@google.com>

Add Method Not Allowed (405) handler

Similar to the 404 handler, add a 405 handler for registering custom 405
handlers for a given tree. The primary use case is for protocols like
redfish that supp

Add Method Not Allowed (405) handler

Similar to the 404 handler, add a 405 handler for registering custom 405
handlers for a given tree. The primary use case is for protocols like
redfish that support specific messages for 405 handlers that don't have
an empty body.

Tested: Unit tests pass.

PATCH /redfish/v1 returns 405 Method Not Allowed
POST /redfish/v1/Chassis returns 405 Method Not Allowed
POST /redfish/v1/Chassis/foo returns 405 Method Not Allowed
PATCH /redfish/v1/foo/bar returns 404 Not Found
GET /redfish/v1 returns ServiceRoot
GET /redfish/v1/Chassis returns Chassis collection

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib0afd23d46bb5b88f89cf1e3f4e0606a48ae47ca
Signed-off-by: Carson Labrado <clabrado@google.com>

show more ...

44e4518b26-Jul-2022 Ed Tanous <edtanous@google.com>

Allow custom 404 handlers

Different HTTP protocols have different http responses for 404. This
commit adds support for registering a route designed to host a handler
meant for when a response would

Allow custom 404 handlers

Different HTTP protocols have different http responses for 404. This
commit adds support for registering a route designed to host a handler
meant for when a response would otherwise return. This allows
registering a custom 404 handler for Redfish, for which all routes will
now return a Redfish response.

This was in response to the 404 handler not working in all cases (in the
case of POST/PATCH/DELETE). Allowing an explicit registration helps to
give the intended behavior in all cases.

Tested:
GET /redfish/v1/foo returns 404 Not found
PATCH /redfish/v1/foo returns 404 Not found

GET /redfish/v1 returns 200 OK, and content
PATCH /redfish/v1 returns 405 Method Not Allowed

With Redfish Aggregation:
GET /redfish/v1/foo gets forwarded to satellite BMC
PATCH /redfish/v1/foo does not get forwarded and returns 404
PATCH /redfish/v1/foo/5B247A_bar gets forwarded

Unit tests pass

Redfish-service-validator passes

Redfish-Protocol-Validator fails 7 tests (same as before)

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I731a5b4e736a2480700d8f3e81f9c9c6cbe6efca
Signed-off-by: Carson Labrado <clabrado@google.com>

show more ...

0d5f5cf412-Mar-2022 Ed Tanous <edtanous@google.com>

Remove tcp_stream

tcp_stream has several problems in its current implementation. First,
it takes up a significant amount of binary size, for features that we
don't use. Next, it has some implied g

Remove tcp_stream

tcp_stream has several problems in its current implementation. First,
it takes up a significant amount of binary size, for features that we
don't use. Next, it has some implied guarantees about timeouts that we
erronously rely on, namely that async_connect will timeout
appropriately given the tcp_stream timeout (it doesn't).

We already have a timer present in the ConnectionInfo class anyway, this
commit just makes use of it for ALL timeout operations, rather than just
the connect timeout operations. This flow is roughly analogous to what
we do in http_connection.hpp already, so the pattern is well troden.

This saves 2.8% of the binary size of bmcweb, and solves several race
conditions.


Tested:
Relying on Carson: Aggregated a sub-bmc, and ensured that top level
collections returned correctly under GET /redfish/v1/Chassis

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I72e8e97b667826f272bb4921afc2b16907f3b271

show more ...

e38778a527-Jun-2022 AppaRao Puli <apparao.puli@intel.com>

Add SSL support for http_client (EventService)

This commit adds the initial SSL support for http_client which can be
used for sending asynchronous Events/MetricReports to subscribed Event
Listener s

Add SSL support for http_client (EventService)

This commit adds the initial SSL support for http_client which can be
used for sending asynchronous Events/MetricReports to subscribed Event
Listener servers over secure channel.

Current implementation of http client only works for http protocol.
With current implementation, http client can be configured to work
with secure http (HTTPS). As part of implementation it adds the SSL
handshake mechanism and enforces the peer ceritificate verification.

The http-client uses the cipher suites which are supported by mozilla
browser and as recommended by OWASP. For better security enforcement
its disables the SSLv2, SSLv3, TLSv1, TLSv1.1 as described in below
OWASP cheetsheet.

It is validated with RootCA certificate(PEM) for now. Adding support
for different certificates can be looked in future as need arises.

[1]: https://cheatsheetseries.owasp.org/cheatsheets/TLS_Cipher_String_Cheat_Sheet.html

Tested:
- Created new subscription with SSL destination(https) and confirmed
that events are seen on EventListener side.
URI: /redfish/v1/EventService/Subscriptions
Method: POST
Body:
{
"Context": "CustomText",
"Destination": "https://<IP>:4000/service/collector/event_logs",
"EventFormatType": "Event",
"DeliveryRetryPolicy": "RetryForever",
"Protocol": "Redfish"
}

- Unit tested the non-SSL connection by disabling the check in code
(Note: EventService blocks all Non-SSL destinations). Verified that
all events are properly shown on EventListener.
URI: /redfish/v1/EventService/Subscriptions
Method: POST
Body:
{
"Context": "CustomText",
"Destination": "http://<IP>:4001/service/collector/event_logs",
"EventFormatType": "Event",
"Protocol": "Redfish"
}

- Combined above two tests and verified both SSL & Non-SSL work fine in
congention.

- Created subscription with different URI paths on same IP, Port and
protocol and verified that events sent as expected.

Change-Id: I13b2fc942c9ce6c55cd7348aae1e088a3f3d7fd9
Signed-off-by: AppaRao Puli <apparao.puli@intel.com>
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...

4c30e22624-Jun-2022 Carson Labrado <clabrado@google.com>

Redfish Aggregation: Aggregate Collections

Adds aggregation support for resource collections that take the form
of "/redfish/v1/<resource collection>". Collection URIs are
identified by the precens

Redfish Aggregation: Aggregate Collections

Adds aggregation support for resource collections that take the form
of "/redfish/v1/<resource collection>". Collection URIs are
identified by the precense of a "Members" array in the response.

Resources from satellite BMCs are added to the "Members" array of
the response and the "Members@odata.count" value is updated to
denote the new array size.

These satellite resource URIs that are added also include the
prefix associated with that satellite.

Note that as a first step this patch assumes a single satellite BMC.
There are some potential race conditions that could occur for setups
with multiple satellite BMCs. This has been commented in the code
and is better left to its own patch.

Tested:
Queried various collection URIs and the aggregated resources
appeared in the response's "Members" array.

Querying 'localhost:80/redfish/v1/Chassis?$expand=.($levels=1)'
resulted in $expand correctly returning the outputs from querying
the URIs of all local and satellite Chassis resources. This would
have failed if the satellite Chassis resources were omitted from the
"Members" array or the satellite's prefix was not correctly added to
the URI.

Also queried a collection URI that only existed on the satellite BMC.
The AsyncResp was completely overwritten by the response from the
satellite BMC.

Queries to non-collection URIs resulted in no attempts to add
satellite responses to the AsyncResp.

Signed-off-by: Carson Labrado <clabrado@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I3b379cd57e5a121eb4a344d88fc8e43170ca78a6

show more ...

1c0bb5c617-May-2022 Carson Labrado <clabrado@google.com>

Redfish Aggregation: Fixup aggregated URIs

URIs in the responses returned with Redfish Aggregation enabled will
potentially be incorrect since ones from satellite BMCs will not
include the associate

Redfish Aggregation: Fixup aggregated URIs

URIs in the responses returned with Redfish Aggregation enabled will
potentially be incorrect since ones from satellite BMCs will not
include the associated prefix such as "5B247A_" in the resource ID
portion of the URIs.

This patch fixes those links so that they include their BMC's
associated prefix. Note that a future patch will be needed to add
prefixes to aggregated resources that would appear under collection
URIs such as "/redfish/v1/Chassis".

Tested:
Requests were sent to URIs associated with the aggregating BMC and a
satellite BMC denoted as "5B247A". The URIs in the responses
were successfully updated such that "5B247A_" was added for
satellite resources.

Signed-off-by: Carson Labrado <clabrado@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib4f976fab1ca1e8603f7cf55292732ffb71cd03e

show more ...

46a8146527-Apr-2022 Carson Labrado <clabrado@google.com>

Redfish Aggregation: Router to satellite resources

Adds ability to route requests to either native resources or
resources that belong to a satellite BMC as part of Redfish
Aggregation. A prefix in

Redfish Aggregation: Router to satellite resources

Adds ability to route requests to either native resources or
resources that belong to a satellite BMC as part of Redfish
Aggregation. A prefix in the URI denotes if the resource is actually
from a satellite BMC. Prefixes are only used to denote satellite
resources. The URI of resources on the local/aggregating BMC will
remain unchanged.

Prefixes are separated from the resource ID by an underscore. This
means that underscores cannot be used in the prefix name itself.
The prefixes used by satellite BMCs are revealed via D-Bus as well as
the config information needed to connect to that BMC.

Requests for satellite resources will not be handled locally.

Care should be taken to not name any local resources in a way that
could cause a collision (e.g. having a Chassis object named
"aggregated0_1U" on the aggregating BMC).

The patch only covers routing requests. Requests to collection URIs
like /redfish/v1/Chassis will only return resources on the local BMC.
A future patch will cover adding satellite resources to collections.

Also note that URIs returned in the responses will not have the proper
prefix included. Fixing these URIs will be addressed in future
patches.

A number of TODO comments are included in the code to indicate that
this functionality (collections and URI fixup) still needs to be
implemented.

Example URIs w/o Redfish Aggregation:
/redfish/v1/Chassis/1U/
/redfish/v1/Systems/system/
/redfish/v1/Managers/bmc/

Example URIs after enabling Redfish Aggregation if the associated
resources are located on the local/aggregating BMC:
/redfish/v1/Chassis/1U/
/redfish/v1/Systems/system/
/redfish/v1/Managers/bmc/

Example URIs if resources are instead located on a satellite BMC
named "aggregated0":
/redfish/v1/Chassis/aggregated0_1U/
/redfish/v1/Systems/aggregated0_system/
/redfish/v1/Managers/aggregated0_bmc/

Tested:
I was able to query supported resources located on the local BMC
as well as on a satellite BMC. Requests with unknown prefixes return
a 404. Requests to resource collections only return the resources
that are located on the aggregating BMC.

Signed-off-by: Carson Labrado <clabrado@google.com>
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I87a3deb730bda95e72ecd3144ea40b0e5ee7d491

show more ...

7f8d8fa919-Aug-2022 Ed Tanous <edtanous@google.com>

Allow parsing urls with extra elements

Sometimes it is desirable to only parse a portion of a URL, and allow
any elements at the end. This comes up significantly in aggregation
where parsing "/redf

Allow parsing urls with extra elements

Sometimes it is desirable to only parse a portion of a URL, and allow
any elements at the end. This comes up significantly in aggregation
where parsing "/redfish/v1/<collection>/anything is pretty common.

This commit adds a new class, OrMorePaths, that can be used as a
placeholder to indicate that more paths should be accepted.

Tested: Unit tests pass.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If4fb3991a91560fd3b8b838f912aa36e79ddd2b3

show more ...

17dcc31228-Jul-2022 Carson Labrado <clabrado@google.com>

HTTP Client: Further increase httpReadBodyLimit

A continuation of 4d94272fe54c147974f86788092bbbdd950406aa,
increases the size of httpReadBodyLimit to 2^17 bytes (about 128 KB).
This is because with

HTTP Client: Further increase httpReadBodyLimit

A continuation of 4d94272fe54c147974f86788092bbbdd950406aa,
increases the size of httpReadBodyLimit to 2^17 bytes (about 128 KB).
This is because with Redfish Aggregation we need to be able to handle
larger response sizes such as json schema files. The ComputerSystem
schema in particular is over 120 KB.

Going forward we will not be able to keep increasing the limit.
We need a better solution for handling larger response that are
larger than httpReadBodyLimit.

Tested:
Used https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310/68 to
successfully retrieve
/redfish/v1/JsonSchemas/ComputerSystem/ComputerSystem.json from a
satellite BMC.

Signed-off-by: Carson Labrado <clabrado@google.com>
Change-Id: Ida80b8fddbd1df1310d18a77ecfb44b7fdf292ef

show more ...

2b82937e03-Aug-2022 Ed Tanous <edtanous@google.com>

Move time utils to be in one place

We've accumulated several time utility functions in the http classes.
Time isn't a core HTTP primitive, so http is not where those functions
below.

This commit mo

Move time utils to be in one place

We've accumulated several time utility functions in the http classes.
Time isn't a core HTTP primitive, so http is not where those functions
below.

This commit moves all the time functions from the crow::utility
namespace into the redfish::time_utils namespace, as well as moves the
unit tests.

No code changes where made to the individual functions, with the
exception of changing the namespace on the unit tests.

Tested: Unit tests pass.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8493375f60aea31899c84ae703e0f71a17dbdb73

show more ...

2c98676d23-Jul-2022 Ed Tanous <edtanous@google.com>

Support micro and milli resolution on timestamps

Supporting higher precision on our timestamps seems worthwhile, and
useful to logging implementations for getting more accurate numbers from
redfish

Support micro and milli resolution on timestamps

Supporting higher precision on our timestamps seems worthwhile, and
useful to logging implementations for getting more accurate numbers from
redfish LogService interfaces.

This commit updates the code to add millisecond and microsecond
precision to timestamps.

Tested: Unit tests pass, pretty good coverage here.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I0914908966702a6cf1bcb59f22761dc24c46b4c3

show more ...

ac6250ae09-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

routing: fix some comments

Found these when I went through the code path of authx.

Tested: comment only changes.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Id80725f4bf5f3972e97534

routing: fix some comments

Found these when I went through the code path of authx.

Tested: comment only changes.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Id80725f4bf5f3972e975347dcac8598e2ffab332

show more ...

d9f6c62117-Mar-2022 Ed Tanous <edtanous@google.com>

Use enum overload for field setting

There are two overloads of addHeader, one that takes a string, and one
that takes a boost enum. For most common headers, boost contains a
string table with all o

Use enum overload for field setting

There are two overloads of addHeader, one that takes a string, and one
that takes a boost enum. For most common headers, boost contains a
string table with all of those entries anyway, so there's no point in
duplicating the strings, and ensures that we don't make trivial
mistakes, like capitalization or - versus underscore that aren't caught
at compile time.

Tested:
This saves a trivial amount (572 bytes) of compressed binary size.

curl --insecure -vvv --user root:0penBmc https://192.168.7.2/redfish/v1

returns < Content-Type: application/json

curl --insecure -vvv -H "Accept: text/html" --user root:0penBmc https://192.168.7.2/redfish/v1

Returns
< Content-Type: text/html;charset=UTF-8

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I34c198b4f9e219247fcfe719f9b3616d35aea3dc

show more ...

9896eaed23-Jul-2022 Ed Tanous <edtanous@google.com>

Drop boost::posix_time

Per the coding standard, if we can support what we need to do with
std variants of something, we should prefer that. This commit adds an
iso8160 to string method that support

Drop boost::posix_time

Per the coding standard, if we can support what we need to do with
std variants of something, we should prefer that. This commit adds an
iso8160 to string method that supports any arbitrary
std::chrono::duration object, which allows doing the full range of all
of our integer types, and reduces the complexity (and presumably compile
times) not pulling in a complex library.

Despite the heavy templating, this only appears to add 108 bytes of
compressed binary size to bmcweb. This is likely due to the decreased
complexity compared to the boost variant (that likely pulls in
boost::locale). (Ie 3 template instantiations of the simple one take
about the same binary space as 1 complex instantiation).

Tested:
Unit tests pass (pretty good coverage here)

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I78200fb391b601eba8d2bfd2de0dd868e4390d6b

show more ...

13548d8522-Jul-2022 Ed Tanous <edtanous@google.com>

Preserve headers from the root object on expand

There is a bug where, when running an expand query, headers from the
response object get dropped. These headers include OData.type, and the
newly min

Preserve headers from the root object on expand

There is a bug where, when running an expand query, headers from the
response object get dropped. These headers include OData.type, and the
newly minted Link header, as well as possible others.

This was actually noted in a TODO, although the author of the TODO,
didn't fully understand the consequences at the time, and thought there
was no functional impact.

To resolve this, this commit resolves the TODO, and allows the Response
object to be moved out, instead of having to create a new one, which
preserves all the response state. To do this, it creates a move
constructor on the Response object for this use. The move constructor
is relatively benign, with one caveat, that we might be moving while in
a completion handler (as is the most common use). So both the existing
operator= and Response() move constructor are amended to handle this
case, and simply null out the response object in the copied object,
which would be correct behavior, given that each callback handler should
only be called once per Response object.

Tested:
curl --insecure --user root:0penBmc -vvvv
https://192.168.7.2/redfish/v1\?\$expand\=\*\(\$levels\=2\)

returns the same body as previously, now with the included:
OData-Version: 4.0
Allow: Get

headers in the response.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I221364dd4304903b37cacb1386f621b073a0a891

show more ...

f610caae17-Mar-2022 Ed Tanous <edtanous@google.com>

Remove jsonMode method

The jsonMode method is a single line, that basically only sets the
content type, and is only called from one place. In all other cases we
set the content-type directly from a

Remove jsonMode method

The jsonMode method is a single line, that basically only sets the
content type, and is only called from one place. In all other cases we
set the content-type directly from a header, so we should do the same
here.

Tested:
curl --insecure -vvv --user root:0penBmc https://192.168.7.2/redfish/v1

returns < Content-Type: application/json

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I82f6fcf1b574192620ac7b29f97cdd01334c18c4

show more ...

d9049df102-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

app: fix -Wpessimizing-move

clang14 doesn't compile because of
"moving a temporary object prevents copy elision".

This also alligns the plaintext socket with style of SSL socket.

Tested: trivial c

app: fix -Wpessimizing-move

clang14 doesn't compile because of
"moving a temporary object prevents copy elision".

This also alligns the plaintext socket with style of SSL socket.

Tested: trivial change. It builds.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I9203cf162d738290306f9ba73ec0ab8f2ca5033c

show more ...


/openbmc/bmcweb/Redfish.md
app.hpp
/openbmc/bmcweb/meson.build
/openbmc/bmcweb/redfish-core/include/event_service_manager.hpp
/openbmc/bmcweb/redfish-core/include/redfish.hpp
/openbmc/bmcweb/redfish-core/include/registries.hpp
/openbmc/bmcweb/redfish-core/include/registries/openbmc_message_registry.hpp
/openbmc/bmcweb/redfish-core/include/schemas.hpp
/openbmc/bmcweb/redfish-core/include/utils/query_param.hpp
/openbmc/bmcweb/redfish-core/include/utils/query_param_test.cpp
/openbmc/bmcweb/redfish-core/lib/account_service.hpp
/openbmc/bmcweb/redfish-core/lib/chassis.hpp
/openbmc/bmcweb/redfish-core/lib/redfish_sessions.hpp
/openbmc/bmcweb/redfish-core/lib/thermal_subsystem.hpp
/openbmc/bmcweb/redfish-core/lib/ut/thermal_subsystem_test.cpp
/openbmc/bmcweb/redfish-core/ut/registries_test.cpp
/openbmc/bmcweb/scripts/update_schemas.py
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/CableCollection/CableCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/CertificateCollection/CertificateCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ChassisCollection/ChassisCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ComputerSystemCollection/ComputerSystemCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/DriveCollection/DriveCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/EthernetInterfaceCollection/EthernetInterfaceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/EventDestinationCollection/EventDestinationCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/JsonSchemaFileCollection/JsonSchemaFileCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/LogEntryCollection/LogEntryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/LogServiceCollection/LogServiceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ManagerAccountCollection/ManagerAccountCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ManagerCollection/ManagerCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MemoryCollection/MemoryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MessageRegistryCollection/MessageRegistryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MessageRegistryFileCollection/MessageRegistryFileCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricDefinitionCollection/MetricDefinitionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricReportCollection/MetricReportCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/MetricReportDefinitionCollection/MetricReportDefinitionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/OperatingConfigCollection/OperatingConfigCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PCIeDeviceCollection/PCIeDeviceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/PCIeFunctionCollection/PCIeFunctionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/ProcessorCollection/ProcessorCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/RoleCollection/RoleCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/SensorCollection/SensorCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/SessionCollection/SessionCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/SoftwareInventoryCollection/SoftwareInventoryCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/StorageCollection/StorageCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/StorageControllerCollection/StorageControllerCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/TaskCollection/TaskCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/TriggersCollection/TriggersCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/VLanNetworkInterfaceCollection/VLanNetworkInterfaceCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/VirtualMediaCollection/VirtualMediaCollection.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/odata-v4/odata-v4.json
/openbmc/bmcweb/static/redfish/v1/JsonSchemas/redfish-schema-v1/redfish-schema-v1.json

12345678910>>...19