Age | Commit message (Collapse) | Author | Files | Lines |
|
In the begining, bmcweb had its own webui checked in as source. Largely
conceived of clay, and built by someone that doesn't understand UI
development (me), it was eventually superceeded by phosphor-webui. When
we did that, we created a bug where bmcweb was expecting a UI to always
be installed, and when it wasn't resolved into an infinite recursive
redirect as it tried to find the login page.
This patchset fixes that, by adding a connection between the
authorization class, and the webassets class, for bmcweb to detect at
runtime whether or not the UI is installed, and change behavior in that
case.
Along the way, we got a circular #include, so some includes needed to be
rearranged slightly.
This patchset will change no behavior when the UI is installed. Login
failures will continue to redirect to /, to hit the login page.
If the UI is not installed, and there is no / route, BMCWEB will return
the plaintext UNAUTHORIZED if you attempt to open the webui from the
browser without having a webui installed and without having credentials.
Tested:
Launched in a build without webui-vue, and observed "UNAUTHORIZED" when
I connected through chrome.
Also launched in a build with webui-vue installed with:
IMAGE_INSTALL_append = "webui-vue"
And loaded the webui in chrome, and logged in successfully.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iac9b83ba9e80d434479685b082d547847cdfe309
|
|
Get the core using AsyncResp everywhere, and not have each individual handler
creating its own object.We can call app.handle() without fear of the response
getting ended after the first tree is done populating.
Don't use res.end() anymore.
Tested:
1. Validator passed.
Signed-off-by: zhanghaicheng <zhanghch05@inspur.com>
Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8
|
|
json was already in the array.
Tested: GUI worked in the top commit.
Change-Id: Iac97801489e1bd03a91a613e7b33a777867bd165
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
Today, bmcweb requires the /usr/share/www directory to exist. In most
cases where bmcweb was installed with make install, this is fine, but in
development scenarios, we'd like to be able to boot.
This commit moves what used to be a fatal error (the directory not
existing) to a warning, to help with a common development issue I've
seen before.
Tested:
Launched without a /usr/share/www directory present, and bmcweb launched
successfully and did not throw an exception.
Change-Id: I775fafd86a4e2eef0bf73836d31a78fb320b61c0
Signed-off-by: Ed Tanous <edtanous@google.com>
|
|
cppcheck isn't smart enough to recognize these are c++ headers, not c
headers. Considering we're already inconsistent about our naming, it's
easier to just be consistent, and move the last few files to use .hpp
instead of .h.
Tested:
Code builds, no changes.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ic348d695f8527fa4a0ded53f433e1558c319db40
|
|
Now that CI can handle clang-tidy, and a lot of the individual fixes
have landed for the various static analysis checks, lets see how close
we are.
This includes bringing a bunch of the code up to par with the checks
that require. Most of them fall into the category of extraneous else
statements, const correctness problems, or extra copies.
Tested:
CI only. Unit tests pass.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I9fbd346560a75fdd3901fa40c57932486275e912
|
|
clang-tidy warned on some data structures that, if they throw, the
exceptions can't be caught.
Move these data structures to constexpr equivalents to save some memory.
Tested:
Loaded webui. Worked as intended, and static files loaded properly.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I331ebfc2451f0cc0a82a1b70d325008c9c80401a
|
|
This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional
bugs, so I think it was worthwhile. It also cleaned up several unused
variable from old constructs that no longer exist.
Tested:
Built with clang. Code no longer emits warnings.
Downloaded bmcweb to system and pulled up the webui, observed webui
loads and logs in properly.
Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
This commit enables clang warnings, and fixes all warnings that were
found. Most of these fall into a couple categories:
Variable shadow issues were fixed by renaming variables
unused parameter warnings were resolved by either checking error codes
that had been ignored, or removing the name of the variable from the
scope.
Other various warnings were fixed in the best way I was able to come up
with.
Note, the redfish Node class is especially insidious, as it causes all
imlementers to have variables for parameters, regardless of whether or
not they are used. Deprecating the Node class is on my list of things
to do, as it adds extra overhead, and in general isn't a useful
abstraction. For now, I have simply fixed all the handlers.
Tested:
Added the current meta-clang meta layer into bblayers.conf, and added
TOOLCHAIN_pn-bmcweb = "clang" to my local.conf
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia75b94010359170159c703e535d1c1af182fe700
|
|
Middlewares, while kinda cool from an academic standpoint, make our
build times even worse than they already are. Given that we only really
use 1 real middleware today (token auth) and it needs to move into the
parser mode anyway (for security limiting buffer sizes), we might as well
use this as an opportunity to delete some code.
Some other things that happen:
1. Persistent data now moves out of the crow namespace
2. App is no longer a template
3. All request_routes implementations no longer become templates. This
should be a decent (unmeasured) win on compile times.
This commit was part of a commit previously called "various cleanups".
This separates ONLY the middleware deletion part of that.
Note, this also deletes about 400 lines of hard to understand code.
Change-Id: I4c19e25491a153a2aa2e4ef46fc797bcb5b3581a
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
We use std::filesystem now, so use that directly instead of having the
using at the top of the file.
Tested: Code compiles. No functional change.
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: Iab977f08a2a61dcc9f2c82c705e5bcc55304e81a
|
|
Currently we parse the whole message before authenticating,
allowing an attacker the ability to upload a large image,
or keep a connection open for the max amount of time easier
than it should be. This moves the authentication to the
earliest point possible, and restricts unauthenticated users
timeouts and max upload sizes. It also makes it so that
unauthenticated users cannot keep the connection alive
forever by refusing to close the connection.
Tested:
- login/logout
- firmware update
- large POST when unauthenticated
- timeouts when unauthenticated
- slowhttptest
Change-Id: Ifa02d8db04eac1821e8950eb85e71634a9e6d265
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
This is from openbmc/docs/style/cpp/.clang-format
Other OpenBMC repos are doing the same.
Tested: Built and validator passed.
Change-Id: Ief26c755c9ce012823e16a506342b0547a53517a
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
|
|
Comment was incorrect, and probably leftover from a clang-format run.
Tested: No tests needed. Only a comment
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: I3f4cb86bc624b02d0bda536bcc66ce7c99882329
|
|
Recently, a number of people in the community have made the (admittedly
easy) mistake that we use a significant portion of crow.
Today, we use crow for the router, and the "app" structure, and even
those have been significantly modified to meet the bmc needs. All other
components have been replaced with Boost beast. This commit removes the
crow mentions from the Readme, and moves the crow folder to "http" to
camouflage it a little. No code content has changed.
Tested:
Code compiles. No functional change made to any executable code.
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Change-Id: Iceb57b26306cc8bdcfc77f3874246338864fd118
|
|
We're at CPP17 everywhere now, no need to keep the
experimental refrerence.
Tested: It builds
Change-Id: I5f6571eb411bf055e9715f7d96d1be5a3cb2e119
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
Splice it into standard for gcc8
Change-Id: I584206dd737c9d90cf93bfa8541980fdd8f6d39b
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
Somehow we got the content type wrong on javascript files, which became
apparent when the content security patches were coming out.
This patchset corrects the string.
Tested By:
Opened webui in chrome, and inspected the javascript files. content
type was correct.
Change-Id: I9ba706d5b919bf4c6365d01853c978b1616913d4
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
It was pointed out that a code comment mixed up the difference between
ascending and descending. This resolves that issue.
Change-Id: Ie71862b03bc23d9c20ac29ca78c076e05e47476a
|
|
This patchset implements JsonSchema support, and automates our update
of the XML metadata, and Json schema files in the future by way of a
python script.
Change-Id: Iec6f580d10736678149db18d87be2f140b535be9
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
This commit moves the codebase to the lastest clang-format file from
upstream, as well as clang-format-6.0.
Change-Id: Ice8313468097c0c42317fbb9e10ddf036e8cff4c
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
Resolves: https://github.com/openbmc/bmcweb/issues/5
In certain contexts when using nginx, there are cheats required to add
duplicated files into the filesystem, making nginx beleive it has both
compressed and uncompressed resources. This messes with bmcweb, as it
previously treated this as a fatal error, given that it doesn't have a
filesystem limitation.
This patchset changes the behavior so that bmcweb now treats this as an
ok situation, and only creates the route for the gzipped version, under
the assumption that they are the same.
Change-Id: I5744d651e9764242c5e52eeafb8c4df72b8a81a2
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
Recently the odata endpoint has been implemented as a static file.
This adds the appropriate content type to the map, so that we can
return the appropriate header.
Fixes the error:
Cannot determine content-type for
"/usr/share/www/redfish/v1/odata/index.json" with extension .json
Change-Id: Ia6d55c9644c344a2d1957b878bfc25a994e8678b
|
|
This patchset moves bmcweb over to the upstream style naming
conventions for variables, classes, and functions, as well as imposes
the latest clang-format file.
This changeset was mostly built automatically by the included
.clang-tidy file, which has the ability to autoformat and auto rename
variables. At some point in the future I would like to see this in
greater use, but for now, we will impose it on bmcweb, and see how it
goes.
Tested: Code still compiles, and appears to run, although other issues
are possible and likely.
Change-Id: If422a2e36df924e897736b3feffa89f411d9dac1
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
This commit is the beginings of attempting to transition away from
crow, and toward boost::beast. Unit tests are passing, and
implementation appears to be slightly faster than crow.
Change-Id: Ic8d946dc7a04f514c67b1098f181eee1ced69171
|
|
directory includes need to manage both the routes, just just the one
ending in slash
Change-Id: I1ba0e9021b212e88861aa720bb5a9d7610b72a9c
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
Change-Id: Ibe3cdc2cd53470ccd437b1b6e21bc7dd29c4b85e
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
... and remove file spcific check for redfish $metadata. This allows
the $metadata to be pre-gzip compressed if we choose.
Change-Id: I697bd7f8a8f5dc1a7b448d699b2daf93a296c248
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
1. Remove extra copy in loading body
2. Add gif and ico to the supported list
3. Log an error if the system fails to look up a content-type
4. Remove commented out caching code
Change-Id: Ib079bb6f0eeacdcd60553af70b391e4b5150fb99
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
Change-Id: I86146edde21bac89e6cc30afdd79690e2b0adadd
|
|
...And delete the old webserver static files from the repo.
Move $metadata to a static file, as that's really where it belongs.
Change-Id: I2caeee7cd779b7c07cfc10cd693459105656671f
|
|
Upate get_routes to use the correct constness for its use case
crow to set json_mode if json value is populated
Delete std::array bytes API due to major efficiency issues. To be
replaced with span API in near future
Implement a catch block for handlers that can throw exceptions
Implement direct handling of routes that end with / to better support
redfish.
/foo and /foo/ now invoke the same handler insead of issuing a 301
redirect
Update nlohmann to latest version
Implement one nlohmann endpoint with exceptions disabled
Implement first pass at a IBM style rest-dbus interface
Fix pam authentication to call dropbear auth methods
Implements first pass at redfish interface. Shemas avaialble pass
redfish validation 100%
Use response json object rather than request json object.
Update authorization middleware to be redfish compliant
UPdate random token generation to be more efficient, and not base64
bytes, generate bytes directly
Change-Id: I63cc2005c1a21f5c2f5168777a4e09f3c965a34f
|
|
Do not merge yet
Change-Id: I38c56844c1b0e3e8e5493c2705e62e6db7ee2102
|
|
|
|
|
|
|
|
|
|
|
|
|