| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
Add the full JSON error response for the case when
the URL looks like it should correspond to a D-Bus
operation, but doesn't.
Change-Id: I63a2c05fd8ab3adcdd81d407f9359ebb0279cdc3
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
This route calls D-Bus methods. Return any errors
encountered in JSON.
Change-Id: I84c6f4abb7092d86ecbc157c95d6343a0b27b7d0
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The only way list can fail is if the GetSubTreePaths call fails,
and that will only happen if the path isn't a valid D-Bus object.
In that case, return the standard REST error JSON response for
org.freedesktop.DBus.Error.FileNotFound.
Change-Id: I538d3132552590e51f9ede80762aee00c59cb3e9
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
For the failure cases, return the error messages
in JSON, the same as the python REST server does.
Change-Id: I150fec3ade738d1bd5425a3ea7cceb6c5539f9f6
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The only way enumerate can fail is if the GetSubTree call fails,
and that will only happen if the path isn't a valid D-Bus object.
In that case, return the standard REST error JSON response for
org.freedesktop.DBus.Error.FileNotFound.
Change-Id: Ie68761c3ee67aa337761567b8a76bd9c9ebddc19
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If there are no ObjectManager instances covering a
path that came back from the GetSubTree call, the only
other way to get that path's properties is by directly
reading them.
So, after all of the GetManagedObjects calls are done,
on any of the paths that were in the GetSubTree results
but not in the enumerate results, make a GetAll call to
get the properties and add them to the output.
The code knows when all of the asynchronous GetManagedObjects
calls are done because it is called from the destructor of the
InProgressEnumerateData struct which is passed to all of the
other asio ops via a shared pointer.
Tested: Run on paths that weren't in object managers, such as
the physical LED objects.
Change-Id: I5a62b9a0ee27a68127e6f216625ce93c9ac58d08
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make a call to GetObject for the target path to get its
connection names and interfaces to add to the GetSubTree
results data before looking for object managers in the
GetSubTree data. This is the only way that the code can
find an object manager interface on the target path.
Tested: /enumerate works better
Change-Id: I341b2f46ee7a20793b5f2db15bf4b57b0cbc6d01
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Add autoconf and autoconf-archive as out of tree builds
have to build autotools projects.
Change-Id: I8daea46e0bf7d9dff493e7360e05b9043a399771
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Somehow, in a patchset merge, SSL got inverted with not SSL, so SSL mode
enabled an SSL socket, and non SSL mode enabled an SSL socket.
THis should resolve it.
Change-Id: Ia3ebc0bf6ce341a66756dc192d66894b2e9121a7
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
| |
This change is largely a sed replace, and gets us closer to standards
compliance.
Change-Id: Ie60437eff43de830ef19389344a55430dabd9d16
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Inline strings make this patchset easier to read, and idenfity where
we're adding headers. Also, in the cases where we're using common keys,
passing it by boost::beast::http::field helps us avoid some dict
lookups. These performance improvements are largely hypothetical, as it
would be unlikely we'd ever measure a real difference.
Change-Id: Ic931c4454a5f40c0d206bb4df09058f8f61fc0e2
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #18
This commit makes CPU core count an optional parameter. Previously it
was used to determine if a slot was populated, which was a bad idea in
the first place. This just makes the implementation a little less bad.
The best implementation would likely be to implement the state interface
in all the processor daemons to tell if the processor is present or not.
Because the processor not being present isn't very common, this is
likely low priority.
Change-Id: I42e49ef5ae7d6184d7f854069fd9a18c7c606dd3
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Updated code to get "UserPrivilege" from DBUS
- Updated Links->Role in AccountManager.
- Added code for "RenameUser".
- Added code to update Privilege over dbus.
UnitTest:
- Tested All methods(Get,Post,Delete,Patch) on
AccountCollections and ManageAccount over redfish
using postman tool.
Change-Id: Ib9d8713908bad28d8d411f113af0d72d6c0fc40b
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Added URL paths and links to option documentation.
Fixed spelling error.
Tested: compiles
Change-Id: I25c2a2756e46843a19425163bca0d99011423ce2
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
|
|
|
|
|
|
|
|
| |
Now that sdbusplus variant supports std::get_if, we can remove our
custom, mapbox namespaced implementation that does the same thing.
Change-Id: I854c473003e28e41dd45dba08ca683433f1c1774
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When specializing code, we know at compile time whether or not SSL will
be used, so we don't need to instantiate both types of
socket/server/app, when we only really care about one at runtime.
The size savings here aren't huge, but are worth doing, just for compile
times.
Change-Id: If4e9934a72eb0f12ce3755c6350e91b8ba485af1
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
A botched merge conflict caused issues with the session service, and
accidentally hardcoded the session info response to a size zero
structure. This resolves it.
Tested By:
Ran sessionService and observed sessions present
Change-Id: I1186f0416c099df5f39a9f894ccfcc20691ceb03
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
| |
This reverts commit 99ad5995089bace233dac20de28ef021591d89c1.
Reason for revert:
This causes a major regression on the web console. Login page fails to load in chrome, with a content-security-policy error. Reverting to regain stability, then we can reopen with a new patchset.
Change-Id: If75b6614ad4cd9732725893040a85589e0d1bb9a
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In a lot of cases, the header include patterns were really bad. For
example, pulling in all of boost asio via boost/asio.hpp, rather than
pulling in the lesser equivalents. This should reduce the build times,
although I have no data on that at the moment.
Tested By:
Code still compiles
Change-Id: I0f4656d35cf6d7722d1b515baaccbfc27cf98961
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the HTTP response header X-Content-Security-Policy
to Content-Security-Policy and changes its value to allow WebSocket
upgrades.
The X-Content-Security-Policy header is deprecated per
https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP and
https://www.owasp.org/index.php/Content_Security_Policy_Cheat_Sheet.
The problem with using the default-src (or connect-src) directive with
the 'self' value when upgrading from https: to wss: is that is blocks
the upgrade. The problem is described here:
https://github.com/w3c/webappsec-csp/issues/7
A similar problem happens with the KVM video (with media-src).
I was unable to find an authoritative fix for this problem.
Tested: pending
Change-Id: Ia8df1e8c3900d81242a5e043ee0601e259bbc9d2
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
|
|
|
|
|
|
|
| |
These functions should've always been in utilities, so move them there.
Change-Id: I9c0bfa875cdc02253e8aa95978ddaa8fd6671b5e
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Managers routing was missing on serviceroot. This resolves it.
Tested By:
Pulled ServiceRoot, and observed endpoint exists
Change-Id: Id2ef8e0107512ee231ec0af9514f26526cb30c73
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Beast seems to have picked up a dependency on libatomic somewhere
between 1.66 and 1.68:
: in function `boost::beast::websocket::detail::stream_prng::create_mask() [clone .isra.3482] [clone .lto_priv.2208]':
<artificial>:(.text+0x50c): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
Change-Id: I1b02ea6c3f0babb4e4cba297f0f8d8e8a2efe3ad
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
| |
There was no newline at the end of the file. Add one.
Change-Id: If1f4befaae9c950865c0ca87bf510fd6b644455f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
| In file included from src/webserver_main.cpp:1:
| crow/include/crow/app.h: In instantiation of ...blah blah blah
| src/webserver_main.cpp:110:1: required from here
| crow/include/crow/app.h:61:10: internal compiler error: in write_expression, at cp/mangle.c:3050
| auto route(std::string&& rule) -> typename std::result_of<
| ^~~~~
| Please submit a full bug report,
We lose c++11 compatibility. ¯\_(ツ)_/¯
Change-Id: Ie30805a88355be0c7adb7b70234989a16b4f1b45
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
| |
Previously, chassis errors would only return 500, and a blank body.
This change causes chassis errors to return the appropriate
internalError implementation.
Change-Id: I75454c334a0bd4870725bc9381a68af08e3eab80
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
| |
It doesn't return anything, and doens't make much sense.
Change-Id: I0819ccc27e386032517f663a2beca085991acedc
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
| |
With the transition to beast, all uses of this enum have moved to
the boost::beast::http::verb, and this enum is no longer neccesary. It
can be removed.
Change-Id: I6065b8159ec8a9ffdae6f98063798e12956c18d6
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the original incarnation of bmcweb, route registration was done
automatically. This has proved to be a terrible idea, wraught with
corner cases and issues.
The route registration is currently the only user of the
redfish::Node::json element. Unfortunately, as written, this structure
consumes a lot of memory that's duplicated and not very useful. From a
performance perspective, there is almost no difference between
rebuilding the structure for each GET request, and having the "cache"
that needs to be copied into the response and modified before it can be
useful.
In the programming tradeoffs for bmc, lower memory usage is more important
than latency, especially at these levels.
Change-Id: I785e8352123e5e886acf05cd59cb23648f93839d
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The UUID implementation had a number of issues that weren't fleshed out,
as it was built before we had the appropriate systemd support.
This resolves it.
Tested By:
Loading the redfish ServiceRoot endpoint, and verifying the UUID is not
zeros.
Change-Id: I86aba678e3d492ad7d258807b0ed9e7d453667a2
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per the documentation here:
https://github.com/openbmc/docs/blob/master/rest-api.md
It states:
"When a path has a trailing-slash, the response will list the sub
objects of the URL. For example, using the same object path as above,
but adding a slash"
This subtlety was missed by the original author of this stuff, and as
such, didn't work the way the old APIs were expecting.
Tested By:
HTTP GET /xyz/openbmc_project/
Before this patchset, returns an empty object
{
"data": [],
"message": "200 OK",
"status": "ok"
}
After this patchset, returns:
{
"data": [
"/xyz/openbmc_project/EntityManager",
"/xyz/openbmc_project/FruDevice",
"/xyz/openbmc_project/bios",
"/xyz/openbmc_project/control",
"/xyz/openbmc_project/dump",
"/xyz/openbmc_project/events",
"/xyz/openbmc_project/inventory",
"/xyz/openbmc_project/logging",
"/xyz/openbmc_project/network",
"/xyz/openbmc_project/object_mapper",
"/xyz/openbmc_project/software",
"/xyz/openbmc_project/user"
],
"message": "200 OK",
"status": "ok"
}
Note, to get the exact same responses (which don't include the root
object) this patchset is required:
https://gerrit.openbmc-project.xyz/#/c/openbmc/phosphor-objmgr/+/15545/
Change-Id: I79b192bc26879cdfa25977f403940d3608eb3e22
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds vector handling to the new json interface
and modifies the SendRawPECI Redfish command to utilize it.
Tested: Executed raw PECI commands with good and bad input
to check that it will work and error out correctly.
Change-Id: Ic1c837f5823d28555f727849156b4dabf1b8acef
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This adds details about how to control which BMCWeb features are
enabled at build time, and how persistent configuration data and
SSL certificates and handled.
Tested: N/A
Change-Id: Id0fc6617da859468e433f2038e9aaf4645c99ab0
Signed-off-by: Joseph Reynolds <jrey@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows numerical types to be passed to readJson
with the desired type. They will then be automatically
range-checked and cast to that type.
Tested: Requested variables of type uint64_t, uint8_t, int,
int16_t, and int8_t and confirmed that the range was correctly
checked for each.
Change-Id: Ia55cb03ba2c4321a7de35a7c7b566980a72c5449
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change renames the existing BMC LogService that displays all
entries in the journal to a BMC Journal LogService.
The new standard BMC LogService is modified to only display messages
from the registry. The registry MessageId and MessageArgs must
be included in the journal metadata as "REDFISH_MESSAGE_ID" and
"REDFISH_MESSAGE_ARG_<x>" respectively, where <x> is the arg
number from the registry.
Change-Id: I4556cbea5032ec639ad1fda084571144defe23dc
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds the message registries used by bmcweb.
It includes the OEM OpenBMC.0.1.0 message registry and the
DMTF Base.1.4.0 message registry for reference.
Tested: Ran the Redfish Service Validator and got passing
results for the MessageRegistryCollection and the two
MessageRegsitryFiles.
Change-Id: I3e5756103006f065530253b5dbc0d7720cf616b9
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
| |
This change adds helper functions to simplify getting
metadata, IDs, and timestamps from the journal.
Change-Id: Icb8a08b52f7311e6471238fe90bfc4d7cae55ecd
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change moves the bmcweb build flags out of settings.hpp
and into the CMakeLists.txt file as target_compile_definitions().
This makes it so it is no longer required to #include settings.hpp
to use build flags in the source.
Tested: Enabled and disabled some Redfish flags and confirmed that
the desired components were added and removed.
Change-Id: Ibeedb4fc8f3dcc286c73843823693a04c55c0615
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
This change bumps the external build of nlhomann-json to use
the latest v3.3.0 build.
Change-Id: I9da5f200fed0da34561e25f4505ceff9e9bd0bad
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
| |
A merge conflict deleted the VLAN. Add it back to the main flow.
Change-Id: Ie0f5d61a9377b7f2a0e89ca5b00e54e2d32c2df8
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an initial implementations of GET methods for
several schemas:
* ProcessorCollection
* Processor
* MemoryCollection
* Memory
It fetches data from Smbios service.
Tested:
* Compiance report
* Manual walk through selected schemas.
Change-Id: I11e00d0982248f2307e24b9a246ac60672dda8a1
Signed-off-by: Rapkiewicz, Pawel <pawel.rapkiewicz@intel.com>
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
| |
When the objectManager entry was not on the root, there were certain
cases that would return more entries than a user asked for. This
patchset resolves the issue, and filters the responses accordingly.
Change-Id: I1c208433c6e8d161b60ea220587fcd0df6f6a6cb
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cherry-picked from:
https://github.com/ampere-openbmc/bmcweb/commit/dfb534ab5db1bb0bcdc9a6519f1e1ccfede6f363
Add URI of Reset Actions:
/redfish/v1/Managers/openbmc/Actions/Manager.Reset for handling the HTTP POST
method.
We're only able to issue GracefulRestart for OpenBMC therefore the
bmcweb supports for ResetType property with "GracefulRestart" value.
Tested: Using redfishtool command to test:
python3 redfishtool.py -A Basic -S Always --rhost=$bmc_ip -u $bmc_user
-p $bmc_password -d '{"ResetType": "GracefulRestart"}' raw POST
/redfish/v1/Managers/openbmc/Actions/Manager.Reset
Change-Id: I2bbc172d43c3244cc304934618c0c5d1e21d9c08
Signed-off-by: Jennifer Lee <jennifer1.lee@intel.com>
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
| |
This commit fixes a possible buffer overflow that could occur if dbus
paths don't follow the dbus specification.
Change-Id: Ib3c5d4743b1ac7f65a480a88613267ec0b4b7c2b
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
A small logic error caused bugs in the required-ness of optional params.
In the error case, a bad_request return code would be returned with no
error message. This commit allows the request to suceed unharmed.
Change-Id: I1c1cbaf08e79bc1f52485ae12d73701d74e0e2aa
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
| |
This adds a xml and generated json redfish schema
for OemManager.
Change-Id: Ic2d42c4326ba02a423ffecc0bfa8c6872c3b389b
Signed-off-by: James Feist <james.feist@linux.intel.com>
|