254 Commits

Author SHA1 Message Date
Wolfgang Bumiller
2cc9163892 pve: add tfa api
This consists of two parts:

1) A proxmox_tfa_api module which temporarily lives here but
   will become its own crate.

   Most of this is a copy from ' src/config/tfa.rs with some
   compatibility changes:
   * The #[api] macro is guarded by a feature flag, since we
     cannot use it for PVE.
   * The Userid type is replaced by &str since we don't have
     Userid in PVE either.
   * The file locking/reading is removed, this will stay in
     the corresponding product code, and the main entry
     point is now the TfaConfig object.
   * Access to the runtime active challenges in /run is
     provided via a trait implementation since PVE and PBS
     will use different paths for this.
   Essentially anything pbs-specific was removed and the
   code split into a few submodules (one per tfa type
   basically).

2) The tfa module in pve-rs, which contains:
   * The parser for the OLD /etc/pve/priv/tfa.cfg
   * The parser for the NEW /etc/pve/priv/tfa.cfg
   * These create a blessed PVE::RS::TFA instance which:
     - Wraps access to the TfaConfig rust object.
     - Has methods all the TFA API call implementations
       These are copied from PBS' src/api2/access/tfa.rs,
       and pbs specific code removed.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 12:02:53 +01:00
Wolfgang Bumiller
9bc3ab23cb move apt to /perl-apt, use PERLMOD_PRODUCT env var
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 08:59:43 +01:00
Wolfgang Bumiller
1ae868ad78 import pve-rs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 08:56:38 +01:00
Wolfgang Bumiller
50754a46aa import basic skeleton
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-09 08:54:06 +01:00