Skip to main content

Manage big GitLab groups with automation.

Project description

gitlab_usermgmt

Pypi Status CICD Pipeline Status Coverage Documentation

Manage big GitLab groups with automation.

Features

  • lists all user access rights for a group inclusive all subgroups and projects
  • compares user access rights to a access_definition.json file
    • if a user has access to a group or project, that access will be removed
    • if a user access level is to high or to low, it will be changed as defined
    • if a user as no access, but should have access as defined, he will be added
  • if you only want to manage owners and maintainers you can do so
  • applies findings of comparison to the GitLab API to enforce your definitions

Usage

Install gitlab_usermgmt.:

pip install gitlab-usermgmt

Write the user access list. Assuming you have your GitLab Token in the env var:

gitlab_usermgmt --list_users --group_id 7266413 --gitlab_token $GITLAB_TOKEN

The generates users.json can be compared to a access_definition.json file which must be located in the same directory.:

gitlab_usermgmt --compare_access

This generates a users_compared.json file. That file can be used to enforce access rights at your GitLab group.

If you manage the access rights in the access_definitions.json file you do not want expire dates removing your users. You can remove expire dates by applying::

gitlab_usermgmt --remove_expire_dates

If you only want to manage owners and maintainers of groups and let those users manage normal developers on their own you can disable the removal of non-admins::

gitlab_usermgmt --manage_admins_only

To apply the changes from the users_compared.json file execute::

gitlab_usermgmt --gitlab_token $GITLAB_TOKEN --apply_access

See full usage documentation for information on the required config files.

Roadmap

  • create issues for expiring users
  • add information about usergroups to individual groups and projects
  • add the possibility to only manage access rights for owners and maintainers

History

0.4.0 (2020-03-29)

  • feat(remove_expire_date): add functionality to remove expires_at entries
  • feat(manage_admins): added manage_admins_only functionality
  • fix(cli): now the long argument versions are parsed properly

0.3.3 (2020-03-22)

  • fix: now the pip version uses the correct version of python-gitlab

0.3.2 (2020-03-21)

  • fix: users that have access but aren’t defined in the access list will now be removed

0.3.0 (2020-03-21)

0.2.0 (2020-03-12)

0.1.0 (2020-02-15)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gitlab-usermgmt, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size gitlab_usermgmt-0.4.0-py2.py3-none-any.whl (10.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size gitlab_usermgmt-0.4.0.tar.gz (21.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page