Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: sitescripts/testpages/README.md

Issue 29328589: Issue 3122 - Add testpages.web.sitekey_frame URL handler (Closed)
Patch Set: Addressed feedback Created Oct. 7, 2015, 4:06 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « .sitescripts.example ('k') | sitescripts/testpages/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # sitescripts.testpages
2
3 ## Introduction
4
5 This package contains all the dynamic URL handlers required for the otherwise
6 static testpages.adblockplus.org project. This allows us to create test cases
7 for things like sitekeys which require web responses to be generated
8 dynamically.
9
10
11 ## sitescripts.testpages.web.sitekey_frame
12
13 For test cases that test the $sitekey filter option you can use the make use of
14 the `/sitekey-frame` URL handler. The handler renders a template of your
15 choosing, passing in the public key and signature variables. For this you will
16 need to have a suitable RSA key file, a Jinja2 template that makes use of the
17 `public_key` + `signature` variables and a suitable `sitescripts.ini`
18 configuration.
19
20 Here's an example configuration:
21
22 ```
23 [multiplexer]
24 sitescripts.testpages.web.sitekey_frame =
25
26 [testpages]
27 sitekeyFrameTemplate=%(root)s/testpages.adblockplus.org/templates/sitekey_frame. tmpl
28 sitekeyPath=%(root)s/testpages.adblockplus.org/static/site.key
29 ```
30
31 The handler automatically sets the correct `X-Adblock-Key` response header but
32 it's important that the template also populates the `data-adblockkey` attribute
33 of the html element with the public key and signature. For example:
34
35 <html data-adblockkey="{{ public_key + "_" + signature }}">
OLDNEW
« no previous file with comments | « .sitescripts.example ('k') | sitescripts/testpages/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld