Commit Graph

1707 Commits

Author SHA1 Message Date
Fabian Grünbichler
64959d9ae0 move common metadata to workspace
and switch all crates to 2021 edition as well as a unified "authors" value.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:25 +01:00
Fabian Grünbichler
5ec765f842 update d/control files
debcargo 2.6 changed some minor details

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-06 11:21:43 +01:00
Wolfgang Bumiller
6a3a3f0413 use statement fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-05 14:11:16 +01:00
Fabian Grünbichler
538578c558 clippy 1.65 fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-05 11:17:37 +01:00
Fabian Grünbichler
50aa62b764 proxmox-schema: bump to 1.3.5
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-01 11:10:01 +01:00
Fabian Grünbichler
30388b7256 schema: update to textwrap 0.16
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-01 11:06:41 +01:00
Wolfgang Bumiller
d513ef7836 bump proxmox-section-config to 1.0.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-28 09:30:03 +01:00
Wolfgang Bumiller
c39d04c33e minor doc fixup
an 'ignore' block assumes rust syntax, a 'text' block should
just be plain text

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-11-28 09:27:28 +01:00
Fiona Ebner
0cd0d16c1e section config: support allowing unknown section types
Similar to commit c9ede1c ("support unknown types in section config")
in pve-common.

Unknown sections are parsed as String-JSON String key-value pairs
without any additional checks and also written as-is.

Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-28 09:19:05 +01:00
Thomas Lamprecht
bb7519af3b subscription: recognize 'Suspended' status
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-25 09:53:58 +01:00
Wolfgang Bumiller
208d4ffac6 bump proxmox-section-config to 1.0.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-24 14:07:30 +02:00
Wolfgang Bumiller
c8f26ee0ea section-config: expose order
we already expose the raw sections which are sometimes
easier to use, but we don't expose the order at all this way
otherwise

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-24 13:45:58 +02:00
Wolfgang Bumiller
b4a798f0a7 section-config: use Vec for section order
We use none of the additional functionality provided by
VecDeque.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-24 13:44:23 +02:00
Fiona Ebner
3b2b1214b3 section config: parse additional properties when schema allows it
Additional properties will be parsed according to the default string
schema.

This is relevant for use cases when the full schema is not known for
some reason or another. In particular this allows support for parsing
older/newer versions of configuration files. One example of this is
the proposed proxmox-mail-forward helper binary, which currently
doesn't have access to the PBS API types for dependency reasons and
is only interested in the email field for the root user. If it can
only use a minimal schema with additional_properties set to true, it
will be robust against changes.

Writing already works, because the ObjectSchema's verify_json()
already handles additional_properties correctly and
format_section_content() handles them like all other properties
(method doesn't depend on the schema).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-10-24 13:35:50 +02:00
Wolfgang Bumiller
cfa77e0e88 sys: impl AsFd for PTY
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 14:36:45 +02:00
Wolfgang Bumiller
34688a6d74 sys: impl AsFd for PidFd
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 14:35:07 +02:00
Wolfgang Bumiller
34f47339d5 bump sys to 0.4.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 14:21:08 +02:00
Fabian Grünbichler
7b350d3e43 proxmox-http: fix last changelog entry
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-10-19 14:17:42 +02:00
Wolfgang Bumiller
ab17fdb4d9 sys: deprecate RawFdNum
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 13:55:47 +02:00
Wolfgang Bumiller
88677d8955 sys: add From<OwnedFd/Fd> for Fd/OwnedFd temporarily
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 13:50:17 +02:00
Wolfgang Bumiller
8bd961acdc rest-server: update to OwnedFd
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 13:25:40 +02:00
Wolfgang Bumiller
8420c266af sys: deprecate Fd, add its methods as module functions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 13:25:40 +02:00
Wolfgang Bumiller
85c260f6b5 sys: deprecate BorrowedFd
std has this now, stable since 1.63

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-19 10:55:16 +02:00
Wolfgang Bumiller
b039bf011b bump edition in rustfmt.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-13 15:00:28 +02:00
Thomas Lamprecht
7c7e2f886c rest-server: add packaging and bump to 0.2.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-10-11 15:09:50 +02:00
Thomas Lamprecht
bd00e2f317 cargo: rest-server: set license property
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-10-11 15:09:44 +02:00
Thomas Lamprecht
a7122eb99e Merge remote-tracking branch 'proxmox-rest-merge/master'
split out from proxmox-backup using `git filter-repo` including
history with the following --paths-from-file:

```
proxmox-rest-server
src/api/server.rs
src/server/command_socket.rs
src/server/config.rs
src/server/environment.rs
src/server/formatter.rs
src/server/h2service.rs
src/server/rest.rs
src/server/state.rs
src/tools/compression.rs
src/tools/daemon.rs
src/tools/file_logger.rs
src/worker_task.rs
```
2022-10-11 15:09:28 +02:00
Fabian Grünbichler
95f7232188 cargo fmt
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-10-11 09:48:11 +02:00
Fabian Grünbichler
28e30719e8 clippy fixes
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-10-11 09:48:04 +02:00
Fabian Grünbichler
2ae95b5f4e metrics: bump to 0.2.1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 14:49:35 +02:00
Fabian Grünbichler
2502d691b6 subscription: bump to 0.3.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 14:49:35 +02:00
Fabian Grünbichler
916aa8a2db update proxmox-router to 1.3.0
no real change for PBS usage - the ApiHandler enum is marked
non_exhaustive now because it has extra values if the new (enabled by
default) "server" feature is enabled.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 14:17:12 +02:00
Fabian Grünbichler
e8d199d51c update to proxmox-http 0.7
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 14:17:00 +02:00
Fabian Grünbichler
a6e03dfe42 subscription: properly forward verification error
when verifying the server response used for offline mirror keys.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 13:06:02 +02:00
Fabian Grünbichler
d55816e9dd subscription: use lowercase for Display-ing status 2022-09-07 13:05:42 +02:00
Fabian Grünbichler
31f1bbbf40 subscription: properly alias 'notfound'
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 13:05:42 +02:00
Fabian Grünbichler
f908f216ae subscription: conditionalize checks
signed subscription info files should always be checked to catch
attempts of invalid signatures, but the age and serverid checks only
need to apply to "active" files, else the status might switch from a
more meaningful one to "invalid" by accident.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 13:05:42 +02:00
Fabian Grünbichler
4beac11b34 subscription: add Expired status
this can be returned by the shop when checking an online subscription.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 13:05:42 +02:00
Fabian Grünbichler
5b90667d05 http: bump to 0.7.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:35:51 +02:00
Fabian Grünbichler
08a6d56eae http: client_trait: make request body generic
like the response body, instead of hard-coding Read.
2022-09-07 09:25:47 +02:00
Fabian Grünbichler
891dcfda2f http: add extra_headers to post
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
ec77785578 http: sync: add HttpClient for Box<dyn Read>
for use cases where the full request body is not available from the
start, or the response doesn't need to be fully read in one go.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
00f5eca155 http: make post() take Read, not &str
for more flexibility.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
7863eff2a5 http: fix typo
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
da49b98d15 http: rename SimpleHttp to Client
so we have proxmox_http::client::Client for the async, hyper-based
client and proxmox_http::client::sync::Client for the sync, ureq-based
one.

this is a breaking change.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
7ffb895062 http: add "raw" sync client
and switch String one over to use it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
9c444d7a94 http: add ureq-based sync client
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
f429fcb592 http: extend HttpClient trait
to allow get requests with extra headers (such as `Authorization`) and a
generic `request` fn to increase flexibility even more.

this is a breaking change.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
ab5d5b39f6 http: move SimpleHttpOptions to http-helpers feature
and rename it to HttpOptions, since it's not specific to the "Simple"
client at all.

this is a breaking change.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00
Fabian Grünbichler
e8d02db689 router: bump to 1.3.0
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-07 09:17:45 +02:00