assets_guardian.plugins.dolibarr.collectorο
Classes
|
Dolibarr Collector. |
- class assets_guardian.plugins.dolibarr.collector.DolibarrCollector(client: Any, instance_config: dict[str, Any])[source]ο
Bases:
CollectorDolibarr Collector.
ARCH-LIMIT: The Collector base class assumes that collect_identities(), collect_assets() and collect_accesses() are independent. For Dolibarr, accesses (groups and permissions) require N+1 calls per user. Therefore, we completely override these three methods and share an assets cache to avoid redundant calls.
Initializes the collector with a client and its configuration.
Subclasses must initialize self._repository and self._mapper in their own __init__ (or via properties).
- collect_accesses() list[Access][source]ο
Returns all accesses extracted from identities and groups.
Accesses include: - Group memberships (access_type=βgroupβ) - Direct/effective user permissions (access_type=βmodule_permissionβ) - Permissions granted by groups (access_type=βgroup_permissionβ)
- Returns:
Consolidated list of all Dolibarr accesses.
- Return type:
list[Access]
- collect_assets() list[Asset][source]ο
Collects all Dolibarr groups and critical modules as assets.
- Returns:
List of collected assets (groups and virtual modules).
- Return type:
list[Asset]
- collect_identities() list[Identity][source]ο
Collects all Dolibarr users with their groups and critical permissions.
Each user requires two additional calls: - /users/{id}?includepermissions=1 β module-level permissions - /users/{id}/groups β group memberships
ARCH-LIMIT: This N+1 pattern is not supported by the base class nor by the IRepository interface, which assumes a flat list of accesses.
- Returns:
List of collected identities with their accesses.
- Return type:
list[Identity]
- property instance_id: strο
Unique identifier of the audited instance (e.g., βgitlab.company.comβ).
- property source_name: strο
Name of the source (e.g., βgitlabβ, βmicrosoft365β, βdolibarrβ).