]> git.proxmox.com Git - proxmox.git/log
proxmox.git
7 months agobump proxmox-client to 0.3.0-1
Wolfgang Bumiller [Mon, 16 Oct 2023 11:26:51 +0000 (13:26 +0200)]
bump proxmox-client to 0.3.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agohuman-byte: d/control bump
Wolfgang Bumiller [Mon, 16 Oct 2023 11:04:48 +0000 (13:04 +0200)]
human-byte: d/control bump

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agobump proxmox-human-byte to 0.1.2
Wolfgang Bumiller [Mon, 16 Oct 2023 11:03:01 +0000 (13:03 +0200)]
bump proxmox-human-byte to 0.1.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agoHumanByte: make fields public
Dietmar Maurer [Mon, 16 Oct 2023 10:27:28 +0000 (12:27 +0200)]
HumanByte: make fields public

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
7 months agotfa: more optional dependency cleanup
Wolfgang Bumiller [Mon, 16 Oct 2023 07:00:17 +0000 (09:00 +0200)]
tfa: more optional dependency cleanup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agotfa: make totp a feature and mark all optional deps as optional
Wolfgang Bumiller [Mon, 16 Oct 2023 06:58:08 +0000 (08:58 +0200)]
tfa: make totp a feature and mark all optional deps as optional

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 months agoworkspace: set resolver to 2 to silence a warning
Wolfgang Bumiller [Mon, 16 Oct 2023 06:53:35 +0000 (08:53 +0200)]
workspace: set resolver to 2 to silence a warning

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 months agoreplace deprecated X509Extension::new_nid
Wolfgang Bumiller [Tue, 3 Oct 2023 11:45:10 +0000 (13:45 +0200)]
replace deprecated X509Extension::new_nid

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 months agobump proxmox-api-macro to 1.0.6-1
Fabian Grünbichler [Mon, 2 Oct 2023 07:27:45 +0000 (09:27 +0200)]
bump proxmox-api-macro to 1.0.6-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agobump proxmox-sortable-macro to 0.1.3-1
Fabian Grünbichler [Mon, 2 Oct 2023 07:24:18 +0000 (09:24 +0200)]
bump proxmox-sortable-macro to 0.1.3-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agobump proxmox-router to 2.1.1-1
Fabian Grünbichler [Mon, 2 Oct 2023 07:10:12 +0000 (09:10 +0200)]
bump proxmox-router to 2.1.1-1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 months agoupdate to syn 2
Wolfgang Bumiller [Thu, 28 Sep 2023 11:05:29 +0000 (13:05 +0200)]
update to syn 2

This mostly affected attribute parsing (due to the syn::Meta changes).
Also creating `DelimSpan`s for custom-built `syn::Attribute`s is a
bit... ugly.
Upshot: turns out we can drop some helpers in util.rs with the new
`syn::Meta` changes.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 months agorouter: bump env_logger to 0.10 and move to workspace
Wolfgang Bumiller [Thu, 28 Sep 2023 07:59:48 +0000 (09:59 +0200)]
router: bump env_logger to 0.10 and move to workspace

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 months agoclient: fix optional data for errors
Dominik Csapak [Thu, 14 Sep 2023 10:41:30 +0000 (12:41 +0200)]
client: fix optional data for errors

previously we changed the internal type of the 'data' property
from Option<T> to T in the assumption the api always returns
'data:null'.

this is actually only the case when the api call succeeds. in an error
case there is no data property at all.

to fix this issue while behaving the same for 'data:null' we have to
revert to Option<T> for RawApiResponse but instead of always throwing an
error for 'data:null' in 'check' we now try there to deserialize from
Value::Null for T if there was no data. This will succeed for the Type
'()' which was the motivation for the original change.

The only downside is that the RawApiResponse now has a trait bound that
T is deserializeable, but was a requirement for using it anyway
(as there was no other way of constructing it)

Fixes: 271a55f ("client: remove option from inner RawApiResponse")
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
8 months agoschema: bump version to 2.0.1
Thomas Lamprecht [Wed, 20 Sep 2023 09:42:57 +0000 (11:42 +0200)]
schema: bump version to 2.0.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agofix #4162: sys: added `auto-submitted` header to email body
Gabriel Goller [Fri, 8 Sep 2023 13:06:57 +0000 (15:06 +0200)]
fix #4162: sys: added `auto-submitted` header to email body

`Auto-Submitted` is defined in the rfc 5436 [1] and describes how
an automatic response (f.e. ooo replies, etc.) should behave on the
emails. When using `Auto-Submitted: auto-generated` (or any value
other than `none`) automatic replies won't be triggered.

[1]: https://www.rfc-editor.org/rfc/rfc3834.html

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
9 months agorest-server: accept empty body as valid parameters
Dominik Csapak [Thu, 24 Aug 2023 10:22:31 +0000 (12:22 +0200)]
rest-server: accept empty body as valid parameters

technically an empty string is not valid json, but when sending an api
request without any parameters, treating the empty body as an empty
parameter hash instead of an error, makes the the api more robust for
clients

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
9 months agoschema: serialize enum unit variants
Hannes Laimer [Tue, 29 Aug 2023 09:59:16 +0000 (11:59 +0200)]
schema: serialize enum unit variants

... since deserializing them already works

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
9 months agoapt: bump version to 0.10.6-1
Thomas Lamprecht [Tue, 5 Sep 2023 13:22:40 +0000 (15:22 +0200)]
apt: bump version to 0.10.6-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agoapt: use modern format string variables and small style cleanups
Thomas Lamprecht [Tue, 5 Sep 2023 13:19:34 +0000 (15:19 +0200)]
apt: use modern format string variables and small style cleanups

note: not complete, there's other code to check and rework, but I had
this already done so commit it, better than nothing.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agotests: factor out directory cleanup+creation
Thomas Lamprecht [Tue, 5 Sep 2023 10:46:20 +0000 (12:46 +0200)]
tests: factor out directory cleanup+creation

This moves the clean-up to happen up-front. That way one can still
inspect the test data after, e.g., a failed test.

Originally done almost like this in a patch from Fiona [0] that I just
overlooked, but now also factored out, avoid crowding the test code to
much with duplicate code.

[0]: https://lists.proxmox.com/pipermail/pve-devel/2023-June/057136.html

Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agoapt: fixup description for Reef repo
Thomas Lamprecht [Tue, 5 Sep 2023 08:08:59 +0000 (10:08 +0200)]
apt: fixup description for Reef repo

the "main" repo only exists for Quincy to allow an easier transition
from Proxmox VE 7 to Proxmox VE 8, for when the enterprise repo got
added for ceph too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agoapt: add Ceph Reef to standard repo list
Thomas Lamprecht [Mon, 4 Sep 2023 15:14:19 +0000 (17:14 +0200)]
apt: add Ceph Reef to standard repo list

For now just duplicate the Ceph Quincy entries, as I want to avoid
using macros and we do not yet have support for enums inside enums
with the api macro.

Adapt and expand the tests slightly to have at least some simple
coverage there too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agoapt: unify match-arm for ceph sources.list location
Thomas Lamprecht [Mon, 4 Sep 2023 15:12:31 +0000 (17:12 +0200)]
apt: unify match-arm for ceph sources.list location

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agoapt: tests: allow re-running digest test without clean-up
Thomas Lamprecht [Mon, 4 Sep 2023 15:53:32 +0000 (17:53 +0200)]
apt: tests: allow re-running digest test without clean-up

Files inside CARGO_TARGET_TMPDIR are only cleaned on `cargo clean`, so
tests that expect files to not exist need to cleanup themselves.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agosys: fs: move tests to a sub-module
Lukas Wagner [Mon, 21 Aug 2023 13:44:38 +0000 (15:44 +0200)]
sys: fs: move tests to a sub-module

This ensures that test code is not compiled in regular builds

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
9 months agoproxmox-time: implement epoch_to_rfc3339 for wasm
Dominik Csapak [Mon, 28 Aug 2023 13:30:21 +0000 (15:30 +0200)]
proxmox-time: implement epoch_to_rfc3339 for wasm

we just printed out the UTC version, this implements a localized version

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
9 months agotime: make RFC3339 format in wasm conform to usual format
Dominik Csapak [Mon, 28 Aug 2023 13:29:32 +0000 (15:29 +0200)]
time: make RFC3339 format in wasm conform to usual format

on other targets we print the timestamp without fractional seconds
('.xxxZ'), so we should remove that too on wasm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
9 months agoclient: remove option from inner RawApiResponse
Dominik Csapak [Tue, 29 Aug 2023 12:04:40 +0000 (14:04 +0200)]
client: remove option from inner RawApiResponse

when using the client for an api call that does not return any data
(it returns '{"data":null}'), we would always get an error 'api returned
no data'. The message is technically correct, but it should not be an
error when we expect no data (e.g. most of our CRUD PUT/POST calls)

instead of having the Option<T> in the RawApiResponse type itself, move
it into to the 'nodata' function intended for api calls where we don't
expect any data.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
9 months agoproxmox-client: add post_without_body
Dietmar Maurer [Sun, 27 Aug 2023 14:16:37 +0000 (16:16 +0200)]
proxmox-client: add post_without_body

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
9 months agonotify: make template rendering helpers more robust
Lukas Wagner [Fri, 25 Aug 2023 11:35:57 +0000 (13:35 +0200)]
notify: make template rendering helpers more robust

This commit has the aim of making template rendering a bit more
robust. It does so by a.) Accepting also strings for helpers that
expect a number, parsing the number if needed, and b.) Ignoring errors
if a template helper fails to render a value and showing an error in
the logs, instead of failing to render the whole template (leading
to no notification being sent).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
9 months agobump proxmox-client to 0.2.3-1
Wolfgang Bumiller [Fri, 25 Aug 2023 06:59:06 +0000 (08:59 +0200)]
bump proxmox-client to 0.2.3-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agoclient: fixup checks for api calls not returning data
Wolfgang Bumiller [Fri, 25 Aug 2023 07:02:58 +0000 (09:02 +0200)]
client: fixup checks for api calls not returning data

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agoclient: set content type header on requests
Wolfgang Bumiller [Fri, 25 Aug 2023 06:56:32 +0000 (08:56 +0200)]
client: set content type header on requests

this got lost with the recent refactoring

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agobump proxmox-client to 0.2.2-1
Wolfgang Bumiller [Fri, 25 Aug 2023 06:37:25 +0000 (08:37 +0200)]
bump proxmox-client to 0.2.2-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agoclient: fix content type parsing with included charset
Wolfgang Bumiller [Fri, 25 Aug 2023 06:36:19 +0000 (08:36 +0200)]
client: fix content type parsing with included charset

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agoasync: runtime: Modernise module and update docs
Max Carrara [Mon, 21 Aug 2023 11:37:45 +0000 (13:37 +0200)]
async: runtime: Modernise module and update docs

This commit updates all helper functions, taking into account recent
developments regarding `tokio`.

In particular, the `block_in_place()` and `block_on()` functions now
don't panic anymore if used within the single-threaded `tokio` runtime
and instead behave as expected in both runtime flavours.

Furthermore, because `tokio` may add more runtime flavours in the
future, all helpers will now panic if used within an unsupported
runtime. This is to prevent unforeseen behavioural quirks and
interactions with `tokio` internals.

The above changes make `BlockingGuard` redundant; it is consequently
removed.

The documentation is also updated, describing the behaviour of the
helper functions and the purpose of the `runtime.rs` module in more
detail.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
9 months agoclient/login: clippy fixes
Max Carrara [Mon, 21 Aug 2023 11:48:15 +0000 (13:48 +0200)]
client/login: clippy fixes

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
9 months agobump proxmox-client to 0.2.1-1
Wolfgang Bumiller [Wed, 16 Aug 2023 12:32:06 +0000 (14:32 +0200)]
bump proxmox-client to 0.2.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agopackage proxmox-login 0.1.0-1
Wolfgang Bumiller [Wed, 16 Aug 2023 12:30:38 +0000 (14:30 +0200)]
package proxmox-login 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: convenience helper to get a serialized ticket
Wolfgang Bumiller [Thu, 10 Aug 2023 12:30:31 +0000 (14:30 +0200)]
client: convenience helper to get a serialized ticket

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: expose AuthenticationKind
Wolfgang Bumiller [Thu, 10 Aug 2023 12:27:31 +0000 (14:27 +0200)]
client: expose AuthenticationKind

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: add Client::set_authentication method
Wolfgang Bumiller [Thu, 10 Aug 2023 12:14:06 +0000 (14:14 +0200)]
client: add Client::set_authentication method

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump proxmox-client to 0.2.0-1
Wolfgang Bumiller [Wed, 9 Aug 2023 11:22:14 +0000 (13:22 +0200)]
bump proxmox-client to 0.2.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: add TlsOptions::parse_fingerprint
Wolfgang Bumiller [Thu, 10 Aug 2023 08:43:03 +0000 (10:43 +0200)]
client: add TlsOptions::parse_fingerprint

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: impl HttpApiClient for refs, Arcs and Rcs
Wolfgang Bumiller [Wed, 9 Aug 2023 13:29:00 +0000 (15:29 +0200)]
client: impl HttpApiClient for refs, Arcs and Rcs

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: put requests
Wolfgang Bumiller [Wed, 9 Aug 2023 12:53:39 +0000 (14:53 +0200)]
client: put requests

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: handle response data
Wolfgang Bumiller [Tue, 8 Aug 2023 14:52:11 +0000 (16:52 +0200)]
client: handle response data

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: turn Client inside out
Wolfgang Bumiller [Tue, 8 Aug 2023 09:03:58 +0000 (11:03 +0200)]
client: turn Client inside out

Since the WASM client cannot actually use a `http::Request` the way we
expect it to, that is, it cannot manually along cookies, we turn the
client bit inside out:

This crate mainly defines the `HttpApiClient` trait which expects the
http client to perform *authenticated* API calls, that is, the
handling of API tokens and tickets should happen at the *implementor*
side.

The product clients will require *this* trait to be implemented, and
will not themselves offer a way to login.

As for the `Client` struct, this will now instead *implement* this
trait and will *not* be used in the `wasm` ecosystem. Rather, this is
the ticket handling http client that already exists in the PWT based
ui code.

The PVE client in `pve-api-types` will not *contain* a `Client`
anymore, but rather, it will provide PVE api call implementations for
something implementing `HttpApiClient`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: drop environment and login methods
Wolfgang Bumiller [Mon, 7 Aug 2023 12:25:25 +0000 (14:25 +0200)]
client: drop environment and login methods

The environment trait was useful on the CLI, but does not really
translate well to eg. the wasm ui (or pdm for that matter), so drop it
and instead have `.login` and `.login_tfa` just take the
`proxmox_login` type and handle the updating of authentication data.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: replace Error trait with a type
Wolfgang Bumiller [Mon, 7 Aug 2023 09:55:59 +0000 (11:55 +0200)]
client: replace Error trait with a type

Because we ultimately also want to drop the `Environment` trait since
it is not suitable for all use cases (eg. wasm ui)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: prepare to get rid of Error trait
Wolfgang Bumiller [Mon, 7 Aug 2023 09:19:39 +0000 (11:19 +0200)]
client: prepare to get rid of Error trait

First rename it so it's clear what "Error" refers to in the following
patches.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agologin: add userid and api_url getters
Wolfgang Bumiller [Mon, 7 Aug 2023 09:16:36 +0000 (11:16 +0200)]
login: add userid and api_url getters

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoproxmox-io: fix `sparse_copy` not copying sparsely on irregular read operations
Max Carrara [Mon, 17 Jul 2023 14:19:40 +0000 (16:19 +0200)]
proxmox-io: fix `sparse_copy` not copying sparsely on irregular read operations

In the uncommon circumstance that calls to `read()` end up reading any number of
bytes other than 4096, the subsequently read bytes become misaligned, causing
blocks of zeroes to be written unnecessarily.

To illustrate, imagine you have a 12KiB file:

  [x][x][x][x][ ][ ][ ][ ][x][x][x][x]
   └──4096──┘  └──4096──┘  └──4096──┘

The first and last block are filled with some data, whereas the middle block is
empty and will therefore result in only zeroes being read.

In order for the empty block to be skipped with `seek()`, the entire buffer has
to be filled with zeroes.

If, for example, the first `read()` ends up putting only 3KiB into the buffer,
the empty block in the middle won't be detected properly, as the buffer will
now always contain some data. What results are four misaligned reads:

  [x][x][x][x][ ][ ][ ][ ][x][x][x][x]
   ├─────┘  ├────────┘  ├────────┘  │
   1        2           3           4

This is fixed by ensuring chunks of 4KiB are always read into the buffer,
except when the last block is truncated. In order to prevent frequent small
reads, the incoming reader is also buffered via `io::BufReader`.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
10 months agobump proxmox-ldap to 0.2.1-1
Wolfgang Bumiller [Tue, 8 Aug 2023 12:08:47 +0000 (14:08 +0200)]
bump proxmox-ldap to 0.2.1-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump proxmox-apt to 0.10.5-1
Wolfgang Bumiller [Tue, 8 Aug 2023 12:05:51 +0000 (14:05 +0200)]
bump proxmox-apt to 0.10.5-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoldap: only search base of base_dn when checking connection
Stefan Sterz [Fri, 21 Jul 2023 14:34:03 +0000 (16:34 +0200)]
ldap: only search base of base_dn when checking connection

this should avoid most common size limitations. the search should also
complete quicker as fewer results need to be computed. note that this
way a configuration may be accepted, but the related sync job can
fail due to and exceeded size limit warning for some ldap servers
(such as 2.5.14+dfsg-0ubuntu0.22.04.2).

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
10 months agoldap: add an integration test for `check_connection`
Stefan Sterz [Fri, 21 Jul 2023 14:34:02 +0000 (16:34 +0200)]
ldap: add an integration test for `check_connection`

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
10 months agofix #4868: map missing section field to 'unknown'
Fabian Grünbichler [Tue, 25 Jul 2023 08:31:10 +0000 (10:31 +0200)]
fix #4868: map missing section field to 'unknown'

needed for supporting some third-party repositories.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
10 months agoclippy fix: casting to the same type is unnecessary
Lukas Wagner [Tue, 8 Aug 2023 09:44:54 +0000 (11:44 +0200)]
clippy fix: casting to the same type is unnecessary

See: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: deref on an immutable reference
Lukas Wagner [Tue, 8 Aug 2023 08:01:53 +0000 (10:01 +0200)]
clippy fix: deref on an immutable reference

See:
https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: complex type definitions
Lukas Wagner [Tue, 8 Aug 2023 08:01:52 +0000 (10:01 +0200)]
clippy fix: complex type definitions

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: the following explicit lifetimes could be elided
Lukas Wagner [Tue, 8 Aug 2023 08:01:51 +0000 (10:01 +0200)]
clippy fix: the following explicit lifetimes could be elided

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: useless use of `format!`
Lukas Wagner [Tue, 8 Aug 2023 08:01:50 +0000 (10:01 +0200)]
clippy fix: useless use of `format!`

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: warning: this let-binding has unit value
Lukas Wagner [Tue, 8 Aug 2023 08:01:49 +0000 (10:01 +0200)]
clippy fix: warning: this let-binding has unit value

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: binary comparison to literal `Option::None`
Lukas Wagner [Tue, 8 Aug 2023 08:01:48 +0000 (10:01 +0200)]
clippy fix: binary comparison to literal `Option::None`

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: unnecessary use of `to_string`
Lukas Wagner [Tue, 8 Aug 2023 08:01:47 +0000 (10:01 +0200)]
clippy fix: unnecessary use of `to_string`

See:
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: you should consider adding a `Default` implementation
Lukas Wagner [Tue, 8 Aug 2023 08:01:46 +0000 (10:01 +0200)]
clippy fix: you should consider adding a `Default` implementation

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: this (Default) `impl` can be derived
Lukas Wagner [Tue, 8 Aug 2023 08:01:45 +0000 (10:01 +0200)]
clippy fix: this (Default) `impl` can be derived

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: redundant closure
Lukas Wagner [Tue, 8 Aug 2023 08:01:44 +0000 (10:01 +0200)]
clippy fix: redundant closure

See:
https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: unneeded `return` statement
Lukas Wagner [Tue, 8 Aug 2023 08:01:43 +0000 (10:01 +0200)]
clippy fix: unneeded `return` statement

See:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: needless borrow
Lukas Wagner [Tue, 8 Aug 2023 08:01:42 +0000 (10:01 +0200)]
clippy fix: needless borrow

See:
https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: calls to `drop` with a value that implements `Copy`
Lukas Wagner [Tue, 8 Aug 2023 08:01:41 +0000 (10:01 +0200)]
clippy fix: calls to `drop` with a value that implements `Copy`

Dropping a copy leaves the original intact

See:
https://rust-lang.github.io/rust-clippy/master/index.html#drop_copy

I assume the `drop` was used to silence a 'unused variable' warning,
so I silenced it by other means.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoclippy fix: the borrowed expression implements the required traits
Lukas Wagner [Tue, 8 Aug 2023 08:01:39 +0000 (10:01 +0200)]
clippy fix: the borrowed expression implements the required traits

See: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agoproxmox-login: depend on js_sys on wasm32
Dietmar Maurer [Mon, 7 Aug 2023 10:01:37 +0000 (12:01 +0200)]
proxmox-login: depend on js_sys on wasm32

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
10 months agoadd special impl for epoch_i64() on target_arch="wasm32"
Dietmar Maurer [Mon, 7 Aug 2023 09:54:02 +0000 (11:54 +0200)]
add special impl for epoch_i64() on target_arch="wasm32"

10 months agoclient: drop Send for non-wasm as well on response future
Wolfgang Bumiller [Mon, 7 Aug 2023 09:04:50 +0000 (11:04 +0200)]
client: drop Send for non-wasm as well on response future

To see if it is even still necessary given that it's not a trait
object type where auto traits would need to be explicit...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: rename response future to ResponseFuture
Wolfgang Bumiller [Mon, 7 Aug 2023 08:58:24 +0000 (10:58 +0200)]
client: rename response future to ResponseFuture

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: drop retry logic
Wolfgang Bumiller [Mon, 7 Aug 2023 08:57:38 +0000 (10:57 +0200)]
client: drop retry logic

This should be moved to where we actually need it, not be part of the
generic product client.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoproxmox-client: do not require Send for wasm32 target
Dietmar Maurer [Sat, 5 Aug 2023 07:09:48 +0000 (09:09 +0200)]
proxmox-client: do not require Send for wasm32 target

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
10 months agoproxmox-login: add 'source' impls for errors
Wolfgang Bumiller [Thu, 3 Aug 2023 09:06:33 +0000 (11:06 +0200)]
proxmox-login: add 'source' impls for errors

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump proxmox-api-macro to 1.0.5-1
Wolfgang Bumiller [Thu, 3 Aug 2023 06:24:42 +0000 (08:24 +0200)]
bump proxmox-api-macro to 1.0.5-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoclient: getters for the inner client
Wolfgang Bumiller [Thu, 3 Aug 2023 06:22:42 +0000 (08:22 +0200)]
client: getters for the inner client

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoproxmox-login: fix ticket userid check for PMG quarantine tickets
Dietmar Maurer [Wed, 2 Aug 2023 12:30:04 +0000 (14:30 +0200)]
proxmox-login: fix ticket userid check for PMG quarantine tickets

We simply strip the "@quarantine" at the end.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
10 months agoimport proxmox-client crate
Wolfgang Bumiller [Tue, 1 Aug 2023 13:47:13 +0000 (15:47 +0200)]
import proxmox-client crate

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agoupdate README
Wolfgang Bumiller [Tue, 1 Aug 2023 13:47:20 +0000 (15:47 +0200)]
update README

include repository.workspace=true for the [package] base section

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agologin: improve response handling
Wolfgang Bumiller [Tue, 1 Aug 2023 13:16:07 +0000 (15:16 +0200)]
login: improve response handling

we have use cases where we have bytes, and serde_json has a from_slice
method, doing the utf-8 check unnecessarily is pointless, while going
from &str to &[u8] is free...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump proxmox-notify to 0.2.0
Wolfgang Bumiller [Fri, 28 Jul 2023 09:33:13 +0000 (11:33 +0200)]
bump proxmox-notify to 0.2.0

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agomore import cleanups
Wolfgang Bumiller [Fri, 28 Jul 2023 09:47:09 +0000 (11:47 +0200)]
more import cleanups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agonotify: cleanup all the imports sections
Wolfgang Bumiller [Fri, 28 Jul 2023 09:42:26 +0000 (11:42 +0200)]
notify: cleanup all the imports sections

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump proxmox-router to 2.1.0-1
Wolfgang Bumiller [Fri, 28 Jul 2023 09:26:01 +0000 (11:26 +0200)]
bump proxmox-router to 2.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agohttp-error: add debian packaging and bump as 0.1.0-1
Wolfgang Bumiller [Fri, 28 Jul 2023 09:06:03 +0000 (11:06 +0200)]
http-error: add debian packaging and bump as 0.1.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agonotify: use HttpError from proxmox-http-error
Lukas Wagner [Wed, 26 Jul 2023 14:18:23 +0000 (16:18 +0200)]
notify: use HttpError from proxmox-http-error

Also improve API documentation in terms of which HttpError is
returned when.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agorouter: re-export `HttpError` from `proxmox-http-error`
Lukas Wagner [Wed, 26 Jul 2023 14:18:22 +0000 (16:18 +0200)]
router: re-export `HttpError` from `proxmox-http-error`

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agohttp-error: add new http-error crate
Lukas Wagner [Wed, 26 Jul 2023 14:18:21 +0000 (16:18 +0200)]
http-error: add new http-error crate

Break out proxmox-router's HttpError into it's own crate so that it can
be used without pulling in proxmox-router.

This commit also implements `Serialize` for `HttpError` so that it can
be returned from perlmod bindings, allowing Perl code to access the
status code as well as the message.

Also add some smoke-tests to make sure that the `http_bail` and
`http_err` macros actually produce valid code.

Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agonotify: fix tests if not all features are enabled
Lukas Wagner [Mon, 24 Jul 2023 12:31:25 +0000 (14:31 +0200)]
notify: fix tests if not all features are enabled

Some tests are now disabled if not all required features are enabled.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agonotify: fix build warnings if not all features are enabled
Lukas Wagner [Mon, 24 Jul 2023 12:31:24 +0000 (14:31 +0200)]
notify: fix build warnings if not all features are enabled

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
10 months agobump proxmox-notify to 0.1.0-1, initial release
Wolfgang Bumiller [Mon, 24 Jul 2023 09:05:02 +0000 (11:05 +0200)]
bump proxmox-notify to 0.1.0-1, initial release

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump proxmox-auth-api to 0.3.1
Wolfgang Bumiller [Mon, 24 Jul 2023 09:03:25 +0000 (11:03 +0200)]
bump proxmox-auth-api to 0.3.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
10 months agobump proxmox-section-config to 2.0.0-1
Wolfgang Bumiller [Mon, 24 Jul 2023 09:00:43 +0000 (11:00 +0200)]
bump proxmox-section-config to 2.0.0-1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>