Bazel: compare runtime overlap against headless Gerrit WAR Add a guardrail that fails if the oauth plugin bundles third-party runtime jars that are already provided by Gerrit. Use //:headless.war.jars.txt as the comparison manifest instead of //:release.war.jars.txt. The release WAR is not the right boundary for this check because it also includes the packaged core plugins via //plugins:core. Comparing against that manifest would make this test depend on the full set of core plugin submodules being present during Bazel analysis. In CI/CD the plugin is built inside a partial Gerrit clone without fetching the core plugin submodules. Using the release WAR manifest would therefore fail analysis before the test can run. The headless WAR already provides the correct comparison scope for this guardrail: jars shipped by Gerrit itself, but not jars contributed by the packaged core plugins. This keeps the overlap check focused on libraries provided by Gerrit runtime, while avoiding an unnecessary dependency on core plugin submodules. The test remains Gerrit-tree-only and is gated via: target_compatible_with = in_gerrit_tree_enabled() so standalone plugin builds continue to report it as SKIPPED. Change-Id: I4abd5646b9a92f3ab619c74c72bf4c47bbcdc07f
With this plugin Gerrit can use OAuth2 protocol for authentication. Supported OAuth providers:
See the Wiki what it can do for you.
Prebuilt binary artifacts are available on release page. Make sure to pick the right JAR for your Gerrit version.
To build the plugin with Bazel, install Bazel and run the following:
git clone https://gerrit.googlesource.com/plugins/oauth cd oauth && bazel build oauth
Copy the bazel-bin/oauth.jar to $gerrit_site/plugins and re-run init to configure it:
java -jar gerrit.war init -d <site>
[...]
*** OAuth Authentication Provider
***
Use Bitbucket OAuth provider for Gerrit login ? [Y/n]? n
Use Google OAuth provider for Gerrit login ? [Y/n]?
Application client id : <client-id>
Application client secret :
confirm password :
Link to OpenID accounts? [true]:
Use GitHub OAuth provider for Gerrit login ? [Y/n]? n
Make sure to read the FAQ before reporting issues.
Apache License 2.0