Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Unauthenticated git-upload-pack/git-receive-pack request
Unauthenticated git-upload-pack/git-receive-pack request [message #1755034] Mon, 27 February 2017 09:32 Go to next message
Hetty Wei is currently offline Hetty WeiFriend
Messages: 1
Registered: February 2017
Junior Member
When using http connection, jgit send a unauthenticated request before authenticated one, taking an example from server access log

127.0.0.1 - - [27/Feb/2017:16:55:31 +0800] "GET /tac621git.git/info/refs?service=git-receive-pack HTTP/1.1" 401 401
127.0.0.1 - admin [27/Feb/2017:16:55:31 +0800] "GET /tac621git.git/info/refs?service=git-receive-pack HTTP/1.1" 200 185
127.0.0.1 - - [27/Feb/2017:16:55:33 +0800] "GET /tac621git.git/info/refs?service=git-receive-pack HTTP/1.1" 401 401
127.0.0.1 - admin [27/Feb/2017:16:55:33 +0800] "GET /tac621git.git/info/refs?service=git-receive-pack HTTP/1.1" 


It seems in org.eclipse.jgit.transport.TransportHttp. It always have a first try with HttpAuthMethod.Type.NONE. Then if authentication failed, it will get AuthMethod from response.

The problem is that some git server has limit on denied request per second. Reaching that limit server just cut of connection for a period of time.

So I think there should be a way to set default AuthMethod. Is there such a way? Or will it be added soon?
Re: Unauthenticated git-upload-pack/git-receive-pack request [message #1755272 is a reply to message #1755034] Wed, 01 March 2017 21:53 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 924
Registered: July 2009
Senior Member
This could be improved, patches welcome.

TransportHttp.connect() detects required auth method from HTTP status code of failed first request.
We could add a method allowing to explicitly set the default auth method.

In addition TransportHttp could cache the auth method discovered in a request and try that one
again instead of always assuming NONE for subsequent requests.
Previous Topic:Smart HTTP push error
Next Topic:Git integration fails
Goto Forum:
  


Current Time: Mon May 29 17:19:24 GMT 2017

Powered by FUDForum. Page generated in 0.03470 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software