[pbs-devel] [PATCH proxmox-backup 07/17] api-types: add config options for LDAP user sync

Lukas Wagner l.wagner at proxmox.com
Mon Jan 9 14:58:42 CET 2023


On 1/4/23 14:40, Wolfgang Bumiller wrote:
>> +#[derive(Serialize, Deserialize, Updater, Default, Debug)]
>> +#[serde(rename_all = "kebab-case")]
>> +/// Default options for LDAP synchronization runs
>> +pub struct SyncDefaultsOptions {
>> +    /// How to handle vanished properties/users
>> +    pub remove_vanished: Option<String>,
> 
> ^ Should be possible to actually use `RemoveVanished` as a type here?
> (and replace `schema: REMOVE_..` with `type: RemoveVanished,` in the
> `#[api]` block.
> 

remove-vanished is actually an array: `remove-vanished=acl;entries;properties`

Not sure if I'm missing something, but I think your approach would not for for
something like this?

The whole sync-defaults-options configuration key is a bit weird to handle due
to these nested property-string, for example:

   sync-defaults-options enable_new=true remove-vanished=acl;entries

Took me a while to get these to parse/validate correctly :)

>> +const USER_CLASSES_TEXT: &str = "Comma-separated list of allowed objectClass values for user synchronization. \
>> +For instance, if ``user-classes`` is set to ``person,user``, then user synchronization will consider all LDAP entities
>> +where ``objectClass: person`` `or` ``objectClass: user``.";
> 
> ^ seems to need reformatting (100 char limit)
> 

Thanks, I probably rely a bit too much on rustfmt - which of course does
not touch multi-line strings.

-- 
- Lukas





More information about the pbs-devel mailing list