Wolfgang Bumiller
cc520cd4a0
cleanup: remove serde_derive dependency
...
this comes from the 'derive' feature in serde
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-04 11:43:22 +01:00
Fabian Grünbichler
d5c290a824
ignore member crate target dirs as well
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-02-03 11:18:34 +01:00
Wolfgang Bumiller
223d7ed55c
api-macro: let tests depend on api-macro
...
the updater tests require both the trait and the proc macros
to be visible, running tests with `--all-features` prevents
them from being imported from two separate locations as
their names are the same, so let's always include the macro
versions in test cases by depending on the `api-macro`
feature in tests in the api-macro crate
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
9ee0276f13
doc fixup
...
not sure if it's worth looking up that link?
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
dd767723d8
formatting fixups
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
034dd3fe5e
updaters: docs and exports
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
cc065c175d
api-macro: introduce updaters
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
ab06665649
schema: introduce Updatable and Updater traits
...
The `Updatable` trait is our mechanism for "updating"
values. The `Updater` trait is a serde-helper to allow using
`skip_serializing_if` on api type structs which
`#[derive(Updater)]`
All basic types implement `Updatable<Updater = Option<T>>`,
and all `Option<T>` where `T: Updatable` are implicitly also
updatable from `Option<T>`.
With the update to the `#[api]` macro, all `#[api]` types
will implicitly `#[derive(Updatable)]` via the default
implementation (which simply assignes from an
`Option<Self>`), unless they explicitly also
`#[derive(Updater)]` in which case an implementation is
derived which goes through each "field" found in the
updater. To prevent fields from being updatable via an
Updater `#[updater(fixed)]` can be used.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:18 +01:00
Wolfgang Bumiller
237f206235
schema: fix AllOf property iteration for nested objects
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:54:00 +01:00
Wolfgang Bumiller
544c7e7171
schema: support AllOf in ExtractValueDeserializer
...
fixes nested AllOfs in api methods
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-02-03 10:53:33 +01:00
Dietmar Maurer
aad324c38b
bump proxmox to 0.10.1-1
2021-02-03 08:31:40 +01:00
Dietmar Maurer
3b4f6f2d35
cli: improve completion of array arguments
2021-02-03 08:28:27 +01:00
Fabian Grünbichler
dc5b2bebf1
debcargo: fix maintainer directive
...
and remove accidentally committed files
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-02-01 11:26:33 +01:00
Fabian Grünbichler
c94f367dec
clippy: more misc fixes
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-26 09:54:55 +01:00
Fabian Grünbichler
2a16daafdd
allow complex Futures in tower_service impl
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-26 09:53:55 +01:00
Fabian Grünbichler
38df61a621
clippy: fix/allow needless_range_loop
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 16:23:54 +01:00
Fabian Grünbichler
ba81db7848
clippy: us *_or_else with function calls
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 16:23:54 +01:00
Fabian Grünbichler
655ceac1c6
clippy: collapse/rework nested ifs
...
no semantic changes (intended).
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 16:22:59 +01:00
Fabian Grünbichler
724e2f47f9
clippy: use strip_prefix instead of manual stripping
...
it's less error-prone (off-by-one!)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 16:22:59 +01:00
Fabian Grünbichler
28f3b0df9e
clippy: remove unnecessary clones
...
and from::<T>(T)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 16:22:59 +01:00
Fabian Grünbichler
c09d8e1442
clippy: use std::ptr::null
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-20 15:04:49 +01:00
Wolfgang Bumiller
2f7b0872ea
clippy fixups
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-15 14:20:55 +01:00
Fabian Grünbichler
d6874957e3
proxmox 0.10: adapt to moved ParameterSchema
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 16:01:33 +01:00
Fabian Grünbichler
e2e0339966
cleanup: remove unnecessary 'mut' and '.clone()'
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 16:01:33 +01:00
Fabian Grünbichler
c99f950310
tokio 1.0: update to new tokio-openssl interface
...
connect/accept are now happening on pinned SslStreams
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 16:01:33 +01:00
Fabian Grünbichler
d94119efc8
tokio 1.0: delay -> sleep
...
almost the same thing, new name(s), no longer Unpin
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 16:01:33 +01:00
Fabian Grünbichler
d44c032dd5
bump proxmox to 0.10.0-1
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 15:43:19 +01:00
Fabian Grünbichler
586d94947b
bump proxmox-api-macro to 0.3.1-1
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 15:42:54 +01:00
Fabian Grünbichler
8e62cf0600
build: add autopkgtest target
...
which runs the autopkgtests on the built packages.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-14 14:23:45 +01:00
Fabian Grünbichler
43e9cf10af
move ParameterSchema from router to schema
...
it's the place where it belongs, and unbreaks the --no-default-features
build
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-13 13:40:04 +01:00
Wolfgang Bumiller
a5b8f9d340
fix u2f example
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-13 11:29:33 +01:00
Fabian Grünbichler
e05dd0074d
tokio 1.0: drop TimeoutFutureExt
...
tokio's Sleep/Delay/Timeout are no longer Unpin, complicating this
wrapper. we can just use tokio::time::timeout directly as needed..
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
0319030ed9
update to tokio 1.0
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
c65246e9bd
update to rustyline 7
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Fabian Grünbichler
27799ccb6d
Cargo.toml: update to tokio 1.0
...
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-01-12 14:29:19 +01:00
Wolfgang Bumiller
33839410b9
api: tfa management and login
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-11 10:22:32 +01:00
Wolfgang Bumiller
9a290275c3
macro: refactoring
...
purely non-functional changes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-01-05 13:50:55 +01:00
Fabian Grünbichler
4d93fa0666
time: fix parsing non-full-hour TZ offsets
...
and add a test case to avoid regressions in the future.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-12-31 08:26:47 +01:00
Dietmar Maurer
04417d1df5
update control files, fix changelogs
2020-12-22 13:29:09 +01:00
Dietmar Maurer
43e0e6c7de
update proxmox to 0.9.1-1
2020-12-22 13:25:56 +01:00
Stefan Reiter
78aacb67da
add tools::future with TimeoutFutureExt
...
Implements shorthands to automatically cancel a long-running future
after a timeout is reached.
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-12-22 13:24:36 +01:00
Dietmar Maurer
b53de8b7c0
proxmox: correctly depend on proxmox-api-macro 0.3
2020-12-22 08:06:02 +01:00
Dietmar Maurer
f6e7463ec1
bump versions to 0.9.0-1/0.3.0-1
2020-12-22 07:54:32 +01:00
Wolfgang Bumiller
8bb221663e
adaptions for proxmox 0.9 and proxmox-api-macro 0.3
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:31:05 +01:00
Wolfgang Bumiller
630fd801d2
proxmox changelog update
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:27:11 +01:00
Wolfgang Bumiller
a9318a43aa
proxmox: temporary d/changelog update
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:26:29 +01:00
Wolfgang Bumiller
bc0355e582
macro: temporary d/changelog update
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:24:09 +01:00
Wolfgang Bumiller
3d1432a788
schema: ParameterSchema at 'api' level
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:23:33 +01:00
Wolfgang Bumiller
34651099d1
api-macro: support flattened parameters
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:21:43 +01:00
Wolfgang Bumiller
4802e0321b
api-macro: factor parameter extraction into a function
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-12-22 07:21:25 +01:00