plaflamme / gitblit-crowd

Atlassian Crowd authentication and authorization with Gitblit
http://plaflamme.github.com/gitblit-crowd/
Apache License 2.0
3 stars 1 forks source link

Compatibility with Gitblit 1.2.x #2

Open SEBiGEM opened 11 years ago

SEBiGEM commented 11 years ago

I want to use Crowd authentification within Gitblit. Currently these components are installed in my environment:

The Crowd integration plugin is recognised and seems to work until I add permissions to a git repository. Then the following exception occurs in the Gitblit log file:

2013-04-02 15:14:17 RequestCycle [ERROR] Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = editForm]] threw an exception
org.apache.wicket.WicketRuntimeException: Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = editForm]] threw an exception
    at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:193)
    at org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
    at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
    at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
    at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
    at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
    at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
    at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
    at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:363)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:931)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:992)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
    ... 31 more
Caused by: java.lang.AbstractMethodError: org.obiba.git.gitblit.CrowdUserService.updateUserModels(Ljava/util/List;)Z
    at com.gitblit.GitBlit.setUserAccessPermissions(GitBlit.java:888)
    at com.gitblit.wicket.pages.EditRepositoryPage$2.onSubmit(EditRepositoryPage.java:362)
    at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1595)
    at org.apache.wicket.markup.html.form.Form.process(Form.java:960)
    at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:922)
    ... 36 more

After a little research I have found the reason. The function updateUserModels was introduced with Gitblit 1.2.0 and has no implementation in the Crowd integration plugin.

Can you please provide an update to your plugin which makes it compatible with Gitblit 1.2?

plaflamme commented 11 years ago

I'd happily merge a pull-request for this if you can provide one.

SEBiGEM commented 11 years ago

I’m sorry, at the moment I can’t provide one. I am more a consumer than a developer.

bantunes commented 11 years ago

Try the gitblit-crowd-authentication: https://github.com/cescoffier/gitblit-crowd-authentication Not perfect, but it seems to integrate better than this one

plaflamme commented 11 years ago

I'll see what I can do to upgrade to 1.2.

plaflamme commented 11 years ago

Sadly, I have no way to test this, but I've made the necessary changes to support Gitblit 1.2. Please refer to this page for details: http://plaflamme.github.com/gitblit-crowd/

SEBiGEM commented 11 years ago

@plaflamme Thank you very much! Now the exception has disappeared. But sadly there seems to be a bigger problem:

The user and team permissions for a repository will not be saved and the perms.xml file will not be created. There is a hint in the release notes for Gitblit 1.2.0 that the permission model has changed. The functions which gitblit-crowd is using to store the permissions are marked as deprecated and and no longer seem to be invoked.

@bantunes I have tried the gitblit-crowd-authentication plugin, but as far as I have seen there is no handling of Crowd groups and teams like in gitblit-crowd.

plaflamme commented 11 years ago

I'll see what I can do.