| Issue 1683: | auth.type=CUSTOM_EXTENSION doesn't work | |
| 3 people starred this issue and may be notified of changes. | Back to list |
Affected Version:
2.5
What steps will reproduce the problem?
1. Create custom plugin
2. Bind Realm in extension to given implementation
3. Copy plugin to $SITE_HOME/plugins
4. Set auth.type setting to CUSTOM_EXTENSION
5. Start gerrit
What is the expected output? What do you see instead?
I expect that Gerrit will delegate all authentication related calls to my realm but it doesn't. Plugins are loaded later than main realm.
If auth.type is set to CUSTOM_EXTENSION then gerrit fails with message:
com.google.inject.CreationException: Guice creation errors:
1) No implementation for com.google.gerrit.server.account.Realm was bound.
while locating com.google.gerrit.server.account.Realm
for parameter 4 at com.google.gerrit.server.IdentifiedUser$GenericFactory.<init>(IdentifiedUser.java:82)
at com.google.gerrit.server.config.GerritGlobalModule.configure(GerritGlobalModule.java:167)
If auth.type is set to any other value then gerrit fails with message:
com.google.inject.CreationException: Guice creation errors:
1) A binding to com.google.gerrit.server.account.Realm was already configured at com.google.gerrit.server.plugins.PluginGuiceEnvironment$2.configure(PluginGuiceEnvironment.java:413).
at org.code_house.gerrit.crowd_plugin.CrowdModule.configure(CrowdModule.java:11)
Please provide any additional information below.
Nothing to add here...
Nov 26, 2012
#1
sop@google.com
Status:
AwaitingInformation
Nov 26, 2012
I don't see any rocket science in your realm infrastructure. Custom realm must be installed before GerritGlobalModule. That's all. It's complicated just because you have plenty of inner dependencies flying between different layers in Gerrit. Actually CUSTOM_EXTENSION is just a marker which allows to turn off default realm binding provided by Gerrit. Having a one statement with MyCustomRealmModule before GerritGlobalModule instantiation and another with MyCustomServletModule after is not rocket science. Question is when you will be able to support this kind of scenarios. Maybe in 3.0?
Nov 26, 2012
Maybe in 2.6 or at latest 2.7 we are deleting the Realm interface and moving to a DynamicSet managed collection of providers. This sidesteps the ordering of Realm binding altogether. You are right its not rocket science to supply your own Realm, but the dependencies are a mess. If you know how to do this, you can probably run a server using CUSTOM_EXTENSION today (we do, gerrit-review is such a thing). Its not something we encourage though because its a horrible hack, we know its a hack, and we suspected we would have something better in the future. See my remark about that maybe being in 2.6 or 2.7. Two weeks ago the hackathon we worked on making this more possible from plugins, and the team got pretty far. They demoed an installation doing authentication against a flat file htpasswd style file, driven by a plugin. The changes need to be reviewed and probably iterated a few times before they are merged, but its seeming likely for a 2.6 release. Or at worst 2.7.
Status:
Accepted
Nov 5, 2013
I would like to remind a little bit this issue to include it in your road map. Gerrit 2.6 was released couple of months ago, same for 2.7..
Mar 16, 2014
Gerrit 2.8 is released. Any news on this field? |
|
| ► Sign in to add a comment |