* Track travel moves and notify if exceeds print volume
* Implement changes from pr review
* Update GcodeAnalysisQueue docstring for travel area
* Update docs for GCODE analysis information
* Update exceedance messages for translation
* 🔒️ Protect against CSRF attacks
CORS and the JSON API heavily reduced the
attack surface here, but especially the upload
endpoints were still vulnerable to CSRF attacks.
All endpoints on the API that use methods
beyond GET, HEAD or OPTIONS now require
the presence of a csrf token (generated
by the UI on first load) AND a X-CSRF-Token
header with a matching value (Double Submit
Cookie), unless authorization is done through
an API-Key instead of a browser session.
Additionally, the SameSite attribute now is
set to "Strict" by default.
* 🔒️ Expand CSRF protection to plugins
Plugins are currently by default *opted out* of CSRF protection, to ensure
backwards compatibility with third party plugins in the field. However,
in a future OctoPrint version this will become a default *opt in*. Plugin
authors are advised to adjust the implementation with an explicit decision
via a logged warning generated in the default implementation. Additionally,
plugins that have opted out their whole plugin will generate a warning in
the startup messages.
A decorator to exempt individual endpoints from CSRF protection as certain
workflows require (see for example the auth request in the appkeys plugin)
is provided.
The general rule of thumb should be to opt in and only exempt those non
GET/HEAD/OPTIONS endpoints that really need to be usable without an
API key or CSRF cookie/header combo. In practice, that should be pretty
much non.
* 🐛 Fix a left-over from a local test
* 🐛 Fix wrong setting in E2E test config.yaml
* 🧑💻 Set CSRF header for $.ajax as well
We already ensure the header is set in the client lib and on the
file upload widgets, but many third party plugins don't use the
client lib but rather $.ajax directly and thus break without this.
* 📝 Improve docs on CSRF protection
Admins may still change existing user account passwords without
having to enter the current one, however the regular user oriented
password change dialog has been adjusted to require entry of the
current password. The API has been locked down accordingly and
the password change endpoint has seen a small change due to that,
please refer to the updated documentation.
Admins may still change existing user account passwords without
having to enter the current one, however the regular user oriented
password change dialog has been adjusted to require entry of the
current password. The API has been locked down accordingly and
the password change endpoint has seen a small change due to that,
please refer to the updated documentation.
Instead of silently ignoring a select/print
on file upload if the necessary preconditions
(printer is online and free to take new jobs) aren't
met, include the effective print/select flags
on the upload API and in the triggered UPLOAD event.
Cleaner would be to simply abort such an API request
with a 409, but that will cause issues with
existing third party plugins and clients and thus
we leave it at simply making the necessary data
available without changing behaviour.
cc @jneilliii
Adding the `unselect` right next to where the `select` is implemented.
There are two ways of unselecting, 1) using the selected filename,
2) using special word `current`
POST /api/files/local/whistle_v2.gcode
POST /api/files/local/current
It now has a dedicated place on the state panel. Also gets exposed
separately on the API. API docs clarify value range of state field on
job API.
Closes#3828