Closed
Bug 895835
Opened 12 years ago
Closed 12 years ago
Create a folder in mozqa.com that's behind basic authentication for testing
Categories
(Mozilla QA Graveyard :: Infrastructure, defect)
Mozilla QA Graveyard
Infrastructure
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: davehunt, Assigned: sushant)
Details
(Whiteboard: [mentor=whimboo][good first bug])
Attachments
(2 files, 8 obsolete files)
|
1.04 KB,
patch
|
whimboo
:
review+
whimboo
:
checkin+
|
Details | Diff | Splinter Review |
|
605 bytes,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
In order to test mozdownload's ability to download from URLs protected by basic authentication, we need at least one file on mozqa.com to have such authentication.
I would suggest mozqa.com/basicauth/index.html or similar.
Sushant, would you be interested to help us on this bug? Not sure if you know about the Apache config, but please let us know. I think that's not too hard to do.
Whiteboard: [mentor=whimboo][good first bug]
| Assignee | ||
Comment 2•12 years ago
|
||
Henrik,
I would love to give it a shot. I've played with config files but in a very basic level. I will read up some stuff if needed. No issues with that.
Could you give me a head start?
Regards,
Sushant
| Reporter | ||
Comment 3•12 years ago
|
||
http://httpd.apache.org/docs/2.2/howto/auth.html should put you in the right direction. We just want basic authentication for now, but we should leave ourselves open to support other types in the future. For that reason I think we should have the structure as below:
mozqa.com/auth/basic/index.html
Great. Thanks, so I will assign this bug to you then. The link Dave has been given is more an overview. What we need here is a .htaccess and .htpasswd file for that folder. You can read information about it on the following page:
http://httpd.apache.org/docs/current/howto/htaccess.html
Assignee: nobody → hiraysushant
Status: NEW → ASSIGNED
| Assignee | ||
Comment 5•12 years ago
|
||
Dear Henrik,
I've read about authentication and it seems pretty trivial. Could you give me the link of mozqa.com repository so that I can go about cloning it and creating a patch?
Regards,
Sushant
Sushant, it is the same repository you have worked with before for the HTML testcase changes. You can find it here: http://hg.mozilla.org/qa/testcase-data/
We simply have a clone on mozqa.com which automatically pulls each 15mins for updates.
| Assignee | ||
Comment 7•12 years ago
|
||
Henrik, I searched if it is possible to put relative paths to .htpasswd file. But as it turns out from my brief search, this is possible only if we create some environment variable.
So what path should I give for the file?
At the following page I found that it should be possible but it will be the relative path from the server root:
http://stackoverflow.com/questions/6111627/htaccess-authuserfile-relative-path
File-path is the path to the user file. If it is not absolute (i.e., if it doesn't begin with a slash), it is treated as relative to the ServerRoot.
| Assignee | ||
Comment 9•12 years ago
|
||
Henrik,
I had seen that link earlier. But as it seems, he wanted to have it relative to .htaccess and which is why he didn't mark that answer as correct but in our case relative to server root will as well suffice so no issues.
I'll submit a patch shortly
| Assignee | ||
Comment 10•12 years ago
|
||
I've as well added an index.html for checking. I've assumed that the mozqa.com is in the server root directory.
Attachment #779761 -
Flags: review?(hskupin)
The file structure you can find here:
http://mozqa.com/data/
So we might have to include ´data´ here. I could have a spot-check tomorrow on the server if that would work. But for today I'm off now.
| Assignee | ||
Comment 12•12 years ago
|
||
Updated the relative path to start from data.
You can try it on server and let me know if we face some issue!
Attachment #779761 -
Attachment is obsolete: true
Attachment #779761 -
Flags: review?(hskupin)
Attachment #779949 -
Flags: review?(hskupin)
| Assignee | ||
Updated•12 years ago
|
Flags: needinfo?(hskupin)
Comment on attachment 779949 [details] [diff] [review]
Bug-895835.patch Basic Authentication added || File path corrected
Review of attachment 779949 [details] [diff] [review]:
-----------------------------------------------------------------
Ok, I have experimented on mozqa.com and we definitely have to use the absolute path to the .htpasswd file. So please see my inline comments in how we get this working.
::: webapps/mozqa.com/auth/.htaccess
@@ +1,2 @@
> +AuthType Basic
> +AuthName "Mozilla's Protected Area"
For the name please add that it is for testing the basic authentication. Also mention that the user/pass is: mozilla/mozilla
@@ +1,3 @@
> +AuthType Basic
> +AuthName "Mozilla's Protected Area"
> +AuthUserFile data/webapps/mozqa.com/auth/.htpasswd
I would suggest we place the basic http auth under data/http_auth/basic/. The .htaccess will have to look like:
AuthType Basic
AuthName "Mozilla's Protected Area"
AuthUserFile /data/www/mozqa.com/data/http_auth/basic/.htpasswd
Require valid-user
::: webapps/mozqa.com/auth/.htpasswd
@@ +1,1 @@
> +root:$apr1$gWxGN4rO$lvq8/208nOcRS0LPFUQBU/
Please change that line to: ´mozilla:J.BZscAH9P43k´
::: webapps/mozqa.com/auth/basic/index.html
@@ +3,5 @@
> + <head>
> + <title>MozQA</title>
> + </head>
> + <body>
> + <h1> Mozilla QA Infrastructure</h1>
Just use a normal p tag here, which should then say that the basic auth was successful. Please also keep the 2 char indentation.
Attachment #779949 -
Flags: review?(hskupin) → review-
Flags: needinfo?(hskupin)
Sushant, have you had time to check my review comments?
Flags: needinfo?(hiraysushant)
| Assignee | ||
Comment 15•12 years ago
|
||
I was a bit busy with my exams. I have made the changes. Hope this looks good :)
Attachment #779949 -
Attachment is obsolete: true
Attachment #795067 -
Flags: review?(hskupin)
Flags: needinfo?(hiraysushant)
Comment on attachment 795067 [details] [diff] [review]
895835.patch
Review of attachment 795067 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good. Just two nits to fix before we can get this landed.
::: webapps/mozqa.com/data/http_auth/basic/.htaccess
@@ +1,3 @@
> +
> + AuthType basic
> + AuthName "Mozilla-Protected Zone: Basic Authentication user/pass:mozilla/mozilla"
I would drop some of those colons and say: ´Basic Authentication for Tests - user: mozilla / password: mozilla´
::: webapps/mozqa.com/data/http_auth/basic/index.html
@@ +1,4 @@
> +<html>
> + <head>Mozilla Protected Area</head>
> + <body>
> + <p>Authentication is successful!</p>
nit: 'Basic Authentication'
Attachment #795067 -
Flags: review?(hskupin) → review-
| Assignee | ||
Comment 17•12 years ago
|
||
I guess this should suffice!
Attachment #795067 -
Attachment is obsolete: true
Attachment #795847 -
Flags: review?(hskupin)
Comment on attachment 795847 [details] [diff] [review]
Bug-895835.patch Basic Authentication in mozqa
Review of attachment 795847 [details] [diff] [review]:
-----------------------------------------------------------------
Yes, that looks perfect. Thanks for your work!
I will land it right now, so we can see how it works and we can create tests for mozdownload. Would you be interested to create such a test?
Attachment #795847 -
Flags: review?(hskupin) → review+
Comment on attachment 795847 [details] [diff] [review]
Bug-895835.patch Basic Authentication in mozqa
Review of attachment 795847 [details] [diff] [review]:
-----------------------------------------------------------------
Landed as:
http://hg.mozilla.org/qa/testcase-data/rev/6433b1736f0e
And I had to back this out given that the folder structure is not correct. Those files should not exist under webapps but under the root folder.
Backout:
http://hg.mozilla.org/qa/testcase-data/rev/4aaa429d8dd2
Attachment #795847 -
Flags: review+ → review-
(In reply to Henrik Skupin (:whimboo) from comment #18)
> I will land it right now, so we can see how it works and we can create tests
> for mozdownload. Would you be interested to create such a test?
https://github.com/mozilla/mozdownload/issues/141 will cover the mozdownload case.
| Assignee | ||
Comment 21•12 years ago
|
||
I've copied the entire mozqa.com folder into the root folder of testcase-data.
I reverted the mozqa.com folder as it was before I started changing in the webapps dir.
Since I added the image as well, patch is pretty big.
So 2 doubts:
Do we need to keep the image?
Should I remove mozqa.com entirely from webapps directory?
Attachment #795847 -
Attachment is obsolete: true
Attachment #795949 -
Flags: review?(hskupin)
Comment on attachment 795949 [details] [diff] [review]
895835.patch
Review of attachment 795949 [details] [diff] [review]:
-----------------------------------------------------------------
In general please do not touch anything from the webapps sub folder. We only care about our HTTP auth files here. If there has to be done more, lets file a follow-up bug. More comments inline.
::: mozqa.com/data/http_auth/basic/.htaccess
@@ +1,4 @@
> +
> + AuthType basic
> + AuthName "Basic Authentication for Tests - user: mozilla / password: mozilla"
> + AuthUserFile /data/www/mozqa.com/data/http_auth/basic/.htpasswd
You have moved the folder. So this path needs an update. FYI the folder ´/data/www/mozqa.com/data´ is the web root. So adjust the suffix accordingly to 'mozqa.com/http_auth/...'.
Attachment #795949 -
Flags: review?(hskupin) → review-
| Assignee | ||
Comment 23•12 years ago
|
||
Well, I have changed the path.
So now, I have assumed that we are keeping the mozqa.com folder in the web root folder.
Attachment #795949 -
Attachment is obsolete: true
Attachment #796163 -
Flags: review?(hskupin)
Comment on attachment 796163 [details] [diff] [review]
Bug-895835.patch Basic Authentication in mozqa
Review of attachment 796163 [details] [diff] [review]:
-----------------------------------------------------------------
There are still two problems to be fixed. Once that has been done we are good.
::: mozqa.com/appinstall.html
@@ +1,1 @@
> +<!DOCTYPE html>
Again, this file is not part of our changes. Leave it where it was before.
::: mozqa.com/manifest.webapp
@@ +1,1 @@
> +{
Same here. Please do not move this file.
Attachment #796163 -
Flags: review?(hskupin) → review-
Oh, and also ensure that you do not move any binary file too.
| Assignee | ||
Comment 26•12 years ago
|
||
Removed the appinstall.html, manifest.webapp and qalogo.png
I guess we are through now.
Attachment #796163 -
Attachment is obsolete: true
Attachment #796629 -
Flags: review?(hskupin)
Comment on attachment 796629 [details] [diff] [review]
895835.patch
Review of attachment 796629 [details] [diff] [review]:
-----------------------------------------------------------------
That looks good now. I landed it as:
http://hg.mozilla.org/qa/testcase-data/rev/945882d0fd7f
Attachment #796629 -
Flags: review?(hskupin) → review+
Ok, so this is available now via:
http://mozqa.com/data/mozqa.com/http_auth/basic/
Sadly we do not see the basic folder listed under:
http://mozqa.com/data/mozqa.com/http_auth
Sushant, would you mind to create a follow-up patch, which adds a new index.html file into that folder? I should include a quick description and links to all supported auth methods.
| Assignee | ||
Comment 29•12 years ago
|
||
So an index.html in http_auth right?
Are you gonna include the description and links to supported auth methods or was it a typo?
| Assignee | ||
Comment 30•12 years ago
|
||
Added an index.html in http_auth to access various authentication links.
Currently only link for basic authentication in provided! Might need some changes as other authentication types are added!
Attachment #796629 -
Attachment is obsolete: true
Attachment #797159 -
Flags: review?(hskupin)
Comment on attachment 797159 [details] [diff] [review]
895835.patch
Review of attachment 797159 [details] [diff] [review]:
-----------------------------------------------------------------
Looks like you haven't updated your local repository before creating the new patch. Please run a ´hg pull -u´ before.
::: mozqa.com/http_auth/index.html
@@ +2,5 @@
> + <head>Mozilla Protected Area</head>
> + <body>
> + <p>Supported Authentication Types:</p>
> + <ul>
> + <li><a href="basic/index.html">Basic Authentication</a></li>
2 chars of indentation please. Also you can remote the ´index.html´ part of the link. Apache takes this automatically.
Attachment #797159 -
Flags: review?(hskupin) → review-
Comment on attachment 796629 [details] [diff] [review]
895835.patch
This patch is not obsolete. It has been landed.
Attachment #796629 -
Attachment is obsolete: false
Attachment #796629 -
Flags: checkin+
| Assignee | ||
Comment 33•12 years ago
|
||
Aah, I get it. I hadn't pulled from the source, so I had to mark the previous one as obsolete.
Now I guess this looks fine.
Attachment #797159 -
Attachment is obsolete: true
Attachment #797393 -
Flags: review?(hskupin)
Comment on attachment 797393 [details] [diff] [review]
895835-2.patch
Review of attachment 797393 [details] [diff] [review]:
-----------------------------------------------------------------
General that looks fine now but see my inline comment.
::: mozqa.com/http_auth/index.html
@@ +4,5 @@
> + <p>The following are the supported authentication types:</p>
> + <ul>
> + <li>
> + <a href="basic/">Basic Authentication</a>
> + </li>
All the indentation in that file is off. Please do not use tabs but 2 spaces. Your editor might have to be configured appropriately.
Attachment #797393 -
Flags: review?(hskupin) → review-
| Assignee | ||
Comment 35•12 years ago
|
||
Oops. I just checked and I seem to have changed the preferences some time back.
Anyways no issues, I have changed the settings.
Hope this looks fine!
| Assignee | ||
Comment 36•12 years ago
|
||
Attachment #797393 -
Attachment is obsolete: true
Attachment #798154 -
Flags: review?(hskupin)
Comment on attachment 798154 [details] [diff] [review]
895835-2.patch Updated indentation
Review of attachment 798154 [details] [diff] [review]:
-----------------------------------------------------------------
That looks way better now.
Attachment #798154 -
Flags: review?(hskupin) → review+
Landed as:
http://hg.mozilla.org/qa/testcase-data/rev/d5dd4b52f554
Sushant, would you be interested to implement other authentication methods, or more on creating an automated test for mozdownload as pointed out already above? Let me know if you have interests!
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 39•12 years ago
|
||
Henrik, I would surely love to help more. Depending on the priority we can either work first on the test for mozdownload or implement new auth methods. :)
Do link me accordingly to the appropriate bug/issue.
I talked with Sushant on IRC and he will work on the automated test for mozdownload now.
Updated•7 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•