#
aa6d4537
|
| 02-Jun-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
Fix indentation of clang-format off blocks
After applying the new clang-format rule in commit 002d39b ("Try to fix the lambda formatting issue"), some clang-format off blocks need to be reindented.
Fix indentation of clang-format off blocks
After applying the new clang-format rule in commit 002d39b ("Try to fix the lambda formatting issue"), some clang-format off blocks need to be reindented.
Tested: Build pass. Just removed some whitespaces.
Change-Id: Ib56ebecfaf774fe99230779adba49537c9b58b8d Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
002d39b4
|
| 31-May-2022 |
Ed Tanous <edtanous@google.com> |
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels
Try to fix the lambda formatting issue
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
show more ...
|
#
1476687d
|
| 15-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Remove brace initialization of json objects
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies.
Remove brace initialization of json objects
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
show more ...
|
#
5f4c798d
|
| 29-Mar-2022 |
Jiaqing Zhao <jiaqing.zhao@intel.com> |
Use multi-depth readJson to handle PATCH NetworkProtocol
The new multi-depth readJson simplifies the PATCH handler and removes 3 extra readJson calls.
Tested: Verified PATCH /redfish/v1/Managers/bm
Use multi-depth readJson to handle PATCH NetworkProtocol
The new multi-depth readJson simplifies the PATCH handler and removes 3 extra readJson calls.
Tested: Verified PATCH /redfish/v1/Managers/bmc/NetworkProtocol works exactly the same as before, all modifiable properties are handled properly.
Change-Id: I836010273b5150576d6bc33eae82acda2de70e67 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
show more ...
|
#
45ca1b86
|
| 25-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Add setUpRedfishRoute to all nodes in redfish
For better or worse, the series ahead of this is making use of setUpRedfishRoute to do the common "redfish specified" things that need to be done for a
Add setUpRedfishRoute to all nodes in redfish
For better or worse, the series ahead of this is making use of setUpRedfishRoute to do the common "redfish specified" things that need to be done for a connection, like header checking, filtering, and other things. In the current model, where BMCWEB_ROUTE is a common function for all HTTP routes, this means we need to propagate this injection call into the whole tree ahead of the requests being handled.
In a perfect world, we would invent something like a REDFISH_ROUTE macro, but because macros are discouraged, the routes take a variadic template of parameters, and each call to the route has a .privileges() call in the middle, there's no good way to effect this change in a less costly manner. This was messaged both in the prior reviews, and on discord sourcing improvements on this pattern, to which none arose.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id29cc799e214edad41e48fc7ce6eed0521f90ecb
show more ...
|
#
b9d36b47
|
| 26-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Consitently use dbus::utility types
This saves about 4k on the binary size
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9546227a19c691b1aecb
Consitently use dbus::utility types
This saves about 4k on the binary size
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9546227a19c691b1aecb80e80307889548c0293f
show more ...
|
#
15ed6780
|
| 14-Dec-2021 |
Willy Tu <wltu@google.com> |
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty input will use the default value based on the implementation and return 200 OK response code.
readJsonPatch will replace the existing readJson and be used for path requests. It will not allow empty json input and all requested keys are required in the json input.
readJsonAction will be used for Action requests where it is possible for all of the properties to be optional and allow empty request. The optional properties are determined by the requested values type.
All current Action readJson are replaced with readJsonAction. It does not change the existing behavior since it needs `std::optional`. This will have to be updated later as we define the default behavior.
Tested: Added unit tests and readJsonAction allows empty empty json object.
No Change to Redfish Tree.
Change-Id: Ia5e1f81695c528a20f1dc985aee19c920d8adaea Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
#
927c17cd
|
| 14-Feb-2022 |
Radivoje Jovanovic <radivoje.jovanovic@intel.com> |
Do not send duplicate data for ntp servers
in the case where multiple network interfaces are present each interface will return the same ntp server data
Tested: on the system that has multiple eth
Do not send duplicate data for ntp servers
in the case where multiple network interfaces are present each interface will return the same ntp server data
Tested: on the system that has multiple eth interfaces
Signed-off-by: Radivoje Jovanovic <radivoje.jovanovic@intel.com> Change-Id: I642aae7a1c07f7629d696f177ddf326d25e36fb1
show more ...
|
#
26f6976f
|
| 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131a
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131ae2eb806e3aa
show more ...
|
#
d3a9e084
|
| 07-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enforce variable init
There were a few places we weren't initting our variables per cpp core guidelines. Fix all of them, and enable checks for this.
Signed-off-by: Ed Tanous <edtanous@google.com>
Enforce variable init
There were a few places we weren't initting our variables per cpp core guidelines. Fix all of them, and enable checks for this.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iba09924beb9fb26f597ff94d1cecbd6d6b1af912
show more ...
|
#
f94c4ecf
|
| 06-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable clang-tidy forward reference checks
Clang-13 adds new checks we can turn on, which find quite a few errors.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I
Enable clang-tidy forward reference checks
Clang-13 adds new checks we can turn on, which find quite a few errors.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I74b780760014c898cc440b37aea640b33e91c439
show more ...
|
#
711ac7a9
|
| 20-Dec-2021 |
Ed Tanous <edtanous@google.com> |
Consistently use ManagedObjectType
Some subsystems seem to have invented their own typedefs for this stuff, move to using the one typedef in dbus::utility so we're consistent, and we reduce our temp
Consistently use ManagedObjectType
Some subsystems seem to have invented their own typedefs for this stuff, move to using the one typedef in dbus::utility so we're consistent, and we reduce our templates.
Tested: code compiles
This saves a negligible amount (104 bytes compressed) on our binary size.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I952ea1f960aa703808d0ac80f35dc24cdd8d5027
show more ...
|
#
1e1e598d
|
| 11-Jun-2021 |
Jonathan Doman <jonathan.doman@intel.com> |
Using sdbusplus::asio::getProperty
It simplifies a lot of code and after changing sdbusplus implementation slightly reduces binary size if used together with:
https://gerrit.openbmc-project.xyz/c/o
Using sdbusplus::asio::getProperty
It simplifies a lot of code and after changing sdbusplus implementation slightly reduces binary size if used together with:
https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/49467
* Uncompressed size: 3033148 -> 3012164, -20984 B * gzip compressed size: 1220586 -> 1214625, -5961 B
Tested: - Redfish validator output is the same before and after the change
Change-Id: Ibe3227d3f4230de2363ba3d9396e51130c8240a5 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
show more ...
|
#
168e20c1
|
| 13-Dec-2021 |
Ed Tanous <edtanous@google.com> |
Move to common variant
This saves approximately 34kB in the compressed binary size of bmcweb due to reduced template instantiations. This amounts to a 2.5% reduction in the overall size.
Note, the
Move to common variant
This saves approximately 34kB in the compressed binary size of bmcweb due to reduced template instantiations. This amounts to a 2.5% reduction in the overall size.
Note, there were a few places where we broke const-correctness in the form of pulling a non-const reference out of a const variant. This new variant now requires const correctness, so some consts are added where required.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I6a60c8881c1268627eedb4ffddf16689dc5f6ed2
show more ...
|
#
0fda0f12
|
| 15-Nov-2021 |
George Liu <liuxiwei@inspur.com> |
Update clang-format
refer: https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format `Don't break long string literals`
Tested: built bmcweb successfully and RedfishValidator Passed.
Sig
Update clang-format
refer: https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format `Don't break long string literals`
Tested: built bmcweb successfully and RedfishValidator Passed.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ib58f7c942fd3838592e043c57e0b6ffcdc3d963b
show more ...
|
#
0a052baa
|
| 29-Sep-2021 |
George Liu <liuxiwei@inspur.com> |
Fix NTPServers are hard-coded for eth0
Since bmcweb is getting and patching NTPServers only from '/xyz/openbmc_project/network/eth0' object, and this is hard-coded, if we use eth1, it will broken th
Fix NTPServers are hard-coded for eth0
Since bmcweb is getting and patching NTPServers only from '/xyz/openbmc_project/network/eth0' object, and this is hard-coded, if we use eth1, it will broken the NTP configuration and fail to route to the correct NTPServer.
All NTPServers of xyz.openbmc_project.Network.EthernetInterface interface should be updated.
Tested: 1. When NTPServer is set through the webUI, all NTPs of the Ethernet will be updated synchronously. 2. If eth1 is ethernet. doPatch: curl -k -H "X-Auth-Token: $token" -X PATCH -d '{ "NTP":{"NTPServers": ["192.168.1.2", "192.168.1.1"], "ProtocolEnabled": true}}' https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol
doGet: curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", "@odata.type": "#ManagerNetworkProtocol.v1_5_0.ManagerNetworkProtocol", "Description": "Manager Network Service", "NTP": { "NTPServers": [ "192.168.1.2", "192.168.1.1" ], "ProtocolEnabled": true }, ... }
3. cat 00-bmc-eth0.network [Match] Name=eth0 [Link] MACAddress=52:54:00:12:34:56 [Network] LinkLocalAddressing=yes IPv6AcceptRA=true NTP=192.168.1.1 NTP=192.168.1.2 DHCP=true [DHCP] ClientIdentifier=mac UseDNS=true UseNTP=true UseHostname=true SendHostname=true
4. cat 00-bmc-eth1.network [Match] Name=eth1 [Link] MACAddress=52:54:00:12:34:57 [Network] LinkLocalAddressing=yes IPv6AcceptRA=true NTP=192.168.1.1 NTP=192.168.1.2 DHCP=true [DHCP] ClientIdentifier=mac UseDNS=true UseNTP=true UseHostname=true SendHostname=true
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I624afa4154464524792d072966bf1ee9db594661
show more ...
|
#
287ece64
|
| 30-Sep-2021 |
George Liu <liuxiwei@inspur.com> |
Remove NTPServers duplicate values and null values
When saving the set NTPServers values from webUI, NTPServer may contain duplicate values and null values and update them to D-Bus.
Now, need to pa
Remove NTPServers duplicate values and null values
When saving the set NTPServers values from webUI, NTPServer may contain duplicate values and null values and update them to D-Bus.
Now, need to parse and verify the value of the ntpServers attribute,and remove duplicate values and null values.
Tested:save NTP and check it via D-Bus without this patch: NTPServers property as 3 "" "10.164.29.2" "10.164.29.2"
with this patch: NTPServers property as 2 "" "10.164.29.2"
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I52291e4608efd635b179f3934c3d3e805afd2209
show more ...
|
#
44fad2aa
|
| 04-Oct-2021 |
Ed Tanous <edtanous@google.com> |
Remove dead hostname code
The original code said we'd remove this in Q4 2021, and it's now Q4 2021. So far as I've heard, no user has reported this, and no system has needed to enable this for back
Remove dead hostname code
The original code said we'd remove this in Q4 2021, and it's now Q4 2021. So far as I've heard, no user has reported this, and no system has needed to enable this for backward compatibility. The original author of the patch has stated that it's no longer used, so this is effectively dead code, lets remove it.
Also, added a missing return in what was previously a #ifdef
Tested: Code builds.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1d58efb92ed06b7632d57440072834a1d02e87dd
show more ...
|
#
4d875bd8
|
| 21-Sep-2021 |
Ed Tanous <edtanous@google.com> |
Make services not required
The recent change to NetworkProtocols has now made particular services "required" to exist in an image. This corrects it to properly check for the "process doesn't exist"
Make services not required
The recent change to NetworkProtocols has now made particular services "required" to exist in an image. This corrects it to properly check for the "process doesn't exist" error code, and bail out early without setting an internal error.
As pointed out in one of the early reviews, this logic can also be simplified and moved, so this code also moves the early property filling code.
This allows deploying systems without IPMI, and have them function correctly.
Tested: Loaded in qemu without IPMI present, did not receive 500 on: curl -vvvv --insecure --user root:0penBmc "https://192.168.7.2/redfish/v1/Managers/bmc/NetworkProtocol"
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I0a8eb687826d055b4eb43ca53120f39c21934b36
show more ...
|
#
b4bec66b
|
| 21-Jun-2021 |
Abhishek Patel <Abhishek.Patel@ibm.com> |
Move getPortInfo to Redfish Utility
Plan to use getPortInfo() to get the SSH SerialConsole in the ComputerSystem. This commit moves the getPortInfo functionality into the redfish utility.
Tested: m
Move getPortInfo to Redfish Utility
Plan to use getPortInfo() to get the SSH SerialConsole in the ComputerSystem. This commit moves the getPortInfo functionality into the redfish utility.
Tested: manually tested on Witherspoon system, there is no change in output. Run Redfish validator, no error found.
Before:
"HTTPS": { "Certificates": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/ Certificates" }, "Port": 443, "ProtocolEnabled": true }, "IPMI": { "Port": 623, "ProtocolEnabled": true }, "SSH": { "Port": 22, "ProtocolEnabled": true }
After:
"HTTPS": { "Certificates": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/ Certificates" }, "Port": 443, "ProtocolEnabled": true }, "IPMI": { "Port": 623, "ProtocolEnabled": true }, "SSH": { "Port": 22, "ProtocolEnabled": true }
Change-Id: I126827fbbecec59adcf630b88e31bc5ff8151588 Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com>
show more ...
|
#
4f48d5f6
|
| 21-Jun-2021 |
Ed Tanous <edtanous@google.com> |
Make code compile with clang-13
Clang-13 rightfully warns that the hasWebuiRoute variable isn't declared as static. This commit resolves that, and adds the static keyword so it can be used in multi
Make code compile with clang-13
Clang-13 rightfully warns that the hasWebuiRoute variable isn't declared as static. This commit resolves that, and adds the static keyword so it can be used in multiple compile units. It also adds the static keyword to the privilege registry, and the inline keyword to many methods that now need it.
clang-format is also updated to version 12 in parse_registies.py, as that's what CI uses, and what most people have installed.
Tested: Followed clang-tidy instructions in README.md "bitbake bmcweb" step now succeeds.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id43b13606754cb37a404799fce155599ac3a3240
show more ...
|
#
ed398213
|
| 09-Jun-2021 |
Ed Tanous <edtanous@google.com> |
Automate PrivilegeRegistry to code
This commit attempts to automate the creation of our privileges structures from the redfish privilege registry. It accomplishes this by updating parse_registries.
Automate PrivilegeRegistry to code
This commit attempts to automate the creation of our privileges structures from the redfish privilege registry. It accomplishes this by updating parse_registries.py to also pull down the privilege registry from DMTF. The script then generates privilege_registry.hpp, which include const defines for all the privilege registry entries in the same format that the Privileges struct accepts. This allows new clients to simply reference the variable to these privilege structures, instead of having to manually (ie error pronely) put the privileges in themselves.
This commit updates all the routes.
For the moment, override and OEM schemas are not considered. Today we don't have any OEM-specific Redfish routes, so the existing ones inherit their parents schema. Overrides have other issues, and are already incorrect as Redfish defines them.
Binary size remains unchanged after this patchset.
Tested: Ran redfish service validator
Ran test case from f9a6708c4c6490257e2eb6a8c04458f500902476 to ensure that the new privileges constructor didn't cause us to regress the brace construction initializer.
Checked binary size with: gzip -c $BBPATH/tmp/work/s7106-openbmc-linux-gnueabi/obmc-phosphor-image/1.0-r0/rootfs/usr/bin/bmcweb | wc -c 1244048
(tested on previous patchset)
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ideede3d5b39d50bffe7fe78a0848bdbc22ac387f
show more ...
|
#
72048780
|
| 02-Jun-2021 |
Abhishek Patel <Abhishek.Patel@ibm.com> |
Modify entityPrivileges for certificate service
DMTF published new entity privileges for certificate service classes which modify entity privilege Certificate, CertificateCollection, CertificateLoca
Modify entityPrivileges for certificate service
DMTF published new entity privileges for certificate service classes which modify entity privilege Certificate, CertificateCollection, CertificateLocations, and CertificateService on bmcweb. Modification restricts a user without "ConfigureManager" from accessing the CertificateCollection and Certificate scehamas
Redfish is a hypermedia API where the parent URI describes sub-URI. Thus, restricting sub-URI in a parent-URI data helps to forbidden user access, stricken the rule. So sub-URI only gets display if a user has access to that URI.
Restricting the link allows the Redfish Validator to pass.
These impact roles without ConfigureManager, which include operator and read-only. No access is not impacted since it already did not have access.
The following are bmcweb user consequences: 1. ReadOnly and Operator role users are no longer able to view certificates or the certificate collection (LDAP, HTTPS, TrustStore) 2. Operator role users are no longer able to replace the certificates (LDAP, HTTPS, TrustStore), Install certificates (LDAP, HTTPS, TrustStore) or delete the Truststore Certificate. HTTPS and LDAP certificates do not have delete methods.
Resolves openbmc/bmcweb#61
Tested: manually tested on Witherspoon system and run Redfish-Service- Validator with all roles root, operator, read-only, and No access. Test pass for root, operator, and read-only roles, And new errors get introduced for no access role.
Signed-off-by: Abhishek Patel <Abhishek.Patel@ibm.com> Change-Id: Ibc5eed7db7e224e46f8572df8bcfba2a1ff47644
show more ...
|
#
e5a99777
|
| 15-Jun-2021 |
Albert Zhang <zhanghaodi@inspur.com> |
Redfish: Allow disabling and enabling SSH
This patch adds support for disabling and enabling SSH using Redfish API.
Tested:Validator passes
1.Disabled SSH from Redfish and verified cannot open a n
Redfish: Allow disabling and enabling SSH
This patch adds support for disabling and enabling SSH using Redfish API.
Tested:Validator passes
1.Disabled SSH from Redfish and verified cannot open a new SSH connection to the machine, but the original SSH connection still takes effect and verified ProtocolEnabled is false for SSH.
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol/ { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", ... "SSH": { "Port": 22, "ProtocolEnabled": true }, ... }
curl -k -H "X-Auth-Token: $token" -X PATCH '-d {"SSH": {"ProtocolEnabled": false}}' https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol/
Open a new SSH connection: sudo ssh username@<IP> ssh: connect to host <IP> port 22: Connection refused
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol/ { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", ... "SSH": { "Port": 22, "ProtocolEnabled": false }, ... }
D-bus has changed to :
busctl introspect xyz.openbmc_project.Control.Service.Manager /xyz/openbmc_project/control/service/dropbear NAME TYPE SIGNATURE RESULT/VALUE FLAGS ... ... ... xyz.openbmc_project.Control.Service.Attributes interface .Enabled property b false emits-change writable .Masked property b false emits-change writable .Running property b false emits-change writable ...
2.Abled SSH from Redfish, verified can open a new SSH connection to the machine and ProtocolEnabled is true for SSH.
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol/ { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", ... "SSH": { "Port": 22, "ProtocolEnabled": false }, ... }
curl -k -H "X-Auth-Token: $token" -X PATCH '-d {"SSH": {"ProtocolEnabled": false}}' https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol/
Open a new SSH connection: sudo ssh username@<IP> Successfully connected
curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Managers/bmc/NetworkProtocol/ { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", ... "SSH": { "Port": 22, "ProtocolEnabled": true }, ... }
D-bus has changed to :
busctl introspect xyz.openbmc_project.Control.Service.Manager /xyz/openbmc_project/control/service/dropbear NAME TYPE SIGNATURE RESULT/VALUE FLAGS ... ... ... xyz.openbmc_project.Control.Service.Attributes interface .Enabled property b true emits-change writable .Masked property b false emits-change writable .Running property b true emits-change writable ...
Signed-off-by: Albert Zhang <zhanghaodi@inspur.com> Change-Id: Ifd80db4d33934e83d4e5f337e5dfd02b4ba39018
show more ...
|
#
432a890c
|
| 14-Jun-2021 |
Ed Tanous <edtanous@google.com> |
Remove ambiguous privileges constructor
There are a number of endpoints that assume that a given routes privileges are governed by a single set of privileges, instead of multiple sets ORed together.
Remove ambiguous privileges constructor
There are a number of endpoints that assume that a given routes privileges are governed by a single set of privileges, instead of multiple sets ORed together. To handle this, there were two overloads of the privileges() method, one that took a vector of Privileges, and one that took an initializer_list of const char*. Unfortunately, this leads some code in AccountService to pick the wrong overload when it's called like this .privileges( {{"ConfigureUsers"}, {"ConfigureManager"}, {"ConfigureSelf"}})
This is supposed to be "User must have ConfigureUsers, or ConfigureManager, or ConfigureSelf". Currently, because it selects the wrong overload, it computes to "User must have ConfigureUsers AND ConfigureManager AND ConfigureSelf.
The double braces are supposed to cause this to form a vector of Privileges, but it appears that the initializer list gets consumed, and the single invocation of initializer list is called. Interestingly, trying to put in a privileges overload of intializer_list<initializer_list<const char*>> causes the compilation to fail with an ambiguous call error, which is what I would've expected to see previously in this case, but alas, I'm only a novice when it comes to how the C++ standard works in these edge cases. This is likely due in part to the fact that they were templates of an unused template param (seemingly copied from the previous method) and SFINAE rules around templates.
This commit functionally removes one of the privileges overloads, and adds a second set of braces to every privileges call that previously had a single set of braces. Previous code will not compile now, which is IMO a good thing.
This likely popped up in the Node class removal, because the Node class explicitly constructs a vector of Privilege objects, ensuing it can hit the right overload
Tested: Ran Redfish service validator
Tested the specific use case outlined on discord with: Creating a new user with operator privilege: ``` redfishtool -S Always -u root -p 0penBmc -vvvvvvvvv -r 192.168.7.2 AccountService adduser foo mysuperPass1 Operator ```
Then attempting to list accounts: ``` curl -vvvv --insecure --user foo:mysuperPass1 https://192.168.7.2/redfish/v1/AccountService/Accounts/foo ```
Which succeeded and returned the account in question.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I83e62b70e97f56dc57d43b9081f333a02fe85495
show more ...
|