proxmox/proxmox-tfa/Cargo.toml
Fabian Grünbichler 289d297c7d build: use weak and namespaced features
to reduce the creep of optional dependencies being exposed as features.

this requires cargo 0.63 (and debcargo built against at least that
version), but greatly reduces the number of binary packages and provides
generated, while still allowing sensible selection of optional
dependencies via the explicit feature meant for pulling them in.

diff stat for running `make  deb` after this change:
 proxmox-http/debian/control         | 226 ++++--------------------------------
 proxmox-router/debian/control       |  74 +-----------
 proxmox-schema/debian/control       |  53 ++-------
 proxmox-subscription/debian/control |  17 +--
 proxmox-sys/debian/control          |  51 +++-----
 proxmox-tfa/debian/control          | 110 ++----------------
 6 files changed, 72 insertions(+), 459 deletions(-)

the 'dep:' prefix marks something on the RHS inside the features section
as dependency, it's only allowed if the string after it is an optional
dependency an no explicit feature of the same name exists. if all
pointers to the optional dependency in the features section are marked
as such, the optional dependency itself will not be exposed as a feature
(either on the cargo or debian/control level).

the '?' suffix marks dependencies as "weak", which only enables the
optional dependency + its feature(s) if the optional dependency itself
is also enabled. it has no effect on d/control since such a relationship
is not encodable in Debian package relations, but it does affect cargo
dependency resolution and allows skipping the build of unneeded optional
dependencies in some cases.

with no packages/crates depending on the no longer exposed automatically
generated features/packages, so these are safe to remove even though
it's technically a breaking change.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-08-26 10:35:00 +02:00

34 lines
978 B
TOML

[package]
name = "proxmox-tfa"
version = "2.1.0"
authors = ["Proxmox Support Team <support@proxmox.com>"]
edition = "2021"
license = "AGPL-3"
description = "tfa implementation for totp and u2f"
exclude = [ "debian" ]
[dependencies]
anyhow = "1.0"
base32 = "0.4"
base64 = "0.13"
hex = "0.4"
openssl = "0.10"
percent-encoding = "2.1"
serde = "1.0"
serde_plain = "1.0"
serde_json = { version = "1.0", optional = true }
libc = { version = "0.2", optional = true }
url = "2.2"
proxmox-schema = { version = "1", path = "../proxmox-schema", features = [ "api-macro" ], optional = true }
proxmox-time = { version = "1", path = "../proxmox-time", optional = true }
proxmox-uuid = { version = "1", path = "../proxmox-uuid", optional = true }
webauthn-rs = { version = "0.3", optional = true }
[features]
default = []
u2f = [ "dep:libc", "dep:serde_json", "serde/derive" ]
api = [ "u2f", "dep:webauthn-rs", "dep:proxmox-uuid", "dep:proxmox-time" ]
api-types = [ "dep:proxmox-schema" ]