Merge lp:~gesha/linaro-license-protection/eula-style-openid-support into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Georgy Redkozubov
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 80
Merged at revision: 80
Proposed branch: lp:~gesha/linaro-license-protection/eula-style-openid-support
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 62 lines (+16/-0)
4 files modified
android/build-info/BUILD-INFO.txt (+4/-0)
android/build-info/openid.txt (+1/-0)
licenses/license.php (+3/-0)
tests/test_click_through_license.py (+8/-0)
To merge this branch: bzr merge lp:~gesha/linaro-license-protection/eula-style-openid-support
Reviewer Review Type Date Requested Status
James Tunnicliffe (community) Approve
Review via email: mp+110809@code.launchpad.net

Description of the change

This branch adds missed OpenID handling.
OpenID is handled as initially, simple redirected to OpenID login page. Complete support will be added by separate BP https://blueprints.launchpad.net/linaro-license-protection/+spec/license-protection-openid-support

To post a comment you must log in.
Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'android/build-info/BUILD-INFO.txt'
--- android/build-info/BUILD-INFO.txt 2012-06-11 10:44:16 +0000
+++ android/build-info/BUILD-INFO.txt 2012-06-18 13:02:19 +0000
@@ -36,3 +36,7 @@
36Build-Name: landing-panda36Build-Name: landing-panda
37License-Type: open37License-Type: open
3838
39Files-Pattern: *openid*
40Build-Name: landing-protected
41License-Type: protected
42OpenID-Launchpad-Teams: linaro
3943
=== added file 'android/build-info/openid.txt'
--- android/build-info/openid.txt 1970-01-01 00:00:00 +0000
+++ android/build-info/openid.txt 2012-06-18 13:02:19 +0000
@@ -0,0 +1,1 @@
1This is protected with OpenID.
0\ No newline at end of file2\ No newline at end of file
13
=== modified file 'licenses/license.php'
--- licenses/license.php 2012-06-11 10:44:16 +0000
+++ licenses/license.php 2012-06-18 13:02:19 +0000
@@ -34,6 +34,7 @@
34 $theme = $bi->get("Theme");34 $theme = $bi->get("Theme");
35 $lic_type = $bi->get("License-Type");35 $lic_type = $bi->get("License-Type");
36 $lic_text = $bi->get("License-Text");36 $lic_text = $bi->get("License-Text");
37 $openid = $bi->get("OpenID-Launchpad-Teams");
37} else {38} else {
38 $flist = LicenseHelper::getFilesList($search_dir);39 $flist = LicenseHelper::getFilesList($search_dir);
39 if (!empty($name_only)) {40 if (!empty($name_only)) {
@@ -46,6 +47,8 @@
46 if ($bi_found) {47 if ($bi_found) {
47 if ($lic_type == 'open')48 if ($lic_type == 'open')
48 LicenseHelper::redirect_with_status($down, $domain, 200);49 LicenseHelper::redirect_with_status($down, $domain, 200);
50 elseif (($openid != false) and ($lic_type == 'protected'))
51 LicenseHelper::redirect_with_status($down, $domain, 200);
49 elseif (($theme != false) or ($lic_text != false))52 elseif (($theme != false) or ($lic_text != false))
50 $template_content = file_get_contents($doc."/licenses/".$theme.".html");53 $template_content = file_get_contents($doc."/licenses/".$theme.".html");
51 else54 else
5255
=== modified file 'tests/test_click_through_license.py'
--- tests/test_click_through_license.py 2012-05-28 09:38:39 +0000
+++ tests/test_click_through_license.py 2012-06-18 13:02:19 +0000
@@ -39,6 +39,7 @@
39build_info_samsung_test_file = '/android/build-info/origen-blob.txt'39build_info_samsung_test_file = '/android/build-info/origen-blob.txt'
40build_info_ste_test_file = '/android/build-info/snowball-blob.txt'40build_info_ste_test_file = '/android/build-info/snowball-blob.txt'
41build_info_not_protected_test_file = '/android/build-info/panda-open.txt'41build_info_not_protected_test_file = '/android/build-info/panda-open.txt'
42build_info_openid_test_file = '/android/build-info/openid.txt'
4243
4344
44class Contains(object):45class Contains(object):
@@ -320,3 +321,10 @@
320 if os.path.exists("%s/cookies.txt" % docroot):321 if os.path.exists("%s/cookies.txt" % docroot):
321 os.rename("%s/cookies.txt" % docroot, "%s/cookies.ste" % docroot)322 os.rename("%s/cookies.txt" % docroot, "%s/cookies.ste" % docroot)
322 self.assertThat(testfile, Contains(search))323 self.assertThat(testfile, Contains(search))
324
325 def test_build_info_openid_protection(self):
326 search = "This is protected with OpenID."
327 testfile = fetcher.get(host + build_info_openid_test_file)
328 fetcher.close()
329 self.assertThat(testfile, Contains(search))
330

Subscribers

People subscribed via source and target branches