Dietmar Maurer
70fbac84da
src/server/rest.rs: simplify code
2019-11-22 18:44:14 +01:00
Dietmar Maurer
2bbd835b9b
src/server/rest.rs: rename get_request_parameters_async to get_request_parameters
2019-11-22 17:24:16 +01:00
Dietmar Maurer
75a5a68944
src/server/rest.rs - only pass ObjectSchema to get_request_parameters_async()
2019-11-22 17:22:07 +01:00
Dietmar Maurer
ad51d02aa9
src/server/rest.rs: cleanup async code
2019-11-22 13:02:05 +01:00
Dietmar Maurer
e57e1cd82d
move src/api_schema/config.rs -> src/server/config.rs
2019-11-22 09:23:03 +01:00
Wolfgang Bumiller
a2479cfa1a
api/compat: drop more compat imports from api_schema.rs
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 14:36:28 +01:00
Wolfgang Bumiller
cc4ecf80b0
api/compat: drop api_handler submodule
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 14:18:41 +01:00
Wolfgang Bumiller
2194824f77
api: BoxFut -> ApiFuture
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 14:16:37 +01:00
Dietmar Maurer
255f378a1b
use const api definitions
2019-11-21 13:32:09 +01:00
Dietmar Maurer
62ee2eb405
avoid some clippy warnings
2019-10-26 11:42:05 +02:00
Dietmar Maurer
834a2f95a0
avoid some clippy warnings
2019-10-25 18:44:51 +02:00
Wolfgang Bumiller
aadcf7c621
src/server/rest.rs: use tokio::timer::delay
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Wolfgang Bumiller
91e4587343
src/server/rest.rs: switch to async
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-09-02 15:21:26 +02:00
Dietmar Maurer
f69adc81a6
use new proxmox::tools::nodename
2019-08-03 17:06:23 +02:00
Dietmar Maurer
80af046794
src/server/rest.rs: avoid unwrap
2019-07-03 12:00:43 +02:00
Dietmar Maurer
7fb4f5642a
src/server/rest.rs: log peer address, use hyper MakeService
2019-07-03 11:54:35 +02:00
Dietmar Maurer
fcfb84fedf
file download: avoid unnecessary copy
2019-06-28 07:07:52 +02:00
Wolfgang Bumiller
dd5495d6dc
tree-wide: use 'dyn' for all trait objects
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-06-07 13:13:48 +02:00
Dietmar Maurer
34114e2606
src/server/rest.rs: correctly verify json parameters
2019-05-24 09:10:59 +02:00
Dietmar Maurer
1179e15842
src/server/rest.rs: improve error handling
2019-05-23 08:15:32 +02:00
Dietmar Maurer
1133fe9a63
src/server/rest.rs: do not log 1xx status codes as errors
2019-05-14 06:23:22 +02:00
Dietmar Maurer
b4b63e520d
handle_async_api_request: put rpcenv into a Box
...
So that we can pass rpcenv into futures.
2019-05-09 18:01:24 +02:00
Dietmar Maurer
d55037e471
src/server/formatter.rs: rename format_result to format_data
...
To avoid confusions with Rust Result type.
2019-05-09 13:15:15 +02:00
Dietmar Maurer
f757b30efc
src/server/rest.rs: use generics to pass RpcEnvironment
2019-05-08 11:09:01 +02:00
Dietmar Maurer
78f7e225e4
src/server/rest.rs: make handle_(a)sync_api_request public
2019-05-07 11:23:52 +02:00
Dietmar Maurer
3578d99f3e
move normalize_path to tools::normalize_uri_path
2019-05-07 09:44:34 +02:00
Wolfgang Bumiller
062d4916ff
api_schema: allow generic api handler functions
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-04-16 11:22:23 +02:00
Dietmar Maurer
49d123ee3a
src/server/rest.rs: use formatter to encode errors
2019-04-01 08:04:12 +02:00
Dietmar Maurer
7d4ef127cb
src/server/rest.rs: generate csrf token if we have a valid ticket
...
This is important if the user reloads the browser page.
2019-04-01 07:52:30 +02:00
Dietmar Maurer
8346f0d59b
src/server/rest.rs: correctly extract content type
2019-03-19 12:50:15 +01:00
Dietmar Maurer
e5662b04e9
src/tools/ticket.rs: define const TICKET_LIFETIME
2019-03-05 12:56:21 +01:00
Dietmar Maurer
0ffbccce5e
rc/server/rest.rs: allow to pass parameters as application/json
2019-02-27 12:37:53 +01:00
Wolfgang Bumiller
fc7f03523c
cleanup
...
Error::from is already a function taking 1 parameter,
there's no need to wrap it with `|e| Error::from(e)`.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-18 13:21:27 +01:00
Dietmar Maurer
1cb99c234e
src/server/rest.rs: correctly insert NoLogExtension()
2019-02-18 06:54:12 +01:00
Dietmar Maurer
7f1685230a
src/server/rest.rs: get_index() include username and CSRF token
...
When we have an valid ticket. Also delay get_index() if called with
an invalid ticket.
2019-02-17 19:28:32 +01:00
Dietmar Maurer
141de8374a
src/server/rest.rs: factor our normalize_path()
2019-02-17 17:31:53 +01:00
Dietmar Maurer
8225aa2ff6
src/server/rest.rs: improve logs for unauthorized request
2019-02-17 17:18:44 +01:00
Dietmar Maurer
ef2f2efbcc
improve api_schema module structure
2019-02-17 10:16:33 +01:00
Dietmar Maurer
dc9a007b11
rename src/api to src/api_schema
2019-02-17 09:59:20 +01:00
Dietmar Maurer
5ddf8cb10a
cleanup auth code, verify CSRF prevention token
2019-02-16 15:52:55 +01:00
Dietmar Maurer
d4736445fe
server/rest.rs: add method to log message
2019-02-15 10:16:12 +01:00
Dietmar Maurer
44c00c0dfd
server/rest.rs: log full error messages
2019-02-15 09:55:12 +01:00
Dietmar Maurer
7171b3e079
server/rest.rs: use a protocol extension to avoid double log
...
Instead of modifying the response header itself.
2019-02-14 16:04:24 +01:00
Dietmar Maurer
7e03988caf
avoid double logging of proxied requests
2019-02-14 13:28:41 +01:00
Dietmar Maurer
78a1fa6722
src/server/rest.rs: log failed requests
2019-02-14 13:07:34 +01:00
Dietmar Maurer
0dffe3f99a
src/client/http_client.rs: try to login
...
use an environment var to store passphrase (PBS_PASSWORD)
2019-02-13 14:31:43 +01:00
Wolfgang Bumiller
e937034c86
remove some rather inconvenient debug output
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-04 15:34:38 +01:00
Dietmar Maurer
4b2cdeb9a6
implement relead_timezone flag
2019-02-01 10:04:46 +01:00
Dietmar Maurer
a154a8e8a4
delay unauthorized request (rate limit)
2019-01-31 14:34:21 +01:00
Dietmar Maurer
5996577ab6
move http error class to router.rs
2019-01-31 13:22:30 +01:00