summaryrefslogtreecommitdiffstats
path: root/redfish-core/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix response error code for error - UnauthorizedSunitha Harish2019-12-061-1/+1
| | | | | | | | | | | | | Tested by: Request: Creating session with wrong credential. curl --insecure -X POST -D headers.txt https://${BMC_IP}/redfish/v1/SessionService/Sessions -d '{"UserName":"root", "Password":"penBmc"}' Resonse Error code: HTTP/1.1 401 Unauthorized Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I9c7b0af644f1e3d987b4f76e4206bbb276aba035
* Add "Retry-After" header for temporarily unavailable messagesJason M. Bills2019-12-021-0/+1
| | | | | | | | | | | | | Whenever the Redfish response is that a service is temporarily unavailable, the "Retry-After" header is added with the same value, so just set the header automatically with the response. Tested: Confirmed that the "Retry-After" header is set correctly with the Redfish temporarily unavailable message. Change-Id: I9c940be94d9d284b9633c5caa2ce71ade76d22d5 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Make references to crow less obviousEd Tanous2019-10-181-1/+1
| | | | | | | | | | | | | | | | | Recently, a number of people in the community have made the (admittedly easy) mistake that we use a significant portion of crow. Today, we use crow for the router, and the "app" structure, and even those have been significantly modified to meet the bmc needs. All other components have been replaced with Boost beast. This commit removes the crow mentions from the Readme, and moves the crow folder to "http" to camouflage it a little. No code content has changed. Tested: Code compiles. No functional change made to any executable code. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iceb57b26306cc8bdcfc77f3874246338864fd118
* Remove a lame clang-format offEd Tanous2019-09-181-6/+2
| | | | | | | | | | Code was tabbed into the wrong spot as a result of shutting clang-format off for a dubious reason. Turn it back on. Tested: It builds. Only whitespace changes present Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I08b294ca5ea076f8cb5680b801b507127e091824
* Fix variable name case style for CI warningJason M. Bills2019-06-281-10/+10
| | | | | | | | CI gives a warning for invalid case style in variable names. This fixes the warnings that show up so far. Change-Id: I2a8706d3283bdc685dc026391de715accea7b86e Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Don't set result to success when calling successJames Feist2019-03-011-1/+2
| | | | | | | | | | | res.success is the default, if one async call sets failure, and another later sets success, we don't want to overwrite the failure with sucess. Tested-by: still got success on good patch Change-Id: Iee76892f7517d508ed98929d9ecd127dd83b1329 Signed-off-by: James Feist <james.feist@linux.intel.com>
* Add MessageArgs for Redfish messages from the Base registryJason M. Bills2018-11-191-0/+58
| | | | | | | | | | | | | | | Per the Redfish API Specification, the MessageArgs array of strings is required when using a MessageId for a parameterized message. This change adds the MessageArgs array for the Redfish messages that we use from the Base message registry. Tested: Manually set various error types and confirmed that the MessageArg array was properly displayed. Change-Id: I2248128f8290305ba3466ef2ce57447ce970a57d Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Simplify Redfish error message property interfaceJason M. Bills2018-11-151-226/+30
| | | | | | | | | | | | | | | The error message code used a json_pointer object which must begin with a '/' character and had to be sent as an extra parameter. This change simplifies the interface by using a string so there doesn't have to be a '/'. This allowed the same property argument passed for the message to be used for the property field path. Tested: Sent an error with a property and verified that it is correctly displayed. Change-Id: I0571e2eee627cedf29d751588a4f1bceee66f084 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Update Redfish to Base.1.4.0 message registryJason M. Bills2018-10-311-68/+135
| | | | | | | | Update the Redfish error_messages from Base.1.2.0 to Base.1.4.0 from the Redfish standard registries. Change-Id: I771b119372fd995bd1dc4065830485b6a848f086 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Update formatting of error string literals and message descriptionsJason M. Bills2018-10-311-178/+122
| | | | | | | | | | | | clang-format doesn't automatically merge multi-line string literals, so this change updates the formatting to merge some multi-line strings into fewer lines. This change also corrects the <argx> numbering in the error message descriptions to match the function parameter numbers. Change-Id: Ibedcaf5793a607acacdb3bc83081599ba508c989 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Improve the Redfish error reporting interfaceJason M. Bills2018-10-222-1075/+993
| | | | | | | | | | | Makes the Redfish error reporting interface automatically handle setting the http status and JSON content in the response object. When using an AsyncResp object, this allows for simply calling the Redfish error and returning. Change-Id: Icfdce2de763225f070e8dd61e591f296703f46bb Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
* Implement a new way of unpacking json to structsEd Tanous2018-10-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing way of decoding json structures, while fast has some disadvantages. 1. it's very verbose to write. 2. It requires in depth knowlege of redfish error messages to get correct. 3. It _can_ lead to undesired behavior, like half of a patch being applied, if only some of the values have bad types. This commit implements a new interface for decoding redfish json named.... readJson. It is a templated function, that lets you decode json values based on type easily, while still handling all the correct error codes that were handled previously. Use is done similar to the example below: std::string required; boost::optional<std::string> optional; if (!json_util::readJson(req, res, "OptionalParam", optional, "RequiredParam", required)) { return; } if (optional){ // optional param was given, take action. } As part of this patchset, the systems schema is moved to the new interface, which deletes some of the code involved and shows the improvement in clarity. Change-Id: I041a97c84d294df8cd4de4c2702e5ee22c0bc120 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move to clang-format-6.0Ed Tanous2018-09-052-902/+1054
| | | | | | | | This commit moves the codebase to the lastest clang-format file from upstream, as well as clang-format-6.0. Change-Id: Ice8313468097c0c42317fbb9e10ddf036e8cff4c Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Move over to upstream c++ styleEd Tanous2018-07-262-14/+14
| | | | | | | | | | | | | | | | | | This patchset moves bmcweb over to the upstream style naming conventions for variables, classes, and functions, as well as imposes the latest clang-format file. This changeset was mostly built automatically by the included .clang-tidy file, which has the ability to autoformat and auto rename variables. At some point in the future I would like to see this in greater use, but for now, we will impose it on bmcweb, and see how it goes. Tested: Code still compiles, and appears to run, although other issues are possible and likely. Change-Id: If422a2e36df924e897736b3feffa89f411d9dac1 Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Pull in nlohmann json as a dependency rather than checking in.Ed Tanous2018-06-291-5/+7
| | | | | | | | This should allow keeping closer to the upstream yocto recipes, and avoid excess code in the repo Change-Id: Ib66f7cf69b68bb23f9789580beadf8344cb68cfa Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Boost beastEd Tanous2018-06-291-2/+1
| | | | | | | | This commit is the beginings of attempting to transition away from crow, and toward boost::beast. Unit tests are passing, and implementation appears to be slightly faster than crow. Change-Id: Ic8d946dc7a04f514c67b1098f181eee1ced69171
* Added JSON utilities to allow easy exception-less usage of nlohmann JSON.Kowalski, Kamil2018-06-291-0/+454
| | | | | | | | | These functions are not yet used, but will be required by at least two upcoming patchsets. This functionality has been cut out from Configuration patchset for easier merge without having to wait for that commit. Change-Id: Ibe5d5cefd874d4a2d896b42a2b7cfc17480f3c5a Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com>
* Introduce Redfish Error messages definitionsKowalski, Kamil2018-04-221-0/+1159
| | | | | | | | | | | | | | | | | Added a python script that should be use to generate error_messages.cpp na .hpp files. These files as are not subject to change in a dynamic manner, should be regenerated only when MessageRegistry changes. Tested on x86 Ubuntu VM and Wolfpass platform: a) No regression in BMCWeb interface - Went through WebUI observed no changes in functionality b) No regression in Redfish functionality - Went through nodes and observed no changes in functionality - Sessions now return error messages in addition to HTTP codes Change-Id: I4aba9ee247b6cd2c46a9c158d14bdc7546e9b11b Signed-off-by: Kowalski, Kamil <kamil.kowalski@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
* Privilege implementation changeBorawski.Lukasz2018-03-271-202/+0
| | | | | | | | | | - privilege_registry.json has been removed - PrivilegeProvider class has been removed - default privileges for nodes are now hard-coded - privilege overriding feature is not yet implemented Change-Id: Ic9fdfa1c692c1abd26e339e2a8c702fc4aebd19f Signed-off-by: Borawski.Lukasz <lukasz.borawski@intel.com>
* Redfish privilegesBorawski.Lukasz2018-03-271-0/+202
Redfish privilege authorization subsystem controlled by the privilege_registy.json configuration file. PropertyOverrides, SubordinateOverrides and ResourceURIOverrides are not yet implemented. Change-Id: I4d5670d557f4da172460ada3512e015830dab667 Signed-off-by: Borawski.Lukasz <lukasz.borawski@intel.com> Signed-off-by: Ed Tanous <ed.tanous@intel.com>
OpenPOWER on IntegriCloud