OLD | NEW |
(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 }}"> |
OLD | NEW |