summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2022-07-07Google RoT: avoid potential dangling pointerNan Zhou1-1/+1
The struct |ResolvedEntity| stores a pointer which might be dangling in the future when interface is not longer a string literal. Given that the interface string is small enough, this commits changes the data member to a string which is constructed (copied) from the string literal today. Tested: trivial change. Compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I2759635f7fa296cc8aa141735efb3799a1503726
2022-07-07dbus_utility_test: fix test case namesNan Zhou1-6/+8
This commit applies the GTest test case naming convention: Camel case, use decriptive Test names. It also groups test cases according to the name. Reference: https://testing.googleblog.com/2014/10/testing-on-toilet-writing-descriptive.html http://google.github.io/googletest/primer.html#simple-tests Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ibd1bfcb4456b64e43f437cc2afa7464f03ee634c
2022-07-05Remove unused variablesEd Tanous1-1/+0
cppcheck finds a few variables that were unused in a few modules. Clean them up. Tested: Code compiles, unit tests pass. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7a95025891bb537b45b99b3cd649ad05533e78f4
2022-07-01Make nbd-proxy header build in all casesEd Tanous1-3/+3
We very intentionally don't do this "only include header if option is enabled" thing to make sure that compile issues are seen across all builds. Tested: Code compiles. Header changes only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I749aed62ed6cd73690f3d89d75df65bec77562c2
2022-07-01Remove BLONSEd Tanous1-1412/+0
This file was used in unit tests a while ago. It's not really a good test list, and ideally would be replaced with coverage directed fuzzing if we ever needed something like this in the future. Tested: Delete only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9a7d3c422226e0366399ab43abd92f762e3e4fc7
2022-06-30Require explicit decorator on one arg constructorsEd Tanous1-2/+2
We essentially follow this rule already, not relying on implicit operators, although there are a number of cases where in theory we could've implicitly constructed an object. This commit enables the clang-tidy check. Tested: Code compiles, passes clang-tidy. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia428463313b075c69614fdb326e8c5c094e7adde
2022-06-28http_utility_test: fix test case namesNan Zhou1-4/+14
This commit applies the GTest test case naming convention: Camel case, use decriptive Test names. It also groups test cases according to the name. Reference: https://testing.googleblog.com/2014/10/testing-on-toilet-writing-descriptive.html http://google.github.io/googletest/primer.html#simple-tests Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ie008ceac9e027b518e660745722ac5cc0af502da
2022-06-28http_utility_test: add namespaceNan Zhou1-8/+14
To save duplicate codes. Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ibb641942b24a92f61793995337963be80d4a6151
2022-06-28Fix shadowed variable issuesEd Tanous3-13/+13
This patchset is the conclusion of a multi-year effort to try to fix shadowed variable names. Variables seem to be shadowed all over, and in most places they exist, there's a "code smell" of things that aren't doing what the author intended. This commit attempts to clean up these in several ways by: 1. Renaming variables where appropriate. 2. Preferring to refer to member variables directly when operating within a class 3. Rearranging code so that pass through variables are handled in the calling scope, rather than passing them through. These patterns are applied throughout the codebase, to the point where -Wshadow can be enabled in meson.build. Tested: Code compiles, unit tests pass. Still need to run redfish service validator. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: If703398c2282f9e096ca2694fd94515de36a098b
2022-06-28http_utility_test: fix headersNan Zhou1-2/+2
"gmock/gmock.h" should be replaced with "gtest/gtest.h" given that only GTest macors are used. "http_utility.hpp" is a local header and "gtest/gtest.h" is a header in dependencies. The convention is to use <> for dependency headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Tested: unit test passed Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I42b077090df59ee1c4fbfab3199d2ee9b4b242dc
2022-06-28dbus_utility_test: clean up headersNan Zhou1-5/+4
Removed unused headers and include missing headers. Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ie04af6c00d849f268ededffb3d01bb79f0f895cd
2022-06-28dbus_utility_test: add namespaceNan Zhou1-10/+17
This commit does nothing but add namespace to the test source. It can be shown that it saves a lot of duplicate codes. Tested: unit test compiles and passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I42a70c5c32c32c1cb09f7c3e36d6e5816aa3a53e
2022-06-28human_sort_test: add namespaceNan Zhou1-2/+7
Add an anonymous namespace and use using declarations. Tested: unit test passed. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I2d29aa7ec7923addc41b0af564542932a5abd9b4
2022-06-28human_sort_test: fix headersNan Zhou1-2/+4
IWYU. Use <> for dependency headers and "" for bmcweb headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I6a329c8b04b0eccda7f601128f66770a7f119676
2022-06-27Rearrange forward_unauthorizedEd Tanous1-22/+21
This file is kind of hard to read. Try to improve it. This readability problem caused me to miss one of the cases and invert it, and because there's 6 possible clients/flows that need tested through these, my testing didn't catch it originally. Tested: Redfish protocol validator now passes one more test for www-authenticate. 18 failing test cases down to 12. ''' curl -vvvv --insecure -H "Accepts: application/json" https://192.168.7.2/redfish/v1/SessionService/Sessions ''' Now returns WWW-Authenticate when basic auth is enabled. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Idaed4c1fe3f58667b5478006d3091d820ca26d58
2022-06-25sessions: iwyunitroglycerine1-8/+0
While revisiting change 49039 I saw session.hpp included a few files that are not used. I removed them and the code still compiles. Signed-off-by: Sui Chen <suichen6@gmail.com> Change-Id: I97aa2359053ce6102b84af1ef555d881cd35eaba
2022-06-25multipart_test: use ASSERT_EQ correctlyNan Zhou1-20/+20
It makes sense to use ASSERT_EQ for the |parse| function, but not every attribute for the parsed results. Tested: unit test passes. Reference: https://testing.googleblog.com/2008/07/tott-expect-vs-assert.html Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I27629eb8d721d7e62c82fdb7afbf4698546f0bdb
2022-06-25multipart_test: add namespaceNan Zhou1-1/+6
Added an anonymous namespace. Putting codes in the global namespace is generally not recommended. Reference: https://stackoverflow.com/questions/47861534/why-does-google-test-sample-put-tests-in-an-anonymous-namespace Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ic141a1e71b80a47f9b9c0c5a0a73da68ee7c72d9
2022-06-25multipart_test: fix headersNan Zhou1-3/+7
IWYU. Use <> for dependency headers and "" for bmcweb headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Id759f66b9617e5e1c59177f21acb00fb0be28b93
2022-06-25openbmc_dbus_rest_test: fix headersNan Zhou1-3/+3
The "include/" directory is already in the search path specified by -I, so remove the prefix from the header. Use <> for dependency headers and "" for bmcweb headers. Reference: https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html Tested: unit test passes. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Id0d95d927bb390dba311d9e4f4da3eef4e566ed7
2022-06-24dbus_utility: iwyuNan Zhou1-0/+6
Manually added some missing headers. The "dbus_singleton.hpp" one is causing issues for unit tests: unit test needs to include dbus_singleton even if it just uses a helper function like "getNthStringFromPath". Tested: code compiles. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I28544835a3e4483eb52f53f7ad89d233cadd4143
2022-06-23pam_authenticate: remove unused referenceNan Zhou2-2/+0
The header pam_authenticate isn't referenced at all in these two files. So remove it. Tested: codes compiles Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I4d9ea06dca2ce4d05add710ec3d6cc0df5c1a39d
2022-06-19openbmc_dbus_rest: use auto for json iteratorsNan Zhou1-3/+2
Clang++ complains about ``` error: use of overloaded operator '==' is ambiguous (with operand types 'nlohmann::json::const_iterator' (aka 'iter_impl<const nlohmann::basic_json<>>') and 'nlohmann::basic_json<>::iterator' (aka 'iter_impl<nlohmann::basic_json<>>')) if (argIt == transaction->arguments.end()) ``` Considering we often use auto for iterators, I changed all explict JSON iterator types in this file to auto. Tested: 1. compies on clang; Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I053de0618491dcb01ff8d4e25fe1ebe3c2d3c105
2022-06-18openbmc_dbus_rest_test: refactor testsNan Zhou1-62/+48
Thhis commit added namespace to unit tests and using declarations, which is a common practise to avoid duplicate namespaces in unit tests. It can be shown that after this change, many namespace scoping codes disappear. Tested: 1. Unit test passed. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I02e221f83c1e330fb57122c8daccbe180ec37a14
2022-06-18openbmc_jtag_rest_test: move to openbmc_dbus_restNan Zhou1-0/+50
This commit does nothing but moving test codes from openbmc_jtag_rest_test.cc, a very old test file whose name is obsolote now, to a more recent and well maintained unit test file (openbmc_dbus_rest_test.cc). Tested: unit test passed. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I3709d18c8ef5cbba5b3f6490a1e9d1798dfc8b52
2022-06-11On logout set Session cookie with expired dateGunnar Mills1-0/+5
The Session cookie is an HttpOnly cookie. HttpOnly means the cookie cannot be accessed through client side script because of this the GUI can not delete this cookie on log out. Recommendation online was setting this cookie to an expired date. From https://tools.ietf.org/search/rfc6265 "Finally, to remove a cookie, the server returns a Set-Cookie header with an expiration date in the past. The server will be successful in removing the cookie only if the Path and the Domain attribute in the Set-Cookie header match the values used when the cookie was created." For more information see https://stackoverflow.com/questions/5285940/correct-way-to-delete-cookies-server-side Modern browsers delete expired cookies although based on reading it might not be right away but on the next request from that domain or when the browser is cleaning up cookies. When I tested the cookie is deleted right away. Also set the SESSION to an empty string. Discussed in discord here: https://discord.com/channels/775381525260664832/855566794994221117/982351098998321163 Webui-vue and phosphor-webui both use this /logout route: https://github.com/openbmc/webui-vue/blob/a5fefd0ad25753e5f7da03d77dfe7fe10255ebb6/src/store/modules/Authentication/AuthenticanStore.js#L50 https://github.com/openbmc/phosphor-webui/blob/339db9a4c8610c5ecb92993c0bbc2219933bc858/app/common/services/userModel.js#L46 It seemed unnecessary to add it to the SessionCollection Post. Tested: No longer have the cookie after log out on webui-vue. Tested on Firefox and Chrome. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Change-Id: Ic12b6f628293a80c93ffbbe1bf06c9b2d6a53af7
2022-06-06Fix www-authenticate behaviorEd Tanous1-6/+13
bmcweb is in a weird position where, on the one hand, we would like to support Redfish to the specification, while also supporting a secure webui. For better or worse, the webui can't currently use non-cookie auth because of the impacts to things outside of Redfish like websockets. This has lead to some odd code in bmcweb that tries to "detect" whether the browser is present, so we don't accidentally pop up the basic auth window if a user happens to get logged out on an xhr request. Basic auth in a browser actually causes CSRF vulnerabilities, as the browser caches the credentials, so we don't want to make that auth method available at all. Previously, this detection was based on the presence of the user-agent header, but in the years since this code was originally written, a majority of implementations have moved to sending a user-agent by default, which makes this check pretty much useless for its purpose. To work around that, this patchset relies on the X-Requested-With header, to determine if a json payload request was done by xhr. In theory, all browsers will set this header when doing xhr requests, so this should provide a "more correct" solution to this issue. Background: https://en.wikipedia.org/wiki/List_of_HTTP_header_fields "X-Requested-With Mainly used to identify Ajax requests (most JavaScript frameworks send this field with value of XMLHttpRequest)" Tested: curl -vvvv --insecure https://192.168.7.2/redfish/v1/SessionService/Sessions Now returns a WWW-Authenticate header Redfish-protocol-validator now passes 7 more tests from the RESP_HEADERS_WWW_AUTHENTICATE category. Launched webui-vue and logged in. Responses in network tab appear to work, and data populates the page as expected. Used curl to delete redfish session from store with DELETE /redfish/v1/SessionService/Sessions/<SessionId> Then clicked an element on the webui, page forwarded to login page as expected. Opened https://localhost:8000/redfish/v1/CertificateService in a browser, and observed that page forwarded to the login page as it should. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I60345caa41e520c23fe57792bf2e8c16ef144a7a
2022-06-01Try to fix the lambda formatting issueEd Tanous15-1667/+1578
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels and to use OuterScope." bmcweb is very callback heavy code. Try to enable it and see if that improves things. There are many cases where the length of a lambda call will change, and reindent the entire lambda function. This is really bad for code reviews, as it's difficult to see the lines changed. This commit should resolve it. This does have the downside of reindenting a lot of functions, which is unfortunate, but probably worth it in the long run. All changes except for the .clang-format file were made by the robot. Tested: Code compiles, whitespace changes only. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43
2022-05-26auth: change authorization.hpp to authentication.hppNan Zhou1-2/+2
The existing authorization header is actually doing "authentication" work. The authorization is happening in routing.hpp where we fetch the role of the authenticated user and get their privilege set. This commits changes the name of the file, as well as the namespace, to be more precise on what the file actually does. Tested: 1. Trivial change, it builds Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ib91ed70507a7308522c7e5363ed2f4dc279a19d9
2022-05-24bmcweb: fixes virtual media buffer overflowTroy Lee1-2/+3
The bmcweb is implementated as async i/o access, sometimes the input buffer still has unprocessed data, and the next websocket message comes in. The input buffer originally reserved only 1 nbd request packet size, so it will cause buffer overflow exception. Extend the buffer size and correctly check the remaining buffer size. v8: fix coding style v7: remove debug log and proxy.wait() change to keep this change simple v4: fix coding style v3: fix coding style v2: fix coding style Signed-off-by: Troy Lee <troy_lee@aspeedtech.com> Change-Id: I8df2445503393f63401678d9f2486a80d31aee16
2022-05-20google_api: Fix build issueJiaqing Zhao1-1/+2
Commit 4cee35e ("Add RootOfTrustCollection and RootOfTrust under Google service root.") still uses the crow::openbmc_mapper::GetSubTreeType removed in b9d36b4 ("Consitently use dbus::utility types"), causing build failure. This patch fixes the build issue by using the dbus::utility::MapperGetSubTreeResponse instead. Tested: Build pass. Change-Id: Ia2ca965f320ef18f431bfcb6d62c9c44eb935d9d Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-05-20Add RootOfTrustCollection and RootOfTrust under Google service root.Vidya Satyamsetti1-10/+192
These are Google only resources powered by Hoth DBus interface. The ComponentsProtected links is hardcoded for now. But it will be queried from DBus and interpreted accordingly in the future. TEST: $curl -u root:0penBmc -X GET http://[::1]:$PORT/google/v1/RootOfTrustCollection { "@odata.id": "/google/v1/RootOfTrustCollection", "@odata.type": "#RootOfTrustCollection.RootOfTrustCollection", "Members": [ { "@odata.id": "/google/v1/RootOfTrustCollection/Hoth" } ], "Members@odata.count": 1 } $ curl -u root:0penBmc -X GET http://[::1]:$PORT/google/v1/RootOfTrustCollection/Hoth { "@odata.id": "/google/v1/RootOfTrustCollection/Hoth", "@odata.type": "#RootOfTrust.v1_0_0.RootOfTrust", "Actions": { "#RootOfTrust.SendCommand": { "target": "/google/v1/RootOfTrustCollection/Hoth/Actions/RootOfTrust.SendCommand" } }, "Id": "Hoth", "Location": { "PartLocation": { "ServiceLabel": "Hoth", "Locationtype": "Embedded" } }, "Name": "RootOfTrust-Hoth", "Status": { "State": "Enabled" } $ curl -u root:0penBmc -X POST -d @req.json -H "Content-Type: application/json" http://[::1]:$PORT/google/v1/RootOfTrustCollection/Hoth/Actions/RootOfTrust.SendCommand { "CommandResponse": "033B0000" } Signed-off-by: Vidya Satyamsetti <satyamsetti@google.com> Change-Id: If64612468bb89e6d9251d848697608b7daf37339
2022-05-13Separate validFilename into a separate functionJosh Lehan2-2/+43
This will generalize it and make it callable from other places Tested: Added test cases, they pass Signed-off-by: Josh Lehan <krellan@google.com> Change-Id: I8df30d6fe6753a2454d7051cc2d8813ddbf14bad
2022-05-13Remove brace initialization of json objectsEd Tanous6-114/+141
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies. This patchset aims to remove a majority of them in lieu of operator[]. Interestingly, this saves about 1% of the binary size of bmcweb. This also has an added benefit that as a design pattern, we're never constructing a new object, then moving it into place, we're always adding to the existing object, which in the future _could_ make things like OEM schemas or properties easier, as there's no case where we're completely replacing the response object. Tested: Ran redfish service validator. No new failures. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iae409b0a40ddd3ae6112cb2d52c6f6ab388595fe
2022-05-13Move /bus/system/<str>/<path> POST to methodEd Tanous1-345/+317
Per the reorganization we've done elsewhere, move this large lambda function to simplify it. Tested: Code move only. Code compiles. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib0586b34809167120bdc127868706ac517db4474
2022-05-12Move redfish v1 into redfish-coreEd Tanous1-21/+0
This file has existed for a long time, and predates redfish-core, so it was put in an inopportune place. Move the code to where it should be, in lib. Tested: Code compiles. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I422c27563a5e0f2a5debb2b1d4713aa8db0fe331
2022-04-30Fix unmounting image in proxy mode.Przemyslaw Czarnowski1-1/+1
Sometimes Slot0 got higher key than Slot1 and erase function for Slot1 invalidates elements with keys not less than the erased element. In that case invalid slot0 will be unmounted. Change order of calling close() and erase() functions to unmount correct device. Change-Id: I7a40a4518982f697d3eed635cde6d06978149cf0 Signed-off-by: Alicja Rybak <alicja.rybak@intel.com> Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2022-04-30Fix compilation of nbd_proxy.hppPrzemyslaw Czarnowski1-4/+6
Fixes compilation errors after introducing * 7772638ea777820234e6004ee63dc558e629e35e Remove AsyncResp from openHandler * b9d36b4791d77a47e1f3c5c4564fcdf7cc68c115 Consistently use dbus::utility types Tested: When nbd_proxy is enabled, code compiles. Change-Id: I6422bbcb7086a8ebc6cc48c7c72636afd1e3ac21 Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2022-04-19Remove regex uses in event service and consolidateEd Tanous1-14/+3
As the patch at https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/50994 can attest, parsing urls with a regex is error prone. We should avoid it where possible, and we have boost::urls that implements a full, correct, and unit tested parser. Ideally, eventually this helper function would devolve into just the parse_uri, and setting defaults portion, and we could rely on the boost::urls::url class to pass into things like http_client. As a side note, because boost url implements port as a proper type-safe uint16, some interfaces that previously accepted port by std::string& needed to be modified, and is included in this patch. Also, once moved, the branch on the ifdef for HTTP push support was failing a clang-tidy validation. This is a known limitation of using ifdefs for our code, and something we've solved with the header file, so move the http push enabler to the header file. Also note that given this reorganization, two EXPECT statements are added to the unit tests for user input behaviors that the old code previously did not handle properly. Tested: Unit tests passing Ran Redfish-Event-Listener, saw subscription create properly: Subcription is successful for https://192.168.7.2, /redfish/v1/EventService/Subscriptions/2197426973 Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia4127c6cbcde6002fe8a50348792024d1d615e8f
2022-03-29Remove AsyncResp from openHandlerzhanghch055-10/+5
This change, moving the openHandler back to only supporting websocket disconnects and not 404s.Because AsyncResp is removed from openHandler. Tested: (from previous commit) Opened KVM in webui-vue and it works. Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I793f05836aeccdc275b7aaaeede41b3a2c276595
2022-03-25Make bmcweb pass REQ_POST_CREATE_TO_MEMBERS_PROPEd Tanous1-0/+2
The Members property within resources is expected to allow create in the same way the Collection resource does. From the spec: Submitting a POST request to a resource collection is equivalent to submitting the same request to the Members property of that resource collection. Services that support the addition of Members to a resource collection shall support both forms. Related: #192 Tested: Redfish protocol validator, REQ_POST_CREATE_TO_MEMBERS_PROP now passes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5c22325946eab9aec8c690450aa2ea24a6e4e485
2022-03-22Consitently use dbus::utility typesEd Tanous8-56/+40
This saves about 4k on the binary size Tested: Redfish service validator passes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9546227a19c691b1aecb80e80307889548c0293f
2022-03-21Replace CSP plugin-types directive with object-srcJiaqing Zhao1-2/+2
The HTTP Content-Security-Policy (CSP) plugin-types directive has been removed from the specification and is not supported by most browsers. Chrome browser suggests to specify "object-src 'none'" instead to block plugins, so replace it with that directive. Refer https://github.com/w3c/webappsec-csp/issues/394 for details about this change. Tested: * In Chrome 99.0.4844.74, it no longer gives errors about CSP plugin-types directive. * Checked neiter <embed>, <object> or <applet> tags are used in eiter phosphor-webui or webui-vue. * Using webui-vue, KVM and SOL Console works. Change-Id: I79d7ed1de2c4d204bf040e7b32a7b6afe354862c Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2022-03-16Remove unused redfish::AsyncRespEd Tanous1-1/+0
This class has been unused for a long time, ever since moving to the common AsyncResp. Tested: Code compiles. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia74c5ff73e6eb991fac5a8b0292bf59910e9689b
2022-03-12Enable readability checksEd Tanous3-12/+13
clang-tidy readability checks are overall a good thing, and help us to write consistent and readable code, even if it doesn't change the result. All changes done by the robot. Tested: Code compiles, inspection only (changes made by robot) Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iee4a0c74a11eef9f158f0044eae675ebc518b549
2022-03-09Enable 3 member function checksEd Tanous1-1/+1
The only changes were to make some functions static, which is essentially no-op. Changes were done by the robot. Tested: Unit tests pass, changes no-op Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id84ca2bee6f237877ba2900b2cbe4679b38a91dc
2022-03-07Don't rely on operator << for object loggingEd Tanous4-7/+8
In the upcoming fmt patch, we remove the use of streams, and a number of our logging statements are relying on them. This commit changes them to no longer rely on operator>> or operator+ to build their strings. This alone isn't very useful, but in the context of the next patch makes the automation able to do a complete conversion of all log statements automatically. Tested: enabled logging on local and saw log statements print to console Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I0e5dc2cf015c6924037e38d547535eda8175a6a1
2022-03-03Fix clang warnings related to OpenSSL 1.xSzymon Dompke1-2/+2
When CI tests are run locally on machine without OpenSSL 3.0, there are some warnings during clang-tidy scan. They are related to unsupported c-style code (implicit bool/int conversion, casting, and varagrs functions). This change is fixing all of them, without changing functionality. Testing done: - running docker image with UTs on local Ubuntu machine with SSL 1.1 is passing all tests, and no clang errors are reported. Signed-off-by: Szymon Dompke <szymon.dompke@intel.com> Change-Id: I5ec91db8f02f487786811afad77080137bab3c9a
2022-03-02Use std::variantEd Tanous1-3/+2
When first committed, I had a misunderstanding of what dedup variant does. In this case, because we unpack all variants of 64/32 bit and int vs uint, so in this case, dedup variant doesn't do anything, and just adds template complexity. In terms of developer readability, std::variant is a c++ concept that is infinitely googlable, and not having to look it up through sdbusplus should be better. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia73b642fd06b24187503196bcdfecb9c896d62c9
2022-03-01Remove flat_maps from our dbus parsing typesEd Tanous1-2/+2
There's nowhere in the codebase where we actually use these as maps. 99% of the time, we just iterate and pull these into specific data structures anyway, so there's no reason for them to be maps. This saves a negligible amount (600 bytes) on our compressed binary size. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I91085cfa2cf8d70e0f0fa0f2f3927776667d834f