Commit Graph

25 Commits

Author SHA1 Message Date
Thomas Lamprecht
f4868ff519 tree-wide: check in d/control meta changes for newer debcargo
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-26 14:44:33 +01:00
Wolfgang Bumiller
d6e86d670b tree-wide: unify workspace inherited attributes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-20 08:42:45 +02:00
Wolfgang Bumiller
c6fd5604df access-control: bump to 0.2.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-09-05 14:25:49 +02:00
Maximiliano Sandoval
0157b6fdea access-control: acl: add indentation to docs
Fixes:

warning: doc list item missing indentation
   --> proxmox-access-control/src/acl.rs:518:9
    |
518 |     /// -- user/token is more specific than group at each level
    |         ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
    = note: `#[warn(clippy::doc_lazy_continuation)]` on by default
help: indent this line
    |
518 |     ///   -- user/token is more specific than group at each level
    |         ++

warning: doc list item missing indentation
   --> proxmox-access-control/src/acl.rs:519:9
    |
519 |     /// -- roles lower in the tree are more specific than those higher up along the path
    |         ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
    |
519 |     ///   -- roles lower in the tree are more specific than those higher up along the path
    |         ++

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-08-28 13:09:15 +02:00
Wolfgang Bumiller
45a1e580c8 access-control: bump to 0.2.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-22 09:05:28 +02:00
Wolfgang Bumiller
fee00addab access-control: add init_user_config() method
So that we can make sure root@pam exists at the product level.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-22 09:03:56 +02:00
Wolfgang Bumiller
140fc0ad08 access-control: cleanup use statements
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-22 09:03:56 +02:00
Maximiliano Sandoval
72ab48eb55 fix typos in rust api documentation
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-07-22 08:49:42 +02:00
Wolfgang Bumiller
bf02bebbac access-control: bump to 0.2.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-11 14:47:30 +02:00
Wolfgang Bumiller
9ec5a48701 access-control: bump to 0.2.0
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-04 14:33:42 +02:00
Wolfgang Bumiller
e8b5ad6b45 access-control: use ConfigDigest for digests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-04 14:31:24 +02:00
Wolfgang Bumiller
0652d81977 tree-wide: enable doc_cfg and doc_auto_cfg for docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-02 11:59:53 +02:00
Maximiliano Sandoval
229cc6ae02 acl: directly return struct rather than a binding
Fixes the following clippy warning:

warning: returning the result of a `let` binding from a block
   --> proxmox-access-control/src/acl.rs:687:13
    |
686 |             let config = TestAcmConfig { roles };
    |             ------------------------------------- unnecessary `let` binding
687 |             config
    |             ^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
686 ~
687 ~             TestAcmConfig { roles }
    |

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
cb4acf6d93 use contains_key instead of .get().is_{some, none}()
Fixes the clippy lints:

warning: unnecessary use of `get("lo").is_none()`
   --> proxmox-network-api/src/config/parser.rs:603:30
    |
603 |         if config.interfaces.get("lo").is_none() {
    |            ------------------^^^^^^^^^^^^^^^^^^^
    |            |
    |            help: replace it with: `!config.interfaces.contains_key("lo")`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
    = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Wolfgang Bumiller
2f77909a6d access-control: bump to 0.1.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:56:31 +02:00
Wolfgang Bumiller
c547ea07ae access-control: bump to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:45:52 +02:00
Wolfgang Bumiller
4197c0e26e access-control: minor code cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:42:43 +02:00
Wolfgang Bumiller
5daf898b14 access-control: cleanup comment in Cargo.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:42:43 +02:00
Shannon Sterz
46d8423d72 access-control: split crate in default and impl features
this way the types defined in this crate can be re-used in places
without necessarily having to use the ACL, token shadow and
(cached) user config implementations.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 14:42:43 +02:00
Shannon Sterz
1dc88b5e3c access-control: move to flatten User into UserWithToken
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 14:42:41 +02:00
Shannon Sterz
48bd72763f access-control: increment user cache generation when saving acl config
since `CachedUserInfo` takes care of both, the user config and the acl
config, we need to also bump the cache generation when storing the
acl config.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 14:42:39 +02:00
Shannon Sterz
84537a02b1 access-control: factor out user config handling
this commit factors out the user config. it also add two new functions
to the `AccessControlConfig` trait to handle caching in a more
generalized way.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 13:38:56 +02:00
Shannon Sterz
ed6a17cec9 access-control: make token shadow implementation re-usable
this commit factors out the token shadow implementation from
`proxmox-backup` so it can be used in other products.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 13:38:54 +02:00
Shannon Sterz
47eeecf711 access-control: define User, UserWithTokens and ApiTokens types
these types are used by the user config in `proxmox-backup` server.
this commit factors them out so we can re-use them in other products
as well as this crate.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 13:38:52 +02:00
Shannon Sterz
86ffeef24a access-control: add the proxmox-access crate to reuse acl trees
this commit factors out the acl tree from proxmox-backup so we can
re-use it accross other products. to use it, the product needs to
implement the `AcmConfig` trait and provide this crate with a
location to safe its configuration files.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 13:38:50 +02:00