commit | 031514fb7798057bbe0261a92b6c368cd5a35f66 | [log] [tgz] |
---|---|---|
author | JunLin Chen <Jun-Lin.Chen@quantatw.com> | Tue Dec 14 14:33:49 2021 +0800 |
committer | Ed Tanous <ed@tanous.net> | Wed May 04 18:13:11 2022 +0000 |
tree | 035c5e71f0b46727d8f0dab5497ff1e491d807df | |
parent | 19ace2b2303d5908252f6ea984def84c7efcac6a [diff] |
Fix bmcweb crash problem when no-auth This change is similiar as https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/49465 After insecure-disable-auth=enabled. it is not needed to do login and establish session before request. GET/PATCH /redfish/v1/AccountService/Accounts/<accountname>. (no matter account exist or not) It won't get any status code and cause the bmcweb service crashed. Solutions: Add #ifndef BMCWEB_INSECURE_DISABLE_AUTHENTICATION and [[maybe_unused]] const crow::Request& req Test: GET / PATCH with authless https://<bmcip>/redfish/v1/AccountService/Accounts/TestAccount Return 200 { "@odata.id": "/redfish/v1/AccountService/Accounts/TestAccount", "@odata.type": "#ManagerAccount.v1_4_0.ManagerAccount", "AccountTypes": [ "Redfish" ], "Description": "User Account", "Enabled": true, "Id": "TestAccount", "Links": { "Role": { "@odata.id": "/redfish/v1/AccountService/Roles/Administrator" } }, "Locked": false, "Locked@Redfish.AllowableValues": [ "false" ], "Name": "User Account", "Password": null, "PasswordChangeRequired": false, "RoleId": "Administrator", "UserName": "TestAccount" } GET nonexistent account https://<bmcip>/redfish/v1/AccountService/Accounts/TestAccountsss { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type ManagerAccount named TestAccountsss was not found.", "MessageArgs": [ "ManagerAccount", "TestAccountsss" ], "MessageId": "Base.1.8.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.8.1.ResourceNotFound", "message": "The requested resource of type ManagerAccount named TestAccountsss was not found." } } Signed-off-by: JunLin Chen <Jun-Lin.Chen@quantatw.com> Change-Id: Ic00020ac07950347973b54d49dacd44c4d4571b7 Signed-off-by: Tony Lee <tony.lee@quantatw.com> Signed-off-by: Ed Tanous <edtanous@google.com>
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja -C builddir test ninja -C builddir coverage
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.