commit | 1d9c579b5ce86adcd2e00476db881dcfaf65f12a | [log] [tgz] |
---|---|---|
author | Dariusz Luksza <dariusz.luksza@gmail.com> | Tue Mar 05 14:23:56 2024 +0000 |
committer | Dariusz Luksza <dariusz.luksza@gmail.com> | Mon May 13 23:17:57 2024 +0100 |
tree | 9a8d855f7b65e80436cfae55ac17633357946fd1 | |
parent | 80a280a847b9981a58c7b9c452568d474f4f30a1 [diff] |
TrackActive: Automatically disable inactive accounts Build on top of the `track-active-users-1.0` (already renamed to `track-and-disable-inactive-users-1.0.groovy) script and add the possibility of automatically disabling inactive accounts after a preconfigured period. The new functionality will mark inactive accounts that are not present in `track-and-disable-inactive.users_cache`. The inactivity period can be controlled by the `users_cache` `maxAge` configuration option. To automatically disable users that are removed from `users_cache` we register a `CacheRemovalListener` that will disable accounts as they are evicted. Additionally, in case of explicit removal, the entry will be re-added. This is to prevent full instance lockdown when `users_cache` is flushed using the SSH command. To test this feature, copy the `admin/track-and-disable-inactive-users-1.0.groovy` into `$gerrit_site/plugins` and add the following configuration to `$gerrit_site/etc/gerrit.config`: [cache "track-and-disable-inactive-users.users_cache"] maxAge = 1min The `CacheRemovalListener` only fires, when the cache is updated. To see any evictions, you would need at least two accounts in Gerrit and make sure that one of them is constantly being used (eg. reloading the web page). Eventually, you should see a log message saying that the other account was disabled. Bug: Issue: 327730872 Change-Id: I34974d842d6f73784d43932b587a6461eaf2ffae
This repository contains a collection of Gerrit scripting plugins that are intended to provide simple and useful extensions.
Gerrit needs to be able to recognise the scripts syntax and being able to load them as plugins.
In order to be able to run Groovy scripts, you need to install first the Groovy scripting provider and then copy the Groovy scripts under your Gerrit /plugins directory.
Similarly for Scala scripts, you need to install the Scala scripting provider and then copy the Scala scripts under your Gerrit /plugins directory.