Using Gitblit API Library, no way to identify if the login fails

47 views
Skip to first unread message

Sajith Kariyawasam

unread,
Feb 8, 2013, 12:53:54 PM2/8/13
to git...@googlegroups.com
Hi all, 

Today only I started playing around with Gitblit, and its cool.!
I have a requirement to do some git repo management (repo creation, permission .. etc) , programatically, 
so I have started using Gitblit API .. 

I have deployed Gitblit WAR on tomcat, and from my Java client program i have written 

GitblitRegistration reg = new GitblitRegistration("sajith-test", "http://localhost:8080/gitblit-1.2.1/", "admin", "admin".toCharArray());
GitblitClient client = new GitblitClient(reg);
client.login();

In Tomcat logs I can see "admin authenticated by BASIC request header from 127.0.0.1" ...

but if I try with invalid credentials, in my client code there is no exception thrown, therefore I cannot identify that my login attempt is successful or not.. ?

If there is any way please let me know.

Thanks in advance

Sajith

James Moger

unread,
Feb 8, 2013, 9:52:37 PM2/8/13
to git...@googlegroups.com
Hmm.  It looks like the API could be improved some.  The exceptions that indicate login failure are swallowed by the login() method.

-J

Sajith Kariyawasam

unread,
Feb 9, 2013, 4:31:29 AM2/9/13
to git...@googlegroups.com
I c.. went through the souce.. yeah i can see that in login UnauthorizedException, ForbiddenException and few other exceptions are swallowed..

Would like to contribute to improve the codes, etc.. any possibility ?

Thanks

James Moger

unread,
Feb 9, 2013, 11:59:32 AM2/9/13
to git...@googlegroups.com
Sure.  This is an open source project.  Submit a pull request.

-J
Reply all
Reply to author
Forward
0 new messages