mteodori / jira-git-plugin

Other
66 stars 48 forks source link

Authorization problem via HTTPS #10

Open kriz1982 opened 11 years ago

kriz1982 commented 11 years ago

Hi, I'm using RhodeCode as my git server accessible only via HTTPS . Commits in JIRA (5.2.11) are displayed correctly when repo is public (does not require authentication). However, when the repo is protected I always got not authorized exception. Storing credentials either in _netrc (on windows) or in .git/config works with other git clients (eg TortoiseGit) but JGIT from jira-git-plugin throws exception when trying to access repo.

2013-07-22 10:14:22,429 http-bio-8080-exec-15 WARN testuser 614x2091x1 38ouru 192.168.169.13 /browse/DEMO-4 [xiplink.jira.git.GitManagerImpl] org.eclipse.jgit.errors.TransportException: https://MyRepoURL/test: not authorized at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:373) at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:203) at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:125) at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:111) at org.eclipse.jgit.transport.Transport.fetch(Transport.java:904) at com.xiplink.jira.git.GitManagerImpl.fetch(GitManagerImpl.java:455) ...

kriz1982 commented 11 years ago

According to the JGit bugtracker HTTPS authentication was implemented somewhere around the end of 2010 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=296201) . jGit V0.10.1 which is included in jira-git-plugin is also from the end of 2010. Maybe simple JGit upgrade is required? I have built jira-git-plugin against jgit 0.12.1 (i've just change version in pom) but now exception is thrown on the jira startup

2013-07-22 13:03:08,246 http-bio-8080-exec-1 ERROR - [jira.web.dispatcher.JiraWebworkActionDispatcher] Exception thrown from action 'ViewGitRepositories', returning 404 WebworkConfigurationNotFoundException{class=class webwork.config.XMLActionConfiguration, message='No such view mapping', name='ViewGitRepositories.actionInfo'}

The plugin is disabled and when I want to enable it i got:

2013-07-22 13:12:09,450 http-bio-8080-exec-12 ERROR testuser 792x256x1 1wstbq4 192.168.169.13 /rest/plugins/1.0/com.xiplink.jira.git.jira-git-plugin-key [atlassian.plugin.manager.DefaultPluginManager] There was an error loading the descriptor 'Git Repositories Link on Administrators Page' of plugin 'com.xiplink.jira.git.jira-git-plugin'. Disabling. java.lang.RuntimeException: Unable to enable web fragment at com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor.enabled(AbstractWebFragmentModuleDescriptor.java:133) ...