#
9310d76b
|
| 04-Jun-2025 |
Gunnar Mills <gmills@us.ibm.com> |
Make PropertyNotWritable 405
forbidden (403) - "a 403 error means there is an authorization / permission problem."
405 "Method Not Allowed" error means that the web server understands the request b
Make PropertyNotWritable 405
forbidden (403) - "a 403 error means there is an authorization / permission problem."
405 "Method Not Allowed" error means that the web server understands the request but refuses to process it because the HTTP method (like GET, POST, PUT, etc.) used in the request is not supported by the server or the resource.".
Following a stackoverflow response here [1].
Dell mapped PropertyNotWritable to a 400 error. [2] A 400 would be my 2nd choice.
[1]: https://stackoverflow.com/questions/52892076/http-code-to-return-for-unsupported-patch [2]: https://www.dell.com/support/manuals/en-in/idrac7-8-lifecycle-controller-v2.30.30.30/redfish_v2.30.30.30/managernetworkprotocol?guid=guid-b2be28b5-60a5-4782-83ac-3efb3af79ef2&lang=en-us
Change-Id: Iff3f773a1fdbea96d65f8b82fec75cfc34519ae0 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
10cf50dc
|
| 06-May-2025 |
Ed Tanous <ed@tanous.net> |
Make registries return an object_t
All the registry helper functions should return an object_t, given that they're guaranteed to return an object. nlohmann::json as a type can technically be string
Make registries return an object_t
All the registry helper functions should return an object_t, given that they're guaranteed to return an object. nlohmann::json as a type can technically be string/int/bool/null/object/array, so it causes some peculiarities in parsing.
Change-Id: If296477cb8d066d7f44ef0d12f17d94a5301e450 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
4a102cd4
|
| 27-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
registries: make registration dynamic
Rather than having to manually hook code for registries, add a small registration function to the registry header and use this registration results throughout t
registries: make registration dynamic
Rather than having to manually hook code for registries, add a small registration function to the registry header and use this registration results throughout the registry interactions.
Tested:
Confirmed registries have same behavior.
``` $ curl -s -k https://localhost:18080/redfish/v1/Registries/ | jq '.Members | map(."@odata.id")' [ "/redfish/v1/Registries/Base", "/redfish/v1/Registries/HeartbeatEvent", "/redfish/v1/Registries/OpenBMC", "/redfish/v1/Registries/ResourceEvent", "/redfish/v1/Registries/TaskEvent", "/redfish/v1/Registries/Telemetry" ] ```
``` $ curl -s -k https://localhost:18080/redfish/v1/Registries/TaskEvent/TaskEvent | jq ".Messages | keys" [ "TaskAborted", "TaskCancelled", "TaskCompletedOK", "TaskCompletedWarning", "TaskPaused", "TaskProgressChanged", "TaskRemoved", "TaskResumed", "TaskStarted" ] ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iaa355420736a2587d9da4e995208d579443ca9b8
show more ...
|
#
7f84d8c6
|
| 14-Mar-2023 |
Myung Bae <myungbae@us.ibm.com> |
Return forbidden return code for RestrictedRole operations
This fixes the http error code of the operations of the restricted role which currently result in bad_request (400) instead of forbidden (4
Return forbidden return code for RestrictedRole operations
This fixes the http error code of the operations of the restricted role which currently result in bad_request (400) instead of forbidden (403).
Tested:
``` $ redfishtool -r ${bmc}:18080 -u ${user} -p ${pass} -S Always raw POST /redfish/v1/AccountService/Accounts -d '{"UserName":"service","Password":"newPwd1","RoleId":"Operator"}' redfishtool: Transport: Response Error: status_code: 403 -- Forbidden--user not authorized to perform action redfishtool: raw: Error sending POST to resource, aborting
$ redfishtool -r ${bmc}:18080 -u ${user} -p ${pass} -S Always raw PATCH /redfish/v1/AccountService/Accounts/${user} -d '{"Password":"NewTestPwd123"}' redfishtool: Transport: Response Error: status_code: 403 -- Forbidden--user not authorized to perform action
$ redfishtool -r ${bmc}:18080 -u ${user} -p ${pass} -S Always raw PATCH /redfish/v1/AccountService/Accounts/${user} -d '{"UserName":"new-service"}' redfishtool: Transport: Response Error: status_code: 403 -- Forbidden--user not authorized to perform action
$ redfishtool -r ${bmc}:18080 -u ${user} -p ${pass} -S Always raw PATCH /redfish/v1/AccountService/Accounts/${user} -d '{"RoleId":"Operator"}' redfishtool: Transport: Response Error: status_code: 403 -- Forbidden--user not authorized to perform action
$ redfishtool -r ${bmc}:18080 -u ${user} -p ${pass} -S Always raw DELETE /redfish/v1/AccountService/Accounts/${user} redfishtool: Transport: Response Error: status_code: 403 -- Forbidden--user not authorized to perform action redfishtool: raw: Error sending DELETE to resource, aborting
```
Change-Id: I1b212ccb5a630750eb5d4197970b4fb75fceffd7 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
#
504af5a0
|
| 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
6c038f26
|
| 14-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Roll out error message utils
This code should really be in a cpp/hpp file, not in a generated python script. The python script housed this temporarily to allow us to generate the registries. It's
Roll out error message utils
This code should really be in a cpp/hpp file, not in a generated python script. The python script housed this temporarily to allow us to generate the registries. It's time to roll it out.
Tested: Message registries generate successfully on GET. Redfish service validator passes.
Change-Id: I7aca2d0a7fac6d530511421b667ff732617df61e Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
644cdcb8
|
| 17-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Make all ints size_t
We should be consistent when we declare index types. Nlohmann uses an underlying uint64_t as the integer type, so use that for all index types.
Size_t is directly creatable fr
Make all ints size_t
We should be consistent when we declare index types. Nlohmann uses an underlying uint64_t as the integer type, so use that for all index types.
Size_t is directly creatable from it in both 32 and 64 bit modes.
Tested: On last patch in series.
Change-Id: Id1da0e7be2e2046bdbd732247d208b6e9e8c008c Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
f8cca876
|
| 17-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Order by order in DMTF registry
The DMTF registry has a defined order. Previously these were randomly ordered dependent on the hash function used when they were generated years ago.
Functionally t
Order by order in DMTF registry
The DMTF registry has a defined order. Previously these were randomly ordered dependent on the hash function used when they were generated years ago.
Functionally the only change here is to parse_registries.py, to remove the sorting, then to regenerate the files.
Tested: On last patch in series.
Change-Id: I7432c26ec4a1b18acf63ece85500df370f4758d3 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
7ccfe684
|
| 16-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Generate error messages source
This file has gotten desynced from the standard, and maintaining it is a pain. refactor the parse_registries.py script to generate this file and update all wrong inst
Generate error messages source
This file has gotten desynced from the standard, and maintaining it is a pain. refactor the parse_registries.py script to generate this file and update all wrong instances to the correct types.
To the extent possible, the generated code tries to be replaced with 1:1 identical structures to make review simpler.
Tested: On last patch in series.
Change-Id: Ic203a93fd26e0487475ce82c62beb6a22612368a Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
c87294a6
|
| 17-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove InvalidUpload response code
Invalid response is something from the openbmc registry, so it's not a valid thing to return as a response code. For this patch, remove the generated error messag
Remove InvalidUpload response code
Invalid response is something from the openbmc registry, so it's not a valid thing to return as a response code. For this patch, remove the generated error message, and replace the one place it's used with internalError.
Tested: On last patch in series.
Change-Id: I8215935f00923c72fd7763645c06d0b6af73c01d Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
034e1259
|
| 16-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Don't pretty print inline arguments
For consistency, keep all json value printing in error messages non pretty printed. This allows us to generate this file easier.
Tested: On last patch in series
Don't pretty print inline arguments
For consistency, keep all json value printing in error messages non pretty printed. This allows us to generate this file easier.
Tested: On last patch in series.
Change-Id: I1a205e9594e2c917d2b758d537a3f58018cd83d9 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
aaebeaaf
|
| 17-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Rename parameters to keep convention
These two properties were added with argument names that while more descriptive than most, prevent us from generating this file automatically.
Rename to arg1 an
Rename parameters to keep convention
These two properties were added with argument names that while more descriptive than most, prevent us from generating this file automatically.
Rename to arg1 and arg2.
Tested: at end of series.
Change-Id: I2ddb675bd5e0770583d0a4de105c8eb3b54993d7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
7585b760
|
| 17-Oct-2024 |
Jishnu CM <jishnunambiarcm@duck.com> |
Adds redfish error for GenerateSecretKeyRequired
This commit contains the redfish error to be returned when it finds that MFA is enabled and the user has to generate secret key to proceed further.
Adds redfish error for GenerateSecretKeyRequired
This commit contains the redfish error to be returned when it finds that MFA is enabled and the user has to generate secret key to proceed further.
Used and tested in https://gerrit.openbmc.org/c/openbmc/bmcweb/+/74938.
Change-Id: If13b96729510fc7b165aa792f1e1d23a811ca733 Signed-off-by: Jishnu CM <jishnunambiarcm@duck.com>
show more ...
|
#
6be832e2
|
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that c
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that can likely be had.
[1] https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=edtanous_bmcweb&open=AY9_HYjgKXKyw1ZFwgVP
Tested: Comment change only. Code compiles.
Change-Id: Ia960317761f558a87842347ca0b5f3da63f8e730 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
478b7adf
|
| 15-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove IWYU pragmas
These were added as part of d5c80ad9c07b94465d8ea62d2b6f87c30cac765e: test treewide: iwyu
Since then, Nan hasn't been very active on the project, and to my knowledge, since the
Remove IWYU pragmas
These were added as part of d5c80ad9c07b94465d8ea62d2b6f87c30cac765e: test treewide: iwyu
Since then, Nan hasn't been very active on the project, and to my knowledge, since the initial run, we've never used IWYU again.
clang-include-cleaner seems to work well without needing these pragmas, and is what we're using, even if it's less useful than IWYU.
Remove all mention of IWYU.
Tested: Code compiles.
Change-Id: I06feedeeac9a114f5bdec81d59ca83223efd8aa7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
b54eb49f
|
| 23-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Add property error
PropertyError is defined in the DMTF schemas, and will be used in the next patchset.
Tested: Code compiles. No functional changes.
Change-Id: Ib5f0e2025e07c9add41e5e8df8288d7e5
Add property error
PropertyError is defined in the DMTF schemas, and will be used in the next patchset.
Tested: Code compiles. No functional changes.
Change-Id: Ib5f0e2025e07c9add41e5e8df8288d7e54104ee7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
bd79bce8
|
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
fa345c78
|
| 16-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Add EventBufferExceeded message
This is a method that exists in the base registry that we will use in the next commit.
Tested: Code compiles. Code is not yet used.
Change-Id: I02e81371adeb8d3e2c2
Add EventBufferExceeded message
This is a method that exists in the base registry that we will use in the next commit.
Tested: Code compiles. Code is not yet used.
Change-Id: I02e81371adeb8d3e2c2515a8af94b9a1ac0973a9 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
4a7fbefd
|
| 06-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Fix large copies with url_view and segments_view
Despite these objects being called "view" they are still relatively large, as clang-tidy correctly flags, and we ignore.
Change all function uses to
Fix large copies with url_view and segments_view
Despite these objects being called "view" they are still relatively large, as clang-tidy correctly flags, and we ignore.
Change all function uses to capture by: const boost::urls::url_view_base&
Which is the base class of all boost URL types, and any class (url, url_view, etc) is convertible to that base.
Change-Id: I8ee2ea3f4cfba38331303a7e4eb520a2b6f8ba92 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
1827b4f1
|
| 03-Apr-2024 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
Move to Redfish Action specific setProperty call
This commit will migrate all the setProperty calls initiated by a redfish"Action" to "setDbusProperty" method in Redfish namespace that handles all D
Move to Redfish Action specific setProperty call
This commit will migrate all the setProperty calls initiated by a redfish"Action" to "setDbusProperty" method in Redfish namespace that handles all DBuserrors in a consistent manner.
This method will determine if a setProperty is called during redfish "Action" or just setting of a dbus property and internally call appropriate methods that handles different set of errors.
All the Redfish action specific errors are defined in error_messages.hpp file. This specific change moves setProperty call in hypervisor_system.hpp and covers errors in the mentioned file only.
Tested-By: <Yet to test this usecase>
Change-Id: I3da48fbeabcdcf088c4481021232f08a44797c86 Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com> Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
f0b59af4
|
| 20-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Add misc-include-cleaner
And fix the includes that are wrong.
Note, there is a very large ignore list included in the .clang-tidy configcfile. These are things that clang-tidy doesn't yet handle w
Add misc-include-cleaner
And fix the includes that are wrong.
Note, there is a very large ignore list included in the .clang-tidy configcfile. These are things that clang-tidy doesn't yet handle well, like knowing about a details include.
Change-Id: Ie3744f2c8cba68a8700b406449d6c2018a736952 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
367b3dce
|
| 17-Jan-2024 |
Ginu George <ginugeorge@ami.com> |
Pass correct Argument Types to propertyValueIncorrect Error Message
Changed the code to pass the parameters according to their types.
Tested: Code Compiles properly and tested.
Change-Id: Ie0e13d3
Pass correct Argument Types to propertyValueIncorrect Error Message
Changed the code to pass the parameters according to their types.
Tested: Code Compiles properly and tested.
Change-Id: Ie0e13d39cd892afda36dfabec871f0fe8d8498e4 Signed-off-by: Ginu George <ginugeorge@ami.com>
show more ...
|
#
99bf0262
|
| 21-Aug-2023 |
Divya Jyoti <divya1.jyoti@intel.com> |
Fix incorrect response code for header size limit
In this commit the response code for the exceeding header size limit during event subscription(post request to /redfish/v1/EventService/Subscription
Fix incorrect response code for header size limit
In this commit the response code for the exceeding header size limit during event subscription(post request to /redfish/v1/EventService/Subscriptions) is changed to 400 (Bad Request) instead of 405 (Method not allowed)
Tested: If header size in post body is large(>8096), then response code is returned as 400
Change-Id: Ie1301777c994dff64a49e625d7f4f7de72010610 Signed-off-by: Divya Jyoti <divya1.jyoti@intel.com>
show more ...
|
#
62598e31
|
| 17-Jul-2023 |
Ed Tanous <ed@tanous.net> |
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level of compile time checks, it needs to be a method, instead of the stream style logging we had before. This requires a pretty substantial change. Fortunately, this change can be largely automated, via the script included in this commit under scripts/replace_logs.py. This is to aid people in moving their patchsets over to the new form in the short period where old patches will be based on the old logging. The intention is that this script eventually goes away.
The old style logging (stream based) looked like.
BMCWEB_LOG_DEBUG << "Foo " << foo;
The new equivalent of the above would be: BMCWEB_LOG_DEBUG("Foo {}", foo);
In the course of doing this, this also cleans up several ignored linter errors, including macro usage, and array to pointer deconstruction.
Note, This patchset does remove the timestamp from the log message. In practice, this was duplicated between journald and bmcweb, and there's no need for both to exist.
One design decision of note is the addition of logPtr. Because the compiler can't disambiguate between const char* and const MyThing*, it's necessary to add an explicit cast to void*. This is identical to how fmt handled it.
Tested: compiled with logging meson_option enabled, and launched bmcweb
Saw the usual logging, similar to what was present before: ``` [Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled [Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800 [Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist [Info src/webserver_main.cpp:59] Starting webserver on port 18080 [Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file. [Info src/webserver_main.cpp:137] Start Hostname Monitor Service... ``` Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8
show more ...
|
#
d9fcfcc1
|
| 06-Jul-2023 |
Ed Tanous <edtanous@google.com> |
Tidy enable modernize-redundant-void-arg
We have places where we explicitly set something to the pattern of method(void)
This is no longer necessary to declare, so fix the places where we do it to
Tidy enable modernize-redundant-void-arg
We have places where we explicitly set something to the pattern of method(void)
This is no longer necessary to declare, so fix the places where we do it to make the codebase consistent, and enable the check.
Tested: Clang-tidy passes.
Change-Id: I3ef03fc07d65b656fecbcfea638dd12ba95f22e0 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|