Commit Graph

18 Commits

Author SHA1 Message Date
Arksine 7c89756263 authorization: allow trusted cors IPs on ports other than 80
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-03-10 20:35:07 -05:00
Arksine 93e7eaa5b5 authorization: automatically pass "trusted" IPs when cors_domains is configured.
If a trusted IP address is passed as the origin then it is safe to assume that CORS access to this origin should be granted, but only if CORS is enabled by specifying at least one cors domain.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-03-10 19:28:43 -05:00
Arksine 0a3a83de37 authorization: check for dangerous "cors_domains"
A user may unintentionally allow access to dangerous domains if they place a wildcard in the top level domain portion of an entry.  Raise a config error when this condition is detected.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2021-03-10 18:19:28 -05:00
Arksine 7ca910ec46 authorization: add additional CORS logging
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-17 06:52:47 -05:00
Arksine ac1d798a36 authorization: Add wildcards to cors_domians option
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2020-11-16 07:13:30 -05:00
Arksine 2d2f8bfbcd authorization: fix issue cors issue when an error is detected
Tornado clears the headers when an error is detected, "set_default_headers" must be overrridden so that errors are properly returned.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-14 17:59:08 -05:00
Arksine ea62bc9ed1 app: change `enable_cors` option to `cors_domains`
Rather than allow all origins as was the default with "enable_cors", users may not specify the domains allowed.  If "*" is specified, all domains are allowed.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-13 07:27:17 -05:00
Arksine 5836d60d88 app: allow http requests to specifiy a websocket id
Some requests, such "printer/objects/subscribe", require a websocket
for asynchronous updates.  Clients may now specify a "connection_id"
in the form data that identifies an associated websocket.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-11 04:46:21 -05:00
Arksine 92d1715d88 app: Simplify request handlers
There is no need to pass the auth, server, or websocket manager objects to request handlers.  They can be retreived directly from the application reference.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-11 04:46:21 -05:00
Arksine 7cd51fe1eb authorization: update request handlers to accept WebRequest objects
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-11 04:46:21 -05:00
Arksine 059f5d6a73 app: allow local handlers to select their supported protocol
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-07 12:38:15 -04:00
Arksine b034485ce8 authorization: update API registration
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-03 14:01:34 -04:00
Arksine 5b6d4371c8 moonraker: convert missed legacy strings to f-strings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-13 19:23:17 -04:00
Arksine 7cd22804dd moonraker: replace legacy string interpolation with f-strings
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-11 14:28:41 -04:00
Arksine e5cb27f5b7 authorization: Add configparser support
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-08-11 08:38:27 -04:00
Arksine 470f1af475 authorization: refactor trusted ip checks to use ipaddress module
This adds support for both IPv4 and IPv6 authorization.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-28 11:03:29 -04:00
Arksine 45bed374ea moonraker: explicitly declare "None" when calling dict.pop()
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-13 15:13:34 -04:00
Arksine d1c740b900 moonraker: add initial source
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-07-02 12:24:15 -04:00