assets_guardian.plugins.gitlab.mapperο
Classes
|
Mapper for GitLab. |
- class assets_guardian.plugins.gitlab.mapper.GitlabMapper(instance_id: str)[source]ο
Bases:
IMapperMapper for GitLab.
Transforms raw data from the GitLab API (via python-gitlab or directly) into normalized data models of the Assets Guardian domain.
Initializes the mapper.
- Parameters:
instance_id β Identifier of the source GitLab instance.
- to_access(raw_data: Any, asset: Asset | None = None, user_info: dict[str, Any] | None = None) Access[source]ο
Converts raw GitLab permission data into an Access object.
- Parameters:
raw_data β Raw permission/member data (dict).
asset β The asset (Project or Group) to which this access relates.
user_info β Optional user information (dict).
- Returns:
An Access instance.
- to_asset(raw_data: Any, asset_type: str = 'unknown') Asset[source]ο
Converts raw GitLab project or group data into an Asset object.
- Parameters:
raw_data β Raw project or group data (dict).
asset_type β Asset type (βprojectβ or βgroupβ).
- Returns:
An Asset instance.
- to_identity(raw_data: Any, accesses: list[Access] | None = None) Identity[source]ο
Converts raw GitLab user data into an Identity object.
- Parameters:
raw_data β Raw user data (dict).
accesses β Optional list of accesses already collected for this user.
- Returns:
An Identity instance.
- property instance_id: strο
Instance identifier.
- property source_name: strο
Source name.