Commit Graph

1757 Commits

Author SHA1 Message Date
Wolfgang Bumiller
6dcdbd2bd1 bump proxmox-rest-server to 0.2.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-10 10:42:40 +01:00
Lukas Wagner
d696ad5bd1 rest-server: add handle_worker from backup debug cli
The function has now multiple users, so it is moved
here.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-10 10:23:41 +01:00
Wolfgang Bumiller
e8e8f83723 ldap: fixup d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-08 14:30:52 +01:00
Wolfgang Bumiller
870be885ed ldap: drop Ldap prefix from types that have it
for a bit more consistency and since we tend to repeat stuff
too much

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-08 14:29:12 +01:00
Wolfgang Bumiller
4ff5c59559 fix 'default-features = false' for ldap3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-08 14:26:34 +01:00
Wolfgang Bumiller
cd61c8741c ldap: clippy fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-02-08 14:15:44 +01:00
Lukas Wagner
1db057e189 ldap: add debian packaging
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-08 14:11:24 +01:00
Lukas Wagner
582e994cca ldap: tests: add LDAP integration tests
This commit adds integration tests to ensure that the crate works as intended.
The tests are executed against a real LDAP server, namely `glauth`. `glauth` was
chosen because it ships as a single, statically compiled binary and can
be configured with a single configuration file.

The tests are written as off-the-shelf unit tests. However, they are
 #[ignored] by default, as they have some special requirements:
   * They required the GLAUTH_BIN environment variable to be set,
     pointing to the location of the `glauth` binary. `glauth` will be
     started and stopped automatically by the test suite.
   * Tests have to be executed sequentially (`--test-threads 1`),
     otherwise multiple instances of the glauth server might bind to the
     same port.

The `run_integration_tests.sh` checks whether GLAUTH_BIN is set, or if
not, attempts to find `glauth` on PATH. The script also ensures that the
tests are run sequentially.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-08 14:11:21 +01:00
Lukas Wagner
4488256cb1 ldap: allow searching for LDAP entities
This commit adds the search_entities function, which allows to search for
LDAP entities given certain provided criteria.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-08 14:11:18 +01:00
Lukas Wagner
b9ab0ba4fa ldap: add helpers for constructing LDAP filters
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-08 14:11:15 +01:00
Lukas Wagner
6fd77c9a5e ldap: add basic user auth functionality
In the LDAP world, authentication is done using the bind operation, where
users are authenticated with the tuple (dn, password). Since we only know
the user's username, it is first necessary to look up the user's
domain (dn).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-08 14:11:12 +01:00
Lukas Wagner
0e2f88ccf3 ldap: create new proxmox-ldap crate
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-02-08 14:11:08 +01:00
Thomas Lamprecht
fbac2f0a0c sys: fixup error types handling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-02 16:32:37 +01:00
Thomas Lamprecht
ce389914ff sys: cope with unavailable KSM sharing info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-02 16:12:20 +01:00
Wolfgang Bumiller
2cebe420c1 bump proxmox-time to 1.1.5-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-01-12 14:23:11 +01:00
Wolfgang Bumiller
fadf7f7bd8 re-add proxmox-uuid d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-01-12 14:22:52 +01:00
Wolfgang Bumiller
78d9b156a8 bump proxmox-uuid to 1.0.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-01-12 13:49:18 +01:00
Fabian Grünbichler
9c44e9b410 update d/control files
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 12:17:00 +01:00
Fabian Grünbichler
3046e2f285 bump proxmox-rest-server to 0.2.1-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 12:15:14 +01:00
Fabian Grünbichler
30ae33a31d bump proxmox-shared-memory to 0.2.3-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 12:13:53 +01:00
Fabian Grünbichler
40cb468bef bump proxmox-router to 1.3.1-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 12:10:00 +01:00
Fabian Grünbichler
d0c1958f86 bump proxmox-schema to 1.3.6-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 12:08:58 +01:00
Fabian Grünbichler
01e9b3affc bump proxmox-sys to 0.4.2-1
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 12:07:45 +01:00
Fabian Grünbichler
ff9aa2012e update nix to 0.26
it's the version currently shipped by bookworm, so let's unify this widely-used
dependency to make bootstrapping easier.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 12:07:16 +01:00
Fabian Grünbichler
6953154254 update d/control
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-01-05 11:49:03 +01:00
Dietmar Maurer
78e86f3261 re-add epoch_to_rfc3339_utc on wasm target
This was lost in commit 980d6b26df.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2022-12-15 13:35:53 +01:00
Fabian Grünbichler
acaf55c437 clippy fix
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-13 14:56:42 +01:00
Fabian Grünbichler
6eb638c806 section-config: silence clippy
these two functions don't actually use the `type_name` parameter, but the
interface including custom formatters require it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-13 14:53:28 +01:00
Fabian Grünbichler
77ac0bd5fe section-config: make ReST dump reproducible
HashMaps are not ordered, so each package build containing a section config
dump would have the documentation ordered randomly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-13 14:51:50 +01:00
Fiona Ebner
cb2646c7b4 section config: fix handling array schema in unknown sections
Mostly relevant when the config is written out again after parsing it
with unknown sections. Previously, with duplicate keys, only the last
value would be saved. Now, duplicate keys are assumed to be part of
an array schema and handled as such.

Because the unknown section parsing does not know if a certain
property does actually have an array schema, it's not possible to
detect duplicate keys for non-array-schema properties, and if a
property with array-schema shows up only once, it will not be saved as
a Value::Array, but a Value::String.

Writing, or to be precise the format_section_content methods, already
handle Value::Array, so don't need to be adapted.

Fixes: 0cd0d16 ("section config: support allowing unknown section types")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-12-12 14:03:26 +01:00
Fiona Ebner
e97f41e290 section config: add test for array schema
where duplicate keys are allowed.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-12-12 14:03:23 +01:00
Wolfgang Bumiller
aaf4b72839 deps: bump api-macro to current version
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-12 11:51:08 +01:00
Wolfgang Bumiller
7bc85c05c9 bump proxmox-api-macro to 1.0.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-12 11:34:18 +01:00
Wolfgang Bumiller
38a60d3acb api: support #[default] attribute
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-12 11:34:18 +01:00
Fabian Grünbichler
0719e1db1c update/extend README.rst
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-12 11:05:30 +01:00
Fabian Grünbichler
ee8419cf2d workspace: switch remaining dependencies
while these are (currently) only used by a single member each, having *all*
dependency versions specified in the top level Cargo.toml only makes the whole
process of managing them less error-prone.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-12 11:05:30 +01:00
Fabian Grünbichler
1380182538 update d/control
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-12 11:05:30 +01:00
Wolfgang Bumiller
2610208794 io: add boxed module for boxed bytes like vec::zeroed...
- proxmox_io::boxed::uninitialized(len) -> Box<[u8]>
  same as vec::uninitialized, but as a box

- proxmox_io::boxed::zeroed(len) -> Box<[u8]>
  same as vec::zeroed, but as a box

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-12 11:00:22 +01:00
Wolfgang Bumiller
a7d84effc5 io: deny unsafe_op_in_unsafe_fn
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-12 11:00:22 +01:00
Fabian Grünbichler
8316fd3899 more workspace dependencies
regex was missed in the first pass, and two intra-workspace dev-dependencies as
well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-12 09:30:30 +01:00
Fabian Grünbichler
485ed1a2a2 switch exclude to workspace in README
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-09 13:31:51 +01:00
Wolfgang Bumiller
d3f2a86f80 buildsys: get crate list via cargo metadata in Makefile
so we don't have to keep this in sync manually

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-09 13:18:23 +01:00
Fabian Grünbichler
e6d1e6440d add bump.sh
for bumping crates in this workspace (it requires cargo-edit being installed).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 10:36:27 +01:00
Fabian Grünbichler
de6a59289a proxmox-time: drop TryFrom use statement
no longer needed with edition 2021

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:47 +01:00
Fabian Grünbichler
46a675830d update d/control files
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:47 +01:00
Fabian Grünbichler
48abc5afa3 update outdated workspace dependencies
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:47 +01:00
Fabian Grünbichler
bdca6de588 update d/control files
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:47 +01:00
Fabian Grünbichler
e5abc0590e define workspace dependencies in workspace
so that we no longer have to (or forget to) bump the version in multiple places.

notable changes:
- outdated versions have been unified
- proxmox-metrics -> proxmox-async no longer uses explicit empty features
  (proxmox-async doesn't provide any anyway)
- proxmox-subscription -> proxmox-http no longer uses explicit default_features
  = false (proxmox-http has an empty default feature anyway)
- missing path dependencies added (mainly proxmox-rest-server)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:38 +01:00
Fabian Grünbichler
6c161bd5ab update d/control files
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:38 +01:00
Fabian Grünbichler
4189221470 inherit shared, external dependencies
noteworthy changes:
- proxmox-http had a default_features_false dep on hyper, which is dropped (the
  default feature is empty anyway)
- hyper, libc, nix, tokio and url versions are unified
- missing (cosmetic) bindgen feature on zstd enabled everywhere

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-12-07 09:48:38 +01:00