Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 165852 - Post-method authentication is not working
Summary: Post-method authentication is not working
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 0.9   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.0.1   Edit
Assignee: Willian Mitsuda CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-25 19:58 EST by Willian Mitsuda CLA
Modified: 2006-12-22 18:22 EST (History)
3 users (show)

See Also:


Attachments
Patch (1.34 KB, patch)
2006-11-25 20:02 EST, Willian Mitsuda CLA
no flags Details | Diff
mylar/context/zip (1.34 KB, application/octet-stream)
2006-11-25 20:03 EST, Willian Mitsuda CLA
no flags Details
Updated patch (6.94 KB, patch)
2006-11-26 13:57 EST, Willian Mitsuda CLA
no flags Details | Diff
mylar/context/zip (2.75 KB, application/octet-stream)
2006-11-26 13:57 EST, Willian Mitsuda CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Willian Mitsuda CLA 2006-11-25 19:58:02 EST
This is about the Web Connector.

(PS: can you please create a web connector component on bugzilla?)

I'm still trying to make the web connector work with a secured mantis installation.

There is a bug on login page computation when using POST method.

Also, after fixing this, I noticed that it returns a redirect URL which is not working (the URL is correct, but the GET implementation is not).
Comment 1 Willian Mitsuda CLA 2006-11-25 20:02:18 EST
Created attachment 54519 [details]
Patch
Comment 2 Willian Mitsuda CLA 2006-11-25 20:03:05 EST
Created attachment 54520 [details]
mylar/context/zip
Comment 3 Willian Mitsuda CLA 2006-11-25 20:06:07 EST
Regarding the redirect problem, I'm not sure if this is the best approach (I'm not fluent on http internals).

The server is returning a "login_cookie_test.php?return=my_view_page.php" as the redirect URL; I just discovered that appending a "/" in front of URI was sufficient to fix my case.
Comment 4 Willian Mitsuda CLA 2006-11-26 13:57:01 EST
Created attachment 54530 [details]
Updated patch

Updated redirect codes handling according to Erkki's comments on bug#151602 comment#57.

Also, I applied the code formatter.
Comment 5 Willian Mitsuda CLA 2006-11-26 13:57:04 EST
Created attachment 54531 [details]
mylar/context/zip
Comment 6 Eugene Kuleshov CLA 2006-11-26 14:17:31 EST
Is there a public issue tracker that can be used to test those changes? We need to keep WebRepositoryconnectorTest up to date with those changes...
Comment 7 Willian Mitsuda CLA 2006-11-26 14:26:06 EST
(In reply to comment #6)
> Is there a public issue tracker that can be used to test those changes? We need
> to keep WebRepositoryconnectorTest up to date with those changes...
> 

For manual tests I think you can use the Mantis demo site:

http://www.futureware.biz/mantisdemo/my_view_page.php

Now for automated tests... can't you make a bugzilla template and use it against Mylar own bugzilla test installations?
Comment 8 Mik Kersten CLA 2006-11-27 00:50:36 EST
Eugene already has template tests, so if Willian asserts that this patch has been manually tested I can apply it.  I would suggest writing a mock test for the patch even if it doesn't do any connection testing.

Eugene, since this is your component now let me know when you want me to apply.  

I added a connector called "Web" (I realize that name is overly generic, but it will help prevent name bloat) and Eugene is the default asisgnee in light of his impending committer status. 
Comment 9 Eugene Kuleshov CLA 2006-11-27 00:57:36 EST
What I can suggest is to create some user in that mantis repository and add a hack into WebRepositoryConnectorTest to login with this user.

I think that it is a bad idea to use mock tests for concrete repository templates or http retrieval logic. Mocks should not simulate any infrastructure.
Comment 10 Mik Kersten CLA 2006-11-27 11:29:17 EST
Should I apply this patch so that it makes it into this afternoon's RC1?
Comment 11 Willian Mitsuda CLA 2006-11-27 13:05:38 EST
(In reply to comment #10)
> Should I apply this patch so that it makes it into this afternoon's RC1?
> 

Well, without this patch, the POST authentication and redirection handling is simply unusable...

My only concern is about is about the quality of redirection implementation, but this can be discussed later.
Comment 12 Willian Mitsuda CLA 2006-11-27 13:13:45 EST
(In reply to comment #8)
> Eugene already has template tests, so if Willian asserts that this patch has
> been manually tested I can apply it.  

I tested it against a private third party installation of Mantis.

It didn't work :), so this patch is the result of my debug session.

Unfortunately, the authentication support patch only cames out last week, there is a good chance to more bugs to appear after the release with other users trying to use in a variety of combinations... we'll have to live with it.
Comment 13 Eugene Kuleshov CLA 2006-11-27 13:51:36 EST
Mik, I won't be able to look at this before late tonight. So, it is probablt makes sense to apply this patch. 

Willian, in a mean time can you register a test account on mantis demo site and update WebRepositoryConnectorTest to use these credentials?
Comment 14 Mik Kersten CLA 2006-11-27 14:13:47 EST
Patch applied.
Comment 15 Willian Mitsuda CLA 2006-11-27 14:59:07 EST
(In reply to comment #13)
> Willian, in a mean time can you register a test account on mantis demo site and
> update WebRepositoryConnectorTest to use these credentials?

Humm... I'll take a look...
Comment 16 Willian Mitsuda CLA 2006-11-29 20:51:47 EST
 (In reply to comment #13)
> Willian, in a mean time can you register a test account on mantis demo site and update WebRepositoryConnectorTest to use these credentials?

Sorry for the delay,

2 questions:

1 - For what I understood reading the WebRepositoryConnectorTest, it just iterates through the templates trying to connect, but the test is not prepared for authentication test (e.g. the hack to test otrs repository). Should I just introduce other "hack" to insert the mantis credentials?

2 - If (1) is right, then should we create a account on the existing mantis official installation (not sure if it is a good idea to play with a production environment) or create a account on the mantis demo installation and change the template to point there?
Comment 17 Eugene Kuleshov CLA 2006-11-29 21:00:18 EST
(In reply to comment #16)
> 1 - For what I understood reading the WebRepositoryConnectorTest, it just
> iterates through the templates trying to connect, but the test is not prepared
> for authentication test (e.g. the hack to test otrs repository). Should I just
> introduce other "hack" to insert the mantis credentials?

I'd do that for now. Maybe later we can move to same mechanism Mylar is using for Bugzilla, Trac and JIRA.

> 2 - If (1) is right, then should we create a account on the existing mantis
> official installation (not sure if it is a good idea to play with a production
> environment) or create a account on the mantis demo installation and change the
> template to point there?

I just want these templates to be using some projects related to Eclipse. That one seem good one. Another oprion could be SvnKit. We are only reading, so it should be ok, to use non-demo install.
Comment 18 Willian Mitsuda CLA 2006-12-05 16:06:50 EST
I created the user mylar-test, pass mylar-test on mantis official installation, but there is something weird in that reverting this bug's patch, the tests are still working...

Unfortunately I won't have time to investigate this in deep until the weekend, but I wonder if there is a bug on the tests.

For this reason, I won't submit the test-patch yet.
Comment 19 Erkki Lindpere CLA 2006-12-08 14:59:46 EST
This redirect implementation caused Bug #167282 . With that fixed, this works fine for me.
Comment 20 Mik Kersten CLA 2006-12-08 20:47:33 EST
Downgrading severity.  Rest of changes need to wait post-1.0.
Comment 21 Mik Kersten CLA 2006-12-18 23:32:40 EST
Let me know if there's anything on this that should make it into 1.0.1, in which case we need to have it integrated sometime on Wednesday.
Comment 22 Eugene Kuleshov CLA 2006-12-21 00:01:15 EST
Weird... I commented out setFollowRedirect(false) and removed manual redirecting and all current tests are suddenly passing now. Mik, I wonder I should commit that and we should try dev build with this change.
Comment 23 Eugene Kuleshov CLA 2006-12-22 15:52:10 EST
Willian, Erkki, do we have anything left here? It seems like changes/patches in bug 167282 resolved these issues?
Comment 24 Erkki Lindpere CLA 2006-12-22 18:08:46 EST
(In reply to comment #23)
> Willian, Erkki, do we have anything left here? It seems like changes/patches in
> bug 167282 resolved these issues?

Yes, I think it's all working ok now.
Comment 25 Mik Kersten CLA 2006-12-22 18:22:34 EST
Marking resolved.