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
1=== modified file 'android/build-info/BUILD-INFO.txt'
2--- android/build-info/BUILD-INFO.txt 2012-06-11 10:44:16 +0000
3+++ android/build-info/BUILD-INFO.txt 2012-06-18 13:02:19 +0000
4@@ -36,3 +36,7 @@
5 Build-Name: landing-panda
6 License-Type: open
7
8+Files-Pattern: *openid*
9+Build-Name: landing-protected
10+License-Type: protected
11+OpenID-Launchpad-Teams: linaro
12
13=== added file 'android/build-info/openid.txt'
14--- android/build-info/openid.txt 1970-01-01 00:00:00 +0000
15+++ android/build-info/openid.txt 2012-06-18 13:02:19 +0000
16@@ -0,0 +1,1 @@
17+This is protected with OpenID.
18\ No newline at end of file
19
20=== modified file 'licenses/license.php'
21--- licenses/license.php 2012-06-11 10:44:16 +0000
22+++ licenses/license.php 2012-06-18 13:02:19 +0000
23@@ -34,6 +34,7 @@
24 $theme = $bi->get("Theme");
25 $lic_type = $bi->get("License-Type");
26 $lic_text = $bi->get("License-Text");
27+ $openid = $bi->get("OpenID-Launchpad-Teams");
28 } else {
29 $flist = LicenseHelper::getFilesList($search_dir);
30 if (!empty($name_only)) {
31@@ -46,6 +47,8 @@
32 if ($bi_found) {
33 if ($lic_type == 'open')
34 LicenseHelper::redirect_with_status($down, $domain, 200);
35+ elseif (($openid != false) and ($lic_type == 'protected'))
36+ LicenseHelper::redirect_with_status($down, $domain, 200);
37 elseif (($theme != false) or ($lic_text != false))
38 $template_content = file_get_contents($doc."/licenses/".$theme.".html");
39 else
40
41=== modified file 'tests/test_click_through_license.py'
42--- tests/test_click_through_license.py 2012-05-28 09:38:39 +0000
43+++ tests/test_click_through_license.py 2012-06-18 13:02:19 +0000
44@@ -39,6 +39,7 @@
45 build_info_samsung_test_file = '/android/build-info/origen-blob.txt'
46 build_info_ste_test_file = '/android/build-info/snowball-blob.txt'
47 build_info_not_protected_test_file = '/android/build-info/panda-open.txt'
48+build_info_openid_test_file = '/android/build-info/openid.txt'
49
50
51 class Contains(object):
52@@ -320,3 +321,10 @@
53 if os.path.exists("%s/cookies.txt" % docroot):
54 os.rename("%s/cookies.txt" % docroot, "%s/cookies.ste" % docroot)
55 self.assertThat(testfile, Contains(search))
56+
57+ def test_build_info_openid_protection(self):
58+ search = "This is protected with OpenID."
59+ testfile = fetcher.get(host + build_info_openid_test_file)
60+ fetcher.close()
61+ self.assertThat(testfile, Contains(search))
62+

Subscribers

People subscribed via source and target branches